-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
62 lines (50 loc) · 1.66 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
cmake_minimum_required(VERSION 3.14)
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "Vcpkg toolchain file")
include(cmake/prelude.cmake)
project(
point_cloud_viewer
VERSION 0.1.0
DESCRIPTION "Simple OpenGL program to visualize point cloud."
HOMEPAGE_URL "https://github.com/tanganke/point_cloud_viewer"
LANGUAGES CXX
)
set(BUILD_TESTING OFF)
include(cmake/project-is-top-level.cmake)
include(cmake/variables.cmake)
# ---- Declare library ----
find_package(glad CONFIG REQUIRED)
find_package(spdlog CONFIG REQUIRED)
find_package(glm CONFIG REQUIRED)
find_package(imgui CONFIG REQUIRED)
# ---- Declare executable ----
add_executable(point_cloud_viewer_exe
source/main.cpp
source/PointCloud.cpp
source/Shader.cpp
source/Window.cpp)
add_executable(point_cloud_viewer::exe ALIAS point_cloud_viewer_exe)
set_target_properties(
point_cloud_viewer_exe PROPERTIES
OUTPUT_NAME point_cloud_viewer
EXPORT_NAME exe
)
target_compile_features(point_cloud_viewer_exe PRIVATE cxx_std_17)
target_link_libraries(point_cloud_viewer_exe PRIVATE glad::glad)
target_link_libraries(point_cloud_viewer_exe PRIVATE spdlog::spdlog spdlog::spdlog_header_only)
target_link_libraries(point_cloud_viewer_exe PRIVATE glm::glm)
target_link_libraries(point_cloud_viewer_exe PRIVATE imgui::imgui)
# ---- Install rules ----
if(NOT CMAKE_SKIP_INSTALL_RULES)
include(cmake/install-rules.cmake)
endif()
# ---- Developer mode ----
if(NOT point_cloud_viewer_DEVELOPER_MODE)
return()
elseif(NOT PROJECT_IS_TOP_LEVEL)
message(
AUTHOR_WARNING
"Developer mode is intended for developers of point_cloud_viewer"
)
endif()
include(cmake/dev-mode.cmake)