-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
49 lines (42 loc) · 1.34 KB
/
CMakeLists.txt
File metadata and controls
49 lines (42 loc) · 1.34 KB
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
47
48
49
cmake_minimum_required(VERSION 3.22)
project(MyAwesomeComponents VERSION 1.0)
# SOFA packages containing our dependencies
find_package(Sofa.Framework REQUIRED)
# Config files (tell SOFA this is a plugin)
set(CONFIG_FILES
src/MyAwesomeComponents/initMyAwesomeComponents.cpp
)
# Our nice new SOFA Components
set(HEADER_FILES
src/MyAwesomeComponents/config.h.in
src/MyAwesomeComponents/FanForceField.h
src/MyAwesomeComponents/FanForceField.inl
)
set(SOURCE_FILES
src/MyAwesomeComponents/FanForceField.cpp
)
# SOFA plugin are basically libraries
add_library(${PROJECT_NAME} SHARED ${CONFIG_FILES} ${HEADER_FILES} ${SOURCE_FILES})
# Dependencies
target_link_libraries(${PROJECT_NAME} PUBLIC
Sofa.Core
Sofa.Helper
Sofa.DefaultType
Sofa.Simulation.Core
)
# nested-namespace-definition requires compiler flag '/std:c++17'
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
)
# Create package Config, Version & Target files.
# Deploy the headers, resources, scenes & examples.
sofa_create_package_with_targets(
PACKAGE_NAME ${PROJECT_NAME}
PACKAGE_VERSION ${PROJECT_VERSION}
TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES
INCLUDE_SOURCE_DIR "src"
INCLUDE_INSTALL_DIR ${PROJECT_NAME}
EXAMPLE_INSTALL_DIR "examples"
RELOCATABLE "plugins"
)