aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/shibokenmodule
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-04-18 14:04:42 +0200
committerChristian Tismer <tismer@stackless.com>2019-04-20 08:33:07 +0000
commit077006a9ea18305a183e2cf809e3b88e5f7f3619 (patch)
treee1219b0e8e9bbf189881cd4ab030438fd6e15745 /sources/shiboken2/shibokenmodule
parent48625f9447caaea3fb9524169bb75dd881cdf4c9 (diff)
Modernize and clean up some of the shiboken build system files
Use target_* commands instead of subdirectory based commands for adding link options, compile definitions, include directories, etc. Remove some non-used compile definitions. Move around some of the find_package() and option() calls. Simplify some of the package dependent logic. Replace the qt include and linking variables with CMake targets. Change-Id: I815595344e63a32dce3dc78652359beede3ff593 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/shibokenmodule')
-rw-r--r--sources/shiboken2/shibokenmodule/CMakeLists.txt18
1 files changed, 5 insertions, 13 deletions
diff --git a/sources/shiboken2/shibokenmodule/CMakeLists.txt b/sources/shiboken2/shibokenmodule/CMakeLists.txt
index 61c38c5d..09731240 100644
--- a/sources/shiboken2/shibokenmodule/CMakeLists.txt
+++ b/sources/shiboken2/shibokenmodule/CMakeLists.txt
@@ -3,14 +3,9 @@ project(shibokenmodule)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/shibokenmodule.txt.in"
"${CMAKE_CURRENT_BINARY_DIR}/shibokenmodule.txt" @ONLY)
+set(sample_SRC ${CMAKE_CURRENT_BINARY_DIR}/shiboken2/shiboken2_module_wrapper.cpp)
-set(sample_SRC
-${CMAKE_CURRENT_BINARY_DIR}/shiboken2/shiboken2_module_wrapper.cpp
-)
-
-set(shibokenmodule_TYPESYSTEM
-${CMAKE_CURRENT_SOURCE_DIR}/typesystem_shiboken.xml
-)
+set(shibokenmodule_TYPESYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_shiboken.xml)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/mjb_rejected_classes.log"
@@ -24,19 +19,16 @@ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Running generator for 'shiboken2'..."
)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_SOURCE_DIR}
- ${libshiboken_SOURCE_DIR}
- ${libshiboken_BINARY_DIR})
add_library(shibokenmodule MODULE ${sample_SRC})
+target_include_directories(shibokenmodule PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR})
set_property(TARGET shibokenmodule PROPERTY PREFIX "")
set_property(TARGET shibokenmodule PROPERTY OUTPUT_NAME "shiboken2${PYTHON_EXTENSION_SUFFIX}")
if(WIN32)
set_property(TARGET shibokenmodule PROPERTY SUFFIX ".pyd")
endif()
-target_link_libraries(shibokenmodule
- libshiboken)
+target_link_libraries(shibokenmodule PUBLIC libshiboken)
add_dependencies(shibokenmodule shiboken2)
create_generator_target(shibokenmodule)