-
Notifications
You must be signed in to change notification settings - Fork 106
/
Copy pathCMakeLists.txt
46 lines (34 loc) · 1.48 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
cmake_minimum_required(VERSION 2.8)
project(sparse-voxel-octrees)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
include(CXX11)
check_for_cxx11_compiler(CXX11_COMPILER)
if(CXX11_COMPILER)
enable_cxx11()
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} seems to have no C++11 support. Please try again with a more recent compiler version.")
endif()
include(OptimizeForArchitecture)
OptimizeForArchitecture()
if (MSVC)
add_definitions(-DNOMINMAX -D_CRT_SECURE_NO_WARNINGS)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Vc_ARCHITECTURE_FLAGS}")
if (CMAKE_COMPILER_IS_GNUCXX)
set(CXX_WARNINGS "-Wall -Wextra -Wpointer-arith -Wcast-align -fstrict-aliasing -Wno-unused-local-typedefs")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARNINGS} -fvisibility-inlines-hidden")
endif()
find_package(SDL REQUIRED)
include_directories(src ${SDL_INCLUDE_DIR})
file(GLOB_RECURSE Sources "src/*.hpp" "src/*.cpp" "src/*.c")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(Sources ${Sources} "src/SDLMain.m")
endif()
if (WIN32)
add_executable(sparse-voxel-octrees WIN32 ${Sources})
else()
add_executable(sparse-voxel-octrees ${Sources})
endif()
target_link_libraries(sparse-voxel-octrees ${SDLMAIN_LIBRARY} ${SDL_LIBRARY})
set_target_properties(sparse-voxel-octrees PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/bin)
set_target_properties(sparse-voxel-octrees PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/bin)