-
Notifications
You must be signed in to change notification settings - Fork 37
/
CMakeLists.txt
executable file
·62 lines (44 loc) · 2.31 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
cmake_minimum_required(VERSION 3.1)
if (APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "Minimum OS X deployment version" FORCE)
message(STATUS "Minimum OS X deployment version: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif ()
get_filename_component(PROJECT_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
project(${PROJECT_NAME})
################################################################################
set (CMAKE_CXX_STANDARD 11)
################################################################################
# Detects whether this is a top-level project
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(ADTREE_TOPLEVEL_PROJECT ON)
else()
set(ADTREE_TOPLEVEL_PROJECT OFF)
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
################################################################################
### Configuration
set(ADTREE_ROOT "${CMAKE_CURRENT_LIST_DIR}")
set(ADTREE_EXTERNAL "${ADTREE_ROOT}/3rd_party")
set(ADTREE_glew_INCLUDE_DIR "${ADTREE_EXTERNAL}/glew/include")
set(ADTREE_glfw_INCLUDE_DIR "${ADTREE_EXTERNAL}/glfw/include")
set(ADTREE_imgui_INCLUDE_DIR "${ADTREE_EXTERNAL}/imgui")
set(ADTREE_tetgen_INCLUDE_DIR "${ADTREE_EXTERNAL}/tetgen")
set(ADTREE_kd_tree_INCLUDE_DIR "${ADTREE_EXTERNAL}/kd_tree")
set(ADTREE_cminpack_INCLUDE_DIR "${ADTREE_EXTERNAL}/cminpack")
set(ADTREE_easy3d_INCLUDE_DIR "${ADTREE_EXTERNAL}" "${ADTREE_ROOT}")
set(ADTREE_lm_INCLUDE_DIR "${ADTREE_EXTERNAL}/optimizer_lm")
################################################################################
### conditionally compile certain modules depending on libraries found on the system
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
################################################################################
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
################################################################################
add_subdirectory(3rd_party)
add_subdirectory(AdTree)
## Resources
# Copy resources dirs into our shadow build directory. For AdTree only the shaders are needed
if (NOT APPLE)
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/resources/shaders" DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources")
endif ()