forked from cosmoscout/cosmoscout-vr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
64 lines (47 loc) · 2.11 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# ------------------------------------------------------------------------------------------------ #
# This file is part of CosmoScout VR #
# ------------------------------------------------------------------------------------------------ #
# SPDX-FileCopyrightText: German Aerospace Center (DLR) <[email protected]>
# SPDX-License-Identifier: MIT
option(CSP_LOD_BODIES "Enable compilation of this plugin" ON)
if (NOT CSP_LOD_BODIES)
return()
endif()
find_package(Threads REQUIRED)
# build plugin -------------------------------------------------------------------------------------
file(GLOB SOURCE_FILES src/*.cpp)
set(TEST_FILES)
if (COSMOSCOUT_UNIT_TESTS)
file(GLOB TEST_FILES test/*.cpp)
endif()
# Resoucre files and header files are only added in order to make them available in your IDE.
file(GLOB HEADER_FILES src/*.hpp)
file(GLOB_RECURSE RESOUCRE_FILES gui/* colormaps/* shaders/* textures/*)
add_library(csp-lod-bodies SHARED
${SOURCE_FILES}
${HEADER_FILES}
${RESOUCRE_FILES}
${TEST_FILES}
)
target_link_libraries(csp-lod-bodies
PUBLIC
cs-core
Threads::Threads
)
if(COSMOSCOUT_USE_PRECOMPILED_HEADERS)
target_precompile_headers(csp-lod-bodies PRIVATE src/precompiled.pch)
endif()
# Add this Plugin to a "plugins" folder in your IDE.
set_property(TARGET csp-lod-bodies PROPERTY FOLDER "plugins")
# We mark all resource files as "header" in order to make sure that no one tries to compile them.
set_source_files_properties(${RESOUCRE_FILES} PROPERTIES HEADER_FILE_ONLY TRUE)
# Make directory structure available in your IDE.
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES
${SOURCE_FILES} ${HEADER_FILES} ${RESOUCRE_FILES}
)
# install plugin -----------------------------------------------------------------------------------
install(TARGETS csp-lod-bodies DESTINATION "share/plugins")
install(DIRECTORY "shaders" DESTINATION "share/resources")
install(DIRECTORY "colormaps" DESTINATION "share/resources")
install(DIRECTORY "textures" DESTINATION "share/resources")
install(DIRECTORY "gui" DESTINATION "share/resources")