diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-04-18 14:04:42 +0200 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2019-04-20 08:33:07 +0000 |
commit | 077006a9ea18305a183e2cf809e3b88e5f7f3619 (patch) | |
tree | e1219b0e8e9bbf189881cd4ab030438fd6e15745 /sources/shiboken2/generator | |
parent | 48625f9447caaea3fb9524169bb75dd881cdf4c9 (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/generator')
-rw-r--r-- | sources/shiboken2/generator/CMakeLists.txt | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/sources/shiboken2/generator/CMakeLists.txt b/sources/shiboken2/generator/CMakeLists.txt index 890790522..745c366f5 100644 --- a/sources/shiboken2/generator/CMakeLists.txt +++ b/sources/shiboken2/generator/CMakeLists.txt @@ -9,29 +9,23 @@ shiboken2/shibokengenerator.cpp main.cpp ) -if (NOT DISABLE_DOCSTRINGS) - set(shiboken2_SRC ${shiboken2_SRC} qtdoc/qtdocgenerator.cpp) - add_definitions(-DDOCSTRINGS_ENABLED) -endif() - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/shiboken2 +add_executable(shiboken2 ${shiboken2_SRC}) +add_executable(Shiboken2::shiboken2 ALIAS shiboken2) +add_dependencies(shiboken2 apiextractor) +set_target_properties(shiboken2 PROPERTIES OUTPUT_NAME shiboken2${shiboken2_SUFFIX}) +target_include_directories(shiboken2 PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/shiboken2 ${CMAKE_CURRENT_SOURCE_DIR}/qtdoc ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${apiextractor_SOURCE_DIR} - ${Qt5Core_INCLUDE_DIRS} - ${Qt5XmlPatterns_INCLUDE_DIRS} ) - -add_executable(shiboken2 ${shiboken2_SRC}) -add_executable(Shiboken2::shiboken2 ALIAS shiboken2) -add_dependencies(shiboken2 apiextractor) -set_target_properties(shiboken2 PROPERTIES OUTPUT_NAME shiboken2${shiboken2_SUFFIX}) -target_link_libraries(shiboken2 - apiextractor - ${Qt5Core_LIBRARIES} - ${Qt5XmlPatterns_LIBRARIES} - ) +target_link_libraries(shiboken2 apiextractor Qt5::Core) +if (NOT DISABLE_DOCSTRINGS) + target_sources(shiboken2 PRIVATE qtdoc/qtdocgenerator.cpp) + target_compile_definitions(shiboken2 PUBLIC DOCSTRINGS_ENABLED) + target_link_libraries(shiboken2 Qt5::XmlPatterns) +endif() configure_file(shibokenconfig.h.in "${CMAKE_CURRENT_BINARY_DIR}/shibokenconfig.h" @ONLY) |