forked from potree/CPotree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
133 lines (93 loc) · 3.18 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
cmake_minimum_required(VERSION 3.16)
set(CMAKE_SUPPRESS_REGENERATION true)
project(CPotree LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
#message(${PROJECT_SOURCE_DIR})
file(GLOB HEADER_FILES
"./include/*.h"
)
file(GLOB CPP_FILES
"./src/*.cpp"
)
list(FILTER CPP_FILES EXCLUDE REGEX ".*executable_.*.cpp$")
set(LASZIP_DIR "${PROJECT_SOURCE_DIR}/libs/laszip")
set(BROTLI_DIR "${PROJECT_SOURCE_DIR}/libs/brotli")
add_subdirectory(${LASZIP_DIR})
add_subdirectory(${BROTLI_DIR})
###############################################
# COPY LICENSE FILES TO BINARY DIRECTORY
###############################################
function(buildLicenses targetname)
# laszip
add_custom_command(
TARGET ${targetname} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${LASZIP_DIR}/COPYING
$<TARGET_FILE_DIR:${targetname}>/licenses/license_laszip.txt)
# brotli
add_custom_command(
TARGET ${targetname} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${BROTLI_DIR}/LICENSE
$<TARGET_FILE_DIR:${targetname}>/licenses/license_brotli.txt)
# json
add_custom_command(
TARGET ${targetname} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${PROJECT_SOURCE_DIR}/libs/json/LICENSE
$<TARGET_FILE_DIR:${targetname}>/licenses/license_json.txt)
# glm
add_custom_command(
TARGET ${targetname} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${PROJECT_SOURCE_DIR}/libs/glm/copying.txt
$<TARGET_FILE_DIR:${targetname}>/licenses/license_glm.txt)
endfunction()
###############################################
# extract_profile
###############################################
add_executable(extract_profile
${HEADER_FILES}
${CPP_FILES}
./modules/unsuck/unsuck.hpp
./modules/unsuck/unsuck_platform_specific.cpp
./src/executable_extract_profile.cpp
)
target_link_libraries(extract_profile laszip)
target_link_libraries(extract_profile brotlienc-static)
target_link_libraries(extract_profile brotlidec-static)
target_include_directories(extract_profile PRIVATE "./include")
target_include_directories(extract_profile PRIVATE "./modules")
target_include_directories(extract_profile PRIVATE "./libs")
if (UNIX)
find_package(Threads REQUIRED)
find_package(TBB REQUIRED)
target_link_libraries(extract_profile Threads::Threads)
target_link_libraries(extract_profile tbb)
endif (UNIX)
buildLicenses(extract_profile)
###############################################
# extract_area
###############################################
add_executable(extract_area
${HEADER_FILES}
${CPP_FILES}
./modules/unsuck/unsuck.hpp
./modules/unsuck/unsuck_platform_specific.cpp
./src/executable_extract_area.cpp
)
target_link_libraries(extract_area laszip)
target_link_libraries(extract_area brotlienc-static)
target_link_libraries(extract_area brotlidec-static)
target_include_directories(extract_area PRIVATE "./include")
target_include_directories(extract_area PRIVATE "./modules")
target_include_directories(extract_area PRIVATE "./libs")
if (UNIX)
find_package(Threads REQUIRED)
find_package(TBB REQUIRED)
target_link_libraries(extract_area Threads::Threads)
target_link_libraries(extract_area tbb)
endif (UNIX)
buildLicenses(extract_area)