-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
45 lines (34 loc) · 1.35 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.5)
project(SPLIB VERSION 3.0)
include(cmake/environment.cmake)
find_package(Sofa.Config REQUIRED)
find_package(SofaPython3 REQUIRED)
if(SofaPython3_FOUND)
message("-- Found SofaPython3")
SP3_add_python_package(
SOURCE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/python3/splib
TARGET_DIRECTORY splib
)
endif()
set(HEADER_FILES src/cpp/splib/initPlugin.h)
set(SOURCE_FILES src/cpp/splib/initPlugin.cpp)
file(GLOB_RECURSE RESOURCE_FILES "*.md" "*.psl" "*.py" "*.pyscn" "*.scn" "*.rst", "*.txt")
add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${RESOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_SPLIB")
set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX "_d")
target_link_libraries(${PROJECT_NAME} Sofa.Config)
## Install rules for the library and headers; CMake package configurations files
sofa_create_package_with_targets(
PACKAGE_NAME SPLIB
PACKAGE_VERSION ${PROJECT_VERSION}
TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES
INCLUDE_INSTALL_DIR SPLIB
INCLUDE_SOURCE_DIR "src"
RELOCATABLE "plugins"
)
install(DIRECTORY docs DESTINATION share/sofa/${PROJECT_NAME})
install(FILES "README.md" "LICENSE" DESTINATION .)
#if(SOFA_BUILD_TEST)
add_subdirectory(tests)
#endif()
include(cmake/packaging.cmake)