summaryrefslogtreecommitdiffstats
path: root/tests/minimalbinding/CMakeLists.txt
blob: 6229dd7cbee09d1f54b5698b5ead9770e43ff423 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
project(minimal)

set(minimal_TYPESYSTEM
${CMAKE_CURRENT_SOURCE_DIR}/typesystem_minimal.xml
)

set(minimal_SRC
${CMAKE_CURRENT_BINARY_DIR}/minimal/minimal_module_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/minimal/obj_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/minimal/val_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/minimal/listuser_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/minimal/minbooluser_wrapper.cpp
)

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/minimal-binding.txt.in"
               "${CMAKE_CURRENT_BINARY_DIR}/minimal-binding.txt" @ONLY)

add_custom_command(OUTPUT ${minimal_SRC}
COMMAND ${GENERATORRUNNER_BINARY} --project-file=${CMAKE_CURRENT_BINARY_DIR}/minimal-binding.txt ${GENERATOR_EXTRA_FLAGS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Running generator for 'minimal' test binding..."
)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}
                    ${CMAKE_SOURCE_DIR}
                    ${SBK_PYTHON_INCLUDE_DIR}
                    ${libminimal_SOURCE_DIR}
                    ${libshiboken_SOURCE_DIR})
add_library(minimal MODULE ${minimal_SRC})
set_property(TARGET minimal PROPERTY PREFIX "")
if(WIN32)
    set_property(TARGET minimal PROPERTY SUFFIX ".pyd")
endif()
target_link_libraries(minimal
                      libminimal
                      ${SBK_PYTHON_LIBRARIES}
                      libshiboken)

add_dependencies(minimal shiboken_generator)