-
Notifications
You must be signed in to change notification settings - Fork 22
/
CMakeLists.txt
88 lines (69 loc) · 1.96 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
cmake_minimum_required(VERSION 3.5)
project(Untwine VERSION 1.5.0 LANGUAGES CXX)
include(FeatureSummary)
include(${PROJECT_SOURCE_DIR}/cmake/compiler_options.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/cpack.cmake)
option(BUILD_TESTING "Chose if Untwine unit tests should be built" OFF)
add_feature_info("Unit tests" BUILD_TESTING "Untwine unit tests")
if(DEFINED WITH_TESTS)
message(DEPRECATION "WITH_TESTS has been replaced with the standard CMake BUILD_TESTING variable")
set(BUILD_TESTING ${WITH_TESTS})
endif()
find_package(PDAL REQUIRED CONFIG 2.6)
find_package(Threads)
set_package_properties(Threads PROPERTIES DESCRIPTION
"The thread library of the system" TYPE REQUIRED)
configure_file(untwine/Config.hpp.in include/Config.hpp)
file(GLOB LAZPERF_SRCS
lazperf/*.cpp
lazperf/detail/*.cpp
)
file(GLOB SRCS
untwine/*.cpp
prep/*.cpp
epf/*.cpp
bu/*.cpp
)
# MINGW must come before WIN32 test
# APPLE must come before LINUX test
if (MINGW)
set(UNTWINE_OS_DIR untwine/mingw)
elseif (WIN32)
set(UNTWINE_OS_DIR untwine/windows)
elseif (APPLE)
set(UNTWINE_OS_DIR untwine/osx)
elseif (LINUX)
set(UNTWINE_OS_DIR untwine/generic)
else()
message(FATAL_ERROR "OS not supported")
endif()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
add_executable(untwine ${SRCS} ${LAZPERF_SRCS})
untwine_target_compile_settings(untwine)
target_include_directories(untwine
PRIVATE
${UNTWINE_OS_DIR}
${CMAKE_CURRENT_BINARY_DIR}/include
${PDAL_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}
)
target_link_libraries(untwine
PRIVATE
${CMAKE_THREAD_LIBS_INIT}
${PDAL_LIBRARIES}
)
if (MSVC)
target_link_options(untwine
PRIVATE
/SUBSYSTEM:CONSOLE /ENTRY:wmainCRTStartup
)
endif()
install(TARGETS untwine DESTINATION bin)
if (BUILD_TESTING)
enable_testing()
add_subdirectory(test)
endif()
#
# CPACK
#
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)