diff options
Diffstat (limited to 'sources/shiboken2/data')
-rw-r--r-- | sources/shiboken2/data/CMakeLists.txt | 61 | ||||
-rw-r--r-- | sources/shiboken2/data/GeneratorRunnerConfig.cmake.in | 17 | ||||
-rw-r--r-- | sources/shiboken2/data/GeneratorRunnerConfigVersion.cmake.in | 10 | ||||
-rw-r--r-- | sources/shiboken2/data/Shiboken2Config-spec.cmake.in | 41 | ||||
-rw-r--r-- | sources/shiboken2/data/Shiboken2Config.cmake.in | 5 | ||||
-rw-r--r-- | sources/shiboken2/data/Shiboken2ConfigVersion.cmake.in | 10 | ||||
l--------- | sources/shiboken2/data/docgenerator.1 | 1 | ||||
-rw-r--r-- | sources/shiboken2/data/generatorrunner.1 | 76 | ||||
-rw-r--r-- | sources/shiboken2/data/generatorrunner.pc.in | 13 | ||||
-rw-r--r-- | sources/shiboken2/data/shiboken2.pc.in | 13 | ||||
-rw-r--r-- | sources/shiboken2/data/shiboken_helpers.cmake | 201 |
11 files changed, 0 insertions, 448 deletions
diff --git a/sources/shiboken2/data/CMakeLists.txt b/sources/shiboken2/data/CMakeLists.txt deleted file mode 100644 index e7ce95456..000000000 --- a/sources/shiboken2/data/CMakeLists.txt +++ /dev/null @@ -1,61 +0,0 @@ -if (CMAKE_BUILD_TYPE STREQUAL "Debug") - set(LIBRARY_OUTPUT_SUFFIX ${CMAKE_DEBUG_POSTFIX}) -else() - set(LIBRARY_OUTPUT_SUFFIX ${CMAKE_RELEASE_POSTFIX}) -endif() - -add_custom_target(data) -add_dependencies(data shiboken2) -get_target_property(SHIBOKEN_GENERATOR shiboken2 OUTPUT_NAME) - -include(CMakePackageConfigHelpers) - -# Build-tree / super project package config file. -set(SHIBOKEN_PYTHON_MODULE_DIR "${shiboken2_BINARY_DIR}/shibokenmodule") -set(SHIBOKEN_SHARED_LIBRARY_DIR "${shiboken2_BINARY_DIR}/libshiboken") - -configure_package_config_file( - "${CMAKE_CURRENT_SOURCE_DIR}/Shiboken2Config-spec.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/Shiboken2Config${PYTHON_CONFIG_SUFFIX}.cmake" - INSTALL_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" - PATH_VARS SHIBOKEN_PYTHON_MODULE_DIR SHIBOKEN_SHARED_LIBRARY_DIR - INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}" -) - -# Install-tree / relocatable package config file. -set(SHIBOKEN_PYTHON_MODULE_DIR "${PYTHON_SITE_PACKAGES}/shiboken2") -if (WIN32) - set(SHIBOKEN_SHARED_LIBRARY_DIR "${BIN_INSTALL_DIR}") -else() - set(SHIBOKEN_SHARED_LIBRARY_DIR "${LIB_INSTALL_DIR}") -endif() - -configure_package_config_file( - "${CMAKE_CURRENT_SOURCE_DIR}/Shiboken2Config-spec.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/install/Shiboken2Config${PYTHON_CONFIG_SUFFIX}.cmake" - INSTALL_DESTINATION "${LIB_INSTALL_DIR}/cmake/Shiboken2-${shiboken2_VERSION}" - PATH_VARS SHIBOKEN_PYTHON_MODULE_DIR SHIBOKEN_SHARED_LIBRARY_DIR -) - -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Shiboken2Config.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/Shiboken2Config.cmake" @ONLY) -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Shiboken2ConfigVersion.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/Shiboken2ConfigVersion.cmake" @ONLY) -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/shiboken2.pc.in" - "${CMAKE_CURRENT_BINARY_DIR}/shiboken2${shiboken2_SUFFIX}.pc" @ONLY) - -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Shiboken2Config.cmake" - DESTINATION "${LIB_INSTALL_DIR}/cmake/Shiboken2-${shiboken2_VERSION}") - -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/install/Shiboken2Config${PYTHON_CONFIG_SUFFIX}.cmake" - DESTINATION "${LIB_INSTALL_DIR}/cmake/Shiboken2-${shiboken2_VERSION}") - -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Shiboken2ConfigVersion.cmake" - DESTINATION "${LIB_INSTALL_DIR}/cmake/Shiboken2-${shiboken2_VERSION}") - -install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/shiboken_helpers.cmake" - DESTINATION "${LIB_INSTALL_DIR}/cmake/Shiboken2-${shiboken2_VERSION}") - -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/shiboken2${shiboken2_SUFFIX}.pc" - DESTINATION "${LIB_INSTALL_DIR}/pkgconfig") - diff --git a/sources/shiboken2/data/GeneratorRunnerConfig.cmake.in b/sources/shiboken2/data/GeneratorRunnerConfig.cmake.in deleted file mode 100644 index cf973e2a6..000000000 --- a/sources/shiboken2/data/GeneratorRunnerConfig.cmake.in +++ /dev/null @@ -1,17 +0,0 @@ -# GENERATORRUNNER_INCLUDE_DIR - Directories to include to use GENERATORRUNNER -# GENERATORRUNNER_LIBRARIES - Files to link against to use GENERATORRUNNER -# GENERATORRUNNER_PLUGIN_DIR - Where to find/put plugins for generator runner -# GENERATORRUNNER_BINARY - Executable name - -SET(GENERATORRUNNER_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/generatorrunner@generator_SUFFIX@") -if(MSVC) - SET(GENERATORRUNNER_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@genrunner@generator_SUFFIX@.lib") -elseif(CYGWIN) - SET(GENERATORRUNNER_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_IMPORT_LIBRARY_PREFIX@genrunner@generator_SUFFIX@@CMAKE_IMPORT_LIBRARY_SUFFIX@") -elseif(WIN32) - SET(GENERATORRUNNER_LIBRARY "@CMAKE_INSTALL_PREFIX@/bin/@CMAKE_SHARED_LIBRARY_PREFIX@genrunner@generator_SUFFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@") -else() - SET(GENERATORRUNNER_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@genrunner@generator_SUFFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@") -endif() -SET(GENERATORRUNNER_PLUGIN_DIR "@generator_plugin_DIR@") -SET(GENERATORRUNNER_BINARY "@CMAKE_INSTALL_PREFIX@/bin/generatorrunner@generator_SUFFIX@") diff --git a/sources/shiboken2/data/GeneratorRunnerConfigVersion.cmake.in b/sources/shiboken2/data/GeneratorRunnerConfigVersion.cmake.in deleted file mode 100644 index 8eb5ba479..000000000 --- a/sources/shiboken2/data/GeneratorRunnerConfigVersion.cmake.in +++ /dev/null @@ -1,10 +0,0 @@ -set(PACKAGE_VERSION @generator_VERSION@) - -if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) - set(PACKAGE_VERSION_COMPATIBLE FALSE) -else("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) - set(PACKAGE_VERSION_COMPATIBLE TRUE) - if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") - set(PACKAGE_VERSION_EXACT TRUE) - endif( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") -endif("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) diff --git a/sources/shiboken2/data/Shiboken2Config-spec.cmake.in b/sources/shiboken2/data/Shiboken2Config-spec.cmake.in deleted file mode 100644 index db8373806..000000000 --- a/sources/shiboken2/data/Shiboken2Config-spec.cmake.in +++ /dev/null @@ -1,41 +0,0 @@ -# SHIBOKEN_BUILD_TYPE - Tells if Shiboken was compiled in Release or Debug mode. -# SHIBOKEN_PYTHON_INTERPRETER - Python interpreter (regular or debug) to be used with the bindings. - -@PACKAGE_INIT@ - -# This is the version of Python against which Shiboken was built. Not necessarily the version -# against which a downstream project is built (e.g. PySide2). -set(SHIBOKEN_PYTHON_VERSION_MAJOR "@PYTHON_VERSION_MAJOR@") -set(SHIBOKEN_PYTHON_VERSION_MINOR "@PYTHON_VERSION_MINOR@") -set(SHIBOKEN_PYTHON_VERSION_PATCH "@PYTHON_VERSION_PATCH@") -set(SHIBOKEN_PYTHON_LIMITED_API "@PYTHON_LIMITED_API@") - -# Import targets and call variable set up functions only when using an installed shiboken config -# file (so not during a regular shiboken build, or during a super project build). -if (NOT TARGET Shiboken2::shiboken2) - include("${CMAKE_CURRENT_LIST_DIR}/Shiboken2Targets.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/shiboken_helpers.cmake") - - # Compute the python include and libraries path if needed (aka not part of super project build). - shiboken_find_required_python(@PYTHON_VERSION_MAJOR@) - shiboken_check_if_built_and_target_python_are_compatible() - shiboken_check_if_limited_api() - shiboken_compute_python_includes(IS_CALLED_FROM_EXPORT) - shiboken_compute_python_libraries(IS_CALLED_FROM_EXPORT) -endif() - -# Get the "python interpreter" dynamic global property as a variable instead. It brings it into -# scope for super project builds. -get_property(SHIBOKEN_PYTHON_INTERPRETER GLOBAL PROPERTY SHIBOKEN_PYTHON_INTERPRETER) - -# Set static variables. -set(SHIBOKEN_PYTHON_EXTENSION_SUFFIX "@PYTHON_EXTENSION_SUFFIX@") -set(SHIBOKEN_PYTHON_SHARED_LIBRARY_SUFFIX "@PYTHON_SHARED_LIBRARY_SUFFIX@") -set(SHIBOKEN_PYTHON_CONFIG_SUFFIX "@PYTHON_CONFIG_SUFFIX@") -set(SHIBOKEN_SO_VERSION "@shiboken2_library_so_version@") -set(SHIBOKEN_BUILD_TYPE "@SHIBOKEN_BUILD_TYPE@") - -set_and_check(SHIBOKEN_PYTHON_MODULE_DIR "@PACKAGE_SHIBOKEN_PYTHON_MODULE_DIR@") -set_and_check(SHIBOKEN_SHARED_LIBRARY_DIR "@PACKAGE_SHIBOKEN_SHARED_LIBRARY_DIR@") - -message(STATUS "libshiboken built for @SHIBOKEN_BUILD_TYPE@") diff --git a/sources/shiboken2/data/Shiboken2Config.cmake.in b/sources/shiboken2/data/Shiboken2Config.cmake.in deleted file mode 100644 index e13bd2a12..000000000 --- a/sources/shiboken2/data/Shiboken2Config.cmake.in +++ /dev/null @@ -1,5 +0,0 @@ -if (NOT PYTHON_CONFIG_SUFFIX) - message(STATUS "Shiboken2Config: Using default python: @PYTHON_CONFIG_SUFFIX@") - SET(PYTHON_CONFIG_SUFFIX @PYTHON_CONFIG_SUFFIX@) -endif() -include("${CMAKE_CURRENT_LIST_DIR}/Shiboken2Config${PYTHON_CONFIG_SUFFIX}.cmake") diff --git a/sources/shiboken2/data/Shiboken2ConfigVersion.cmake.in b/sources/shiboken2/data/Shiboken2ConfigVersion.cmake.in deleted file mode 100644 index 9460099b2..000000000 --- a/sources/shiboken2/data/Shiboken2ConfigVersion.cmake.in +++ /dev/null @@ -1,10 +0,0 @@ -set(PACKAGE_VERSION @shiboken2_VERSION@) - -if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) - set(PACKAGE_VERSION_COMPATIBLE FALSE) -else("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) - set(PACKAGE_VERSION_COMPATIBLE TRUE) - if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") - set(PACKAGE_VERSION_EXACT TRUE) - endif( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") -endif("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) diff --git a/sources/shiboken2/data/docgenerator.1 b/sources/shiboken2/data/docgenerator.1 deleted file mode 120000 index c65282f98..000000000 --- a/sources/shiboken2/data/docgenerator.1 +++ /dev/null @@ -1 +0,0 @@ -generatorrunner.1
\ No newline at end of file diff --git a/sources/shiboken2/data/generatorrunner.1 b/sources/shiboken2/data/generatorrunner.1 deleted file mode 100644 index f5a61f139..000000000 --- a/sources/shiboken2/data/generatorrunner.1 +++ /dev/null @@ -1,76 +0,0 @@ -.TH GENERATORRUNNER 1 "SEPTEMBER 2009" Linux "User Manuals" -.SH NAME -generatorrunner - plugin-based binding source code generator -.SH SYNOPSIS -.B generatorrunner \-\-generator-set=<plugin name> [options] header-file typesystem-file -.SH DESCRIPTION -.B generatorrunner -is a utility that uses the information taken from APIExtractor -related to the provided C++ headers and typesystem files and execute -generators using this information. Generators are plugins and you need -to specify one using the \-\-generator-set parameter. At the moment there -are two generators available: - -.B qtdoc -\- Generates Sphinx-based documentation for C++ libraries documented using -.B qdoc -documentation syntax, using the XML files created by the documentation tool -.B (qdoc). -Can be called supplying -.B \-\-generator-set=qtdoc -to -.B generatorrunner -or by calling the convenience executable -.B docgenerator. - -Other plugins can be used with -.B generatorrunner, -provided that they follow the generator front-end specifications, -and can be written to generate code or documentation for any target -languague you desire. For more information about the generator front-end -architecture and current limitations, refer to http://www.pyside.org/home-binding. - -.SH OPTIONS -.SS "General options" -.IP \-\-api-version=<version> -Specify the supported api version used to generate the bindings. -.IP \-\-debug-level=[sparse|medium|full] -The amount of messages displayed. -.IP \-\-documentation-only -Only generates the documentation. -.IP \-\-drop-type-entries="<TypeEntry0>[;TypeEntry1;...]" -Semicolon separated list of type system entries (classes, namespaces, global functions and enums) to be dropped from generation. -.IP \-\-help \fR,\fP \-h \fR,\fP -? -Prints the usage message. -.IP \-\-project-file=<file> -Text file containing a description of the binding project. Replaces and overrides command line arguments. -.IP \-\-include\-paths=\fI<path>[:path:..]\fR -The directories where the generator will search for the -headers. Works like gcc's \-I flag. -.IP \-\-license\-file=\fI[licensefile]\fR -Template for copyright headers of generated files. -.IP \-\-no\-supress\-warnings -Show all warnings. -.IP \-\-output\-directory=\fI[dir]\fR -The directory where the generated files will be written. -.IP \-\-silent -Avoid printing any messages. -.IP \-\-typesytem\-paths=\fI<path>[:path:..]\fR -The directories where the generator will search for the -external typesystems referred by the main one. -.IP \-\-version -Displays the current version. -Drops support for named args. -.SS "Specific to qtdoc plugin" -.IP \-\-documentation\-code\-snippets\-dir -Directory used to search code snippets used by the documentation -.IP \-\-documentation\-data\-dir -Directory with XML files generated by documentation tool (qdoc or Doxygen) -.IP \-\-documentation\-out\-dir -The directory where the generated documentation files will be written -.IP \-\-library\-source\-dir -Directory where library source code is located - -.SH AUTHORS -Lauro Moura <lauro.neto at openbossa dot org>, Bruno Araujo <bruno.araujo at openbossa dot org>, Hugo Lima <hugo.lima at openbossa dot org> - diff --git a/sources/shiboken2/data/generatorrunner.pc.in b/sources/shiboken2/data/generatorrunner.pc.in deleted file mode 100644 index a566f4356..000000000 --- a/sources/shiboken2/data/generatorrunner.pc.in +++ /dev/null @@ -1,13 +0,0 @@ -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=@CMAKE_INSTALL_PREFIX@ -libdir=@LIB_INSTALL_DIR@ -includedir=@CMAKE_INSTALL_PREFIX@/include - - -Name: generatorrunner@generator_SUFFIX@ -Description: Generator Runner loads and calls binding generator front-ends. -Requires: apiextractor -Version: @generatorrunner_VERSION@ -Libs: -L${libdir} -lgenrunner@generator_SUFFIX@ -Cflags: -I${includedir}@generator_SUFFIX@ - diff --git a/sources/shiboken2/data/shiboken2.pc.in b/sources/shiboken2/data/shiboken2.pc.in deleted file mode 100644 index 10db59e1e..000000000 --- a/sources/shiboken2/data/shiboken2.pc.in +++ /dev/null @@ -1,13 +0,0 @@ -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=@CMAKE_INSTALL_PREFIX@ -libdir=@LIB_INSTALL_DIR@ -includedir=@CMAKE_INSTALL_PREFIX@/include/shiboken2 -generator_location=@CMAKE_INSTALL_PREFIX@/bin/@SHIBOKEN_GENERATOR@ -python_interpreter=@PYTHON_EXECUTABLE@ -python_include_dir=@PYTHON_INCLUDE_DIRS@ - -Name: shiboken2 -Description: Support library for Python bindings created with the Shiboken2 generator. -Version: @shiboken2_VERSION@ -Libs: @SHIBOKEN_PYTHON_LIBRARIES@ -L${libdir} -lshiboken2@shiboken2_SUFFIX@@PYTHON_SHARED_LIBRARY_SUFFIX@@LIBRARY_OUTPUT_SUFFIX@ -Cflags: -I@PYTHON_INCLUDE_DIRS@ -I${includedir}/@shiboken2_SUFFIX@@SBK_PKG_CONFIG_PY_DEBUG_DEFINITION@ diff --git a/sources/shiboken2/data/shiboken_helpers.cmake b/sources/shiboken2/data/shiboken_helpers.cmake deleted file mode 100644 index f4dd4d5dc..000000000 --- a/sources/shiboken2/data/shiboken_helpers.cmake +++ /dev/null @@ -1,201 +0,0 @@ -include(CMakeParseArguments) - -macro(shiboken_parse_all_arguments prefix type flags options multiopts) - cmake_parse_arguments(${prefix} "${flags}" "${options}" "${multiopts}" ${ARGN}) - if(DEFINED ${prefix}_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "Unknown arguments were passed to ${type} (${${prefix}_UNPARSED_ARGUMENTS}).") - endif() -endmacro() - -macro(shiboken_check_if_limited_api) - # On Windows, PYTHON_LIBRARIES can be a list. Example: - # optimized;C:/Python36/libs/python36.lib;debug;C:/Python36/libs/python36_d.lib - # On other platforms, this result is not used at all. - execute_process( - COMMAND ${PYTHON_EXECUTABLE} -c "if True: - for lib in '${PYTHON_LIBRARIES}'.split(';'): - if '/' in lib: - prefix, py = lib.rsplit('/', 1) - if py.startswith('python3'): - print(prefix + '/python3.lib') - break - " - OUTPUT_VARIABLE PYTHON_LIMITED_LIBRARIES - OUTPUT_STRIP_TRAILING_WHITESPACE) - - if(FORCE_LIMITED_API STREQUAL "yes") - if (${PYTHON_VERSION_MAJOR} EQUAL 3 AND ${PYTHON_VERSION_MINOR} GREATER 4) - # GREATER_EQUAL is available only from cmake 3.7 on. We mean python 3.5 . - set(PYTHON_LIMITED_API 1) - endif() - if(WIN32) - if (${PYTHON_VERSION_MAJOR} EQUAL 3 AND ${PYTHON_VERSION_MINOR} GREATER 4) - # PYSIDE-560: XXX maybe add an option to setup.py as override - set(SHIBOKEN_PYTHON_LIBRARIES ${PYTHON_LIMITED_LIBRARIES}) - endif() - endif() - endif() -endmacro() - - -macro(shiboken_find_required_python) - if(${ARGC} GREATER 0) - find_package(PythonInterp ${ARGV0} REQUIRED) - find_package(PythonLibs ${ARGV0} REQUIRED) - else() - # If no version is specified, just use any interpreter that can be found (from PATH). - # This is useful for super-project builds, so that the default system interpeter - # gets picked up (e.g. /usr/bin/python and not /usr/bin/python2.7). - find_package(PythonInterp REQUIRED) - find_package(PythonLibs REQUIRED) - endif() - shiboken_validate_python_version() - - set(SHIBOKEN_PYTHON_INTERPRETER "${PYTHON_EXECUTABLE}") - set_property(GLOBAL PROPERTY SHIBOKEN_PYTHON_INTERPRETER "${PYTHON_EXECUTABLE}") -endmacro() - -macro(shiboken_validate_python_version) - if((PYTHON_VERSION_MAJOR EQUAL "2" AND PYTHON_VERSION_MINOR LESS "7") OR - (PYTHON_VERSION_MAJOR EQUAL "3" AND PYTHON_VERSION_MINOR LESS "5")) - message(FATAL_ERROR - "Shiboken requires Python 2.7+ or Python 3.5+.") - endif() -endmacro() - -macro(shiboken_compute_python_includes) - shiboken_parse_all_arguments( - "SHIBOKEN_COMPUTE_INCLUDES" "shiboken_compute_python_includes" - "IS_CALLED_FROM_EXPORT" "" "" ${ARGN}) - - - # If the installed shiboken config file is used, - # append the found Python include dirs as an interface property on the libshiboken target. - # This needs to be dynamic because the user of the library might have python installed - # in a different path than when shiboken was originally built. - # Otherwise if shiboken is currently being built itself (either as standalone, or super project - # build) append the include dirs as PUBLIC. - if (SHIBOKEN_COMPUTE_INCLUDES_IS_CALLED_FROM_EXPORT) - #TODO target_include_directories works on imported targets only starting with v3.11.0. - set_property(TARGET Shiboken2::libshiboken - APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PYTHON_INCLUDE_DIRS}) - else() - target_include_directories(libshiboken - PUBLIC $<BUILD_INTERFACE:${PYTHON_INCLUDE_DIRS}>) - endif() - - - set(SHIBOKEN_PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIRS}") - message(STATUS - "SHIBOKEN_PYTHON_INCLUDE_DIRS computed to value: '${SHIBOKEN_PYTHON_INCLUDE_DIRS}'") -endmacro() - -# Given a list of the following form: -# optimized;C:/Python36/libs/python36.lib;debug;C:/Python36/libs/python36_d.lib -# choose the correpsonding library to use, based on the current configuration type. -function(shiboken_get_library_for_current_config library_list current_config out_var) - list(FIND library_list "optimized" optimized_found) - list(FIND library_list "general" general_found) - list(FIND library_list "debug" debug_found) - - if (optimized_found OR general_found OR debug_found) - # Iterate over library list to find the most appropriate library. - foreach(token ${library_list}) - if(token STREQUAL "optimized" OR token STREQUAL "general") - set(is_debug 0) - set(token1 1) - set(lib "") - elseif(token STREQUAL "debug") - set(is_debug 1) - set(token1 1) - set(lib "") - elseif(EXISTS ${token}) - set(lib ${token}) - set(token2 1) - else() - set(token1 0) - set(token2 0) - set(lib "") - endif() - - if(token1 AND token2) - if((is_debug AND lib AND current_config STREQUAL "Debug") - OR (NOT is_debug AND lib AND (NOT current_config STREQUAL "Debug"))) - set(${out_var} ${lib} PARENT_SCOPE) - return() - endif() - endif() - endforeach() - else() - # No configuration specific libraries found, just set the original value. - set(${out_var} "${library_list}" PARENT_SCOPE) - endif() - -endfunction() - -macro(shiboken_compute_python_libraries) - shiboken_parse_all_arguments( - "SHIBOKEN_COMPUTE_LIBS" "shiboken_compute_python_libraries" - "IS_CALLED_FROM_EXPORT" "" "" ${ARGN}) - - if (NOT SHIBOKEN_PYTHON_LIBRARIES) - set(SHIBOKEN_PYTHON_LIBRARIES "") - endif() - - if(CMAKE_BUILD_TYPE STREQUAL "Debug") - if(WIN32 AND NOT SHIBOKEN_PYTHON_LIBRARIES) - set(SHIBOKEN_PYTHON_LIBRARIES ${PYTHON_DEBUG_LIBRARIES}) - endif() - endif() - - if(CMAKE_BUILD_TYPE STREQUAL "Release") - if(WIN32 AND NOT SHIBOKEN_PYTHON_LIBRARIES) - set(SHIBOKEN_PYTHON_LIBRARIES ${PYTHON_LIBRARIES}) - endif() - endif() - - # If the resulting variable - # contains a "debug;X;optimized;Y" list like described in shiboken_check_if_limited_api, - # make sure to pick just one, so that the final generator expressions are valid. - shiboken_get_library_for_current_config("${SHIBOKEN_PYTHON_LIBRARIES}" "${CMAKE_BUILD_TYPE}" "SHIBOKEN_PYTHON_LIBRARIES") - - if(APPLE) - set(SHIBOKEN_PYTHON_LIBRARIES "-undefined dynamic_lookup") - endif() - - # If the installed shiboken config file is used, - # append the computed Python libraries as an interface property on the libshiboken target. - # This needs to be dynamic because the user of the library might have python installed - # in a different path than when shiboken was originally built. - # Otherwise if shiboken is currently being built itself (either as standalone, or super project - # build) append the libraries as PUBLIC. - if (SHIBOKEN_COMPUTE_LIBS_IS_CALLED_FROM_EXPORT) - #TODO target_link_libraries works on imported targets only starting with v3.11.0. - set_property(TARGET Shiboken2::libshiboken - APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${SHIBOKEN_PYTHON_LIBRARIES}) - else() - target_link_libraries(libshiboken - PUBLIC $<BUILD_INTERFACE:${SHIBOKEN_PYTHON_LIBRARIES}>) - endif() - - message(STATUS "SHIBOKEN_PYTHON_LIBRARIES computed to value: '${SHIBOKEN_PYTHON_LIBRARIES}'") -endmacro() - -function(shiboken_check_if_built_and_target_python_are_compatible) - if(NOT SHIBOKEN_PYTHON_VERSION_MAJOR STREQUAL PYTHON_VERSION_MAJOR) - message(FATAL_ERROR "The detected Python major version is not \ -compatible with the Python major version which was used when Shiboken was built. -Built with: '${SHIBOKEN_PYTHON_VERSION_MAJOR}.${SHIBOKEN_PYTHON_VERSION_MINOR}' \ -Detected: '${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}'") - else() - if(NOT SHIBOKEN_PYTHON_LIMITED_API - AND NOT SHIBOKEN_PYTHON_VERSION_MINOR STREQUAL PYTHON_VERSION_MINOR) - message(FATAL_ERROR - "The detected Python minor version is not compatible with the Python minor \ -version which was used when Shiboken was built. Consider building shiboken with \ -FORCE_LIMITED_API set to '1', so that only the Python major version matters. -Built with: '${SHIBOKEN_PYTHON_VERSION_MAJOR}.${SHIBOKEN_PYTHON_VERSION_MINOR}' \ -Detected: '${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}'") - endif() - endif() -endfunction() |