-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathAddHDEPythonModule.cmake
46 lines (35 loc) · 1.29 KB
/
AddHDEPythonModule.cmake
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
41
42
43
44
45
46
# SPDX-FileCopyrightText: Fondazione Istituto Italiano di Tecnologia (IIT)
# SPDX-License-Identifier: BSD-3-Clause
function(add_hde_python_module)
set(options )
set(oneValueArgs NAME)
set(multiValueArgs
SOURCES
HEADERS
LINK_LIBRARIES
TESTS
TESTS_RUNTIME_CONDITIONS)
set(prefix "hde")
cmake_parse_arguments(${prefix}
"${options}"
"${oneValueArgs}"
"${multiValueArgs}"
${ARGN})
set(name ${${prefix}_NAME})
set(is_interface ${${prefix}_IS_INTERFACE})
set(sources ${${prefix}_SOURCES})
set(headers ${${prefix}_HEADERS})
set(link_libraries ${${prefix}_LINK_LIBRARIES})
set(subdirectories ${${prefix}_SUBDIRECTORIES})
set(tests ${${prefix}_TESTS})
set(tests_runtime_conditions ${${prefix}_TESTS_RUNTIME_CONDITIONS})
foreach(file ${headers})
set_property(GLOBAL APPEND PROPERTY pybind_headers ${CMAKE_CURRENT_SOURCE_DIR}/${file})
endforeach()
foreach(file ${sources})
set_property(GLOBAL APPEND PROPERTY pybind_sources ${CMAKE_CURRENT_SOURCE_DIR}/${file})
endforeach()
set_property(GLOBAL APPEND PROPERTY pybind_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}/include)
set_property(GLOBAL APPEND PROPERTY pybind_link_libraries ${link_libraries})
message(STATUS "Added files for bindings named ${name} in ${PROJECT_NAME}.")
endfunction()