diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 39b1bbc..8b6ba2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -1,32 +1,18 @@ | |||
1 | cmake_minimum_required(VERSION 2.6) | 1 | cmake_minimum_required (VERSION 3.1) |
2 | project(Aromatherapy) | 2 | project (Aromatherapy) |
3 | 3 | ||
4 | # Use our modified FindSDL2* modules | 4 | set(CMAKE_BUILD_TYPE Debug) |
5 | |||
6 | # Set directory to look for package helpers. | ||
5 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${Aromatherapy_SOURCE_DIR}/cmake") | 7 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${Aromatherapy_SOURCE_DIR}/cmake") |
6 | # Set an output directory for our binaries | ||
7 | set(BIN_DIR ${Aromatherapy_SOURCE_DIR}/bin) | ||
8 | 8 | ||
9 | # Bump up warning levels appropriately for clang, gcc & msvc | 9 | # Get dependencies. |
10 | # Also set debug/optimization flags depending on the build type. IDE users choose this when | ||
11 | # selecting the build mode in their IDE | ||
12 | if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") | ||
13 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -std=c++11") | ||
14 | set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG} -g") | ||
15 | set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} -O2") | ||
16 | elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") | ||
17 | if (CMAKE_CXX_FLAGS MATCHES "/W[0-4]") | ||
18 | string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") | ||
19 | else() | ||
20 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") | ||
21 | endif() | ||
22 | endif() | ||
23 | 10 | ||
24 | find_package(PkgConfig) | 11 | find_package(PkgConfig) |
12 | pkg_check_modules(GLFW REQUIRED glfw3) | ||
25 | 13 | ||
26 | # Look up SDL2 and add the include directory to our include path | ||
27 | find_package(OpenGL REQUIRED) | 14 | find_package(OpenGL REQUIRED) |
28 | find_package(GLEW REQUIRED) | 15 | find_package(GLEW REQUIRED) |
29 | pkg_check_modules(GLFW REQUIRED glfw3) | ||
30 | find_package(portaudio REQUIRED) | 16 | find_package(portaudio REQUIRED) |
31 | find_package(libsndfile REQUIRED) | 17 | find_package(libsndfile REQUIRED) |
32 | find_package(libxml2 REQUIRED) | 18 | find_package(libxml2 REQUIRED) |
@@ -52,8 +38,6 @@ link_directories( | |||
52 | ${GLFW_LIBRARY_DIRS} | 38 | ${GLFW_LIBRARY_DIRS} |
53 | ) | 39 | ) |
54 | 40 | ||
55 | # include_directories(${SDL2_INCLUDE_DIR}) | ||
56 | set(CMAKE_BUILD_TYPE Debug) | ||
57 | add_executable(Aromatherapy | 41 | add_executable(Aromatherapy |
58 | src/main.cpp | 42 | src/main.cpp |
59 | src/renderer.cpp | 43 | src/renderer.cpp |
@@ -68,5 +52,7 @@ add_executable(Aromatherapy | |||
68 | src/systems/mapping.cpp | 52 | src/systems/mapping.cpp |
69 | src/systems/orienting.cpp | 53 | src/systems/orienting.cpp |
70 | ) | 54 | ) |
55 | |||
56 | set_property(TARGET Aromatherapy PROPERTY CXX_STANDARD 11) | ||
57 | set_property(TARGET Aromatherapy PROPERTY CXX_STANDARD_REQUIRED ON) | ||
71 | target_link_libraries(Aromatherapy ${ALL_LIBS}) | 58 | target_link_libraries(Aromatherapy ${ALL_LIBS}) |
72 | install(TARGETS Aromatherapy RUNTIME DESTINATION ${BIN_DIR}) | ||