diff options
Diffstat (limited to 'sources/shiboken2/tests')
14 files changed, 29 insertions, 57 deletions
diff --git a/sources/shiboken2/tests/CMakeLists.txt b/sources/shiboken2/tests/CMakeLists.txt index c06c56f6d..085a4344c 100644 --- a/sources/shiboken2/tests/CMakeLists.txt +++ b/sources/shiboken2/tests/CMakeLists.txt @@ -1,6 +1,3 @@ -find_package(Qt5 REQUIRED COMPONENTS Core) -include_directories(${Qt5Core_INCLUDE_DIRS}) - add_subdirectory(libminimal) if(NOT DEFINED MINIMAL_TESTS) add_subdirectory(libsample) diff --git a/sources/shiboken2/tests/dumpcodemodel/CMakeLists.txt b/sources/shiboken2/tests/dumpcodemodel/CMakeLists.txt index af18cb3c8..7c6d60fe2 100644 --- a/sources/shiboken2/tests/dumpcodemodel/CMakeLists.txt +++ b/sources/shiboken2/tests/dumpcodemodel/CMakeLists.txt @@ -1,5 +1,6 @@ add_executable(dumpcodemodel main.cpp) -include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${apiextractor_SOURCE_DIR} ${Qt5Core_INCLUDE_DIRS}) +target_include_directories(dumpcodemodel + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${apiextractor_SOURCE_DIR}) -target_link_libraries(dumpcodemodel apiextractor ${Qt5Core_LIBRARIES}) +target_link_libraries(dumpcodemodel PUBLIC apiextractor Qt5::Core) diff --git a/sources/shiboken2/tests/libminimal/CMakeLists.txt b/sources/shiboken2/tests/libminimal/CMakeLists.txt index a25892571..f906bdb84 100644 --- a/sources/shiboken2/tests/libminimal/CMakeLists.txt +++ b/sources/shiboken2/tests/libminimal/CMakeLists.txt @@ -6,8 +6,8 @@ listuser.cpp typedef.cpp ) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -add_definitions("-DLIBMINIMAL_BUILD") add_library(libminimal SHARED ${libminimal_SRC}) +target_include_directories(libminimal PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_compile_definitions(libminimal PRIVATE LIBMINIMAL_BUILD) set_property(TARGET libminimal PROPERTY PREFIX "") diff --git a/sources/shiboken2/tests/libother/CMakeLists.txt b/sources/shiboken2/tests/libother/CMakeLists.txt index 9b3cf5552..6aba91e13 100644 --- a/sources/shiboken2/tests/libother/CMakeLists.txt +++ b/sources/shiboken2/tests/libother/CMakeLists.txt @@ -7,12 +7,10 @@ otherobjecttype.cpp othermultiplederived.cpp ) -add_definitions("-DLIBOTHER_BUILD") add_library(libother SHARED ${libother_SRC}) +target_include_directories(libother PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_compile_definitions(libother PRIVATE LIBOTHER_BUILD) +target_link_libraries(libother PUBLIC libsample) set_property(TARGET libother PROPERTY PREFIX "") -include_directories(${CMAKE_CURRENT_SOURCE_DIR} - ${libsample_SOURCE_DIR} - ${libsample_SOURCE_DIR}/..) -target_link_libraries(libother libsample) diff --git a/sources/shiboken2/tests/libsample/CMakeLists.txt b/sources/shiboken2/tests/libsample/CMakeLists.txt index ae3d40312..170829fbc 100644 --- a/sources/shiboken2/tests/libsample/CMakeLists.txt +++ b/sources/shiboken2/tests/libsample/CMakeLists.txt @@ -51,8 +51,8 @@ expression.cpp filter.cpp ) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -add_definitions("-DLIBSAMPLE_BUILD") add_library(libsample SHARED ${libsample_SRC}) +target_include_directories(libsample PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_compile_definitions(libsample PRIVATE LIBSAMPLE_BUILD) set_property(TARGET libsample PROPERTY PREFIX "") diff --git a/sources/shiboken2/tests/libsmart/CMakeLists.txt b/sources/shiboken2/tests/libsmart/CMakeLists.txt index 66c27cdae..152c57f25 100644 --- a/sources/shiboken2/tests/libsmart/CMakeLists.txt +++ b/sources/shiboken2/tests/libsmart/CMakeLists.txt @@ -4,8 +4,8 @@ set(libsmart_SRC smart.cpp ) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -add_definitions("-DLIBSMART_BUILD") add_library(libsmart SHARED ${libsmart_SRC}) +target_include_directories(libsmart PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_compile_definitions(libsmart PRIVATE LIBSMART_BUILD) set_property(TARGET libsmart PROPERTY PREFIX "") diff --git a/sources/shiboken2/tests/minimalbinding/CMakeLists.txt b/sources/shiboken2/tests/minimalbinding/CMakeLists.txt index 7301e1882..ffeb086a0 100644 --- a/sources/shiboken2/tests/minimalbinding/CMakeLists.txt +++ b/sources/shiboken2/tests/minimalbinding/CMakeLists.txt @@ -24,18 +24,13 @@ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Running generator for 'minimal' test binding..." ) -include_directories(${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR} - ${libminimal_SOURCE_DIR} - ${libshiboken_SOURCE_DIR} - ${libshiboken_BINARY_DIR}) add_library(minimal MODULE ${minimal_SRC}) +target_include_directories(minimal PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(minimal PUBLIC libminimal libshiboken) set_property(TARGET minimal PROPERTY PREFIX "") set_property(TARGET minimal PROPERTY OUTPUT_NAME "minimal${PYTHON_EXTENSION_SUFFIX}") if(WIN32) set_property(TARGET minimal PROPERTY SUFFIX ".pyd") endif() -target_link_libraries(minimal - libminimal - libshiboken) + create_generator_target(minimal) diff --git a/sources/shiboken2/tests/minimalbinding/typesystem_minimal.xml b/sources/shiboken2/tests/minimalbinding/typesystem_minimal.xml index 968b27c53..03b88a970 100644 --- a/sources/shiboken2/tests/minimalbinding/typesystem_minimal.xml +++ b/sources/shiboken2/tests/minimalbinding/typesystem_minimal.xml @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <typesystem package="minimal"> <primitive-type name="bool"/> <primitive-type name="int"/> diff --git a/sources/shiboken2/tests/otherbinding/CMakeLists.txt b/sources/shiboken2/tests/otherbinding/CMakeLists.txt index 44855e297..bc5c4bdad 100644 --- a/sources/shiboken2/tests/otherbinding/CMakeLists.txt +++ b/sources/shiboken2/tests/otherbinding/CMakeLists.txt @@ -26,26 +26,17 @@ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Running generator for 'other' test binding..." ) -include_directories(${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR} - ${libother_SOURCE_DIR} - ${libsample_SOURCE_DIR} - ${libsample_SOURCE_DIR}/.. - ${sample_BINARY_DIR} - ${sample_BINARY_DIR}/sample - ${libshiboken_SOURCE_DIR} - ${libshiboken_BINARY_DIR}) add_library(other MODULE ${other_SRC}) +target_include_directories(other PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + ${sample_BINARY_DIR}/sample) +target_link_libraries(other PUBLIC libother libsample libshiboken) set_property(TARGET other PROPERTY PREFIX "") set_property(TARGET other PROPERTY OUTPUT_NAME "other${PYTHON_EXTENSION_SUFFIX}") if(WIN32) set_property(TARGET other PROPERTY SUFFIX ".pyd") endif() -target_link_libraries(other - libother - libsample - libshiboken) + add_dependencies(other sample) create_generator_target(other) diff --git a/sources/shiboken2/tests/otherbinding/typesystem_other.xml b/sources/shiboken2/tests/otherbinding/typesystem_other.xml index 63ccdd518..2932dafb3 100644 --- a/sources/shiboken2/tests/otherbinding/typesystem_other.xml +++ b/sources/shiboken2/tests/otherbinding/typesystem_other.xml @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <typesystem package="other"> <load-typesystem name="typesystem_sample.xml" generate="no" /> diff --git a/sources/shiboken2/tests/samplebinding/CMakeLists.txt b/sources/shiboken2/tests/samplebinding/CMakeLists.txt index 9ecbd98e6..61090d30e 100644 --- a/sources/shiboken2/tests/samplebinding/CMakeLists.txt +++ b/sources/shiboken2/tests/samplebinding/CMakeLists.txt @@ -137,19 +137,14 @@ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Running generator for 'sample' test binding..." ) -include_directories(${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR} - ${libsample_SOURCE_DIR} - ${libshiboken_SOURCE_DIR} - ${libshiboken_BINARY_DIR}) add_library(sample MODULE ${sample_SRC}) +target_include_directories(sample PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(sample PUBLIC libsample libshiboken) set_property(TARGET sample PROPERTY PREFIX "") set_property(TARGET sample PROPERTY OUTPUT_NAME "sample${PYTHON_EXTENSION_SUFFIX}") if(WIN32) set_property(TARGET sample PROPERTY SUFFIX ".pyd") endif() -target_link_libraries(sample - libsample - libshiboken) + create_generator_target(sample) diff --git a/sources/shiboken2/tests/samplebinding/typesystem_sample.xml b/sources/shiboken2/tests/samplebinding/typesystem_sample.xml index 78ceaab43..19b4948a1 100644 --- a/sources/shiboken2/tests/samplebinding/typesystem_sample.xml +++ b/sources/shiboken2/tests/samplebinding/typesystem_sample.xml @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <typesystem package="sample"> <suppress-warning text="Duplicate type entry: 'sample'" /> <suppress-warning text="Duplicate type entry: 'SampleNamespace'" /> diff --git a/sources/shiboken2/tests/smartbinding/CMakeLists.txt b/sources/shiboken2/tests/smartbinding/CMakeLists.txt index ed6bcef0a..88a7bc059 100644 --- a/sources/shiboken2/tests/smartbinding/CMakeLists.txt +++ b/sources/shiboken2/tests/smartbinding/CMakeLists.txt @@ -27,19 +27,14 @@ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Running generator for 'smart' test binding..." ) -include_directories(${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR} - ${libsmart_SOURCE_DIR} - ${libshiboken_SOURCE_DIR} - ${libshiboken_BINARY_DIR}) add_library(smart MODULE ${smart_SRC}) +target_include_directories(smart PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(smart PUBLIC libsmart libshiboken) set_property(TARGET smart PROPERTY PREFIX "") set_property(TARGET smart PROPERTY OUTPUT_NAME "smart${PYTHON_EXTENSION_SUFFIX}") if(WIN32) set_property(TARGET smart PROPERTY SUFFIX ".pyd") endif() -target_link_libraries(smart - libsmart - libshiboken) + create_generator_target(smart) diff --git a/sources/shiboken2/tests/smartbinding/typesystem_smart.xml b/sources/shiboken2/tests/smartbinding/typesystem_smart.xml index aea1c2f73..0bb485957 100644 --- a/sources/shiboken2/tests/smartbinding/typesystem_smart.xml +++ b/sources/shiboken2/tests/smartbinding/typesystem_smart.xml @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <typesystem package="smart"> <primitive-type name="int" /> <primitive-type name="char" /> |