forked from hobuinc/untwine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
66 lines (50 loc) · 1.46 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
cmake_minimum_required(VERSION 3.5)
project(Untwine VERSION 1.3.1 LANGUAGES CXX)
include(FeatureSummary)
include(${PROJECT_SOURCE_DIR}/cmake/compiler_options.cmake)
option(WITH_TESTS
"Choose if Untwine unit tests should be built" TRUE)
add_feature_info("Unit tests" WITH_TESTS "Untwine unit tests")
find_package(PDAL REQUIRED)
if ((PDAL_VERSION_MAJOR EQUAL 1) AND (PDAL_VERSION_MINOR LESS 7))
message(FATAL_ERROR "PDAL version is too old (${PDAL_VERSION}). Use 1.7 or higher.")
endif()
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
epf/*.cpp
bu/*.cpp
)
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
${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:WINDOWS /ENTRY:wmainCRTStartup
)
endif()
install(TARGETS untwine DESTINATION bin)
#-----------------
if (WITH_TESTS)
enable_testing()
add_subdirectory(test)
endif()