aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/tests/smartbinding/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/tests/smartbinding/CMakeLists.txt')
-rw-r--r--sources/shiboken2/tests/smartbinding/CMakeLists.txt39
1 files changed, 39 insertions, 0 deletions
diff --git a/sources/shiboken2/tests/smartbinding/CMakeLists.txt b/sources/shiboken2/tests/smartbinding/CMakeLists.txt
new file mode 100644
index 000000000..e9c52d447
--- /dev/null
+++ b/sources/shiboken2/tests/smartbinding/CMakeLists.txt
@@ -0,0 +1,39 @@
+project(smart)
+
+set(smart_TYPESYSTEM
+${CMAKE_CURRENT_SOURCE_DIR}/typesystem_smart.xml
+)
+
+set(smart_SRC
+${CMAKE_CURRENT_BINARY_DIR}/smart/smart_module_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/smart/obj_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/smart/integer_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/smart/sharedptr_obj_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/smart/sharedptr_integer_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/smart/registry_wrapper.cpp
+)
+
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/smart-binding.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/smart-binding.txt" @ONLY)
+
+add_custom_command(OUTPUT ${smart_SRC}
+COMMAND shiboken2 --project-file=${CMAKE_CURRENT_BINARY_DIR}/smart-binding.txt ${GENERATOR_EXTRA_FLAGS}
+DEPENDS ${smart_TYPESYSTEM} ${CMAKE_CURRENT_SOURCE_DIR}/global.h shiboken2
+WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+COMMENT "Running generator for 'smart' test binding..."
+)
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}
+ ${SBK_PYTHON_INCLUDE_DIR}
+ ${libsmart_SOURCE_DIR}
+ ${libshiboken_SOURCE_DIR})
+add_library(smart MODULE ${smart_SRC})
+set_property(TARGET smart PROPERTY PREFIX "")
+if(WIN32)
+ set_property(TARGET smart PROPERTY SUFFIX ".pyd")
+endif()
+target_link_libraries(smart
+ libsmart
+ ${SBK_PYTHON_LIBRARIES}
+ libshiboken)