diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-02-14 12:09:41 -0500 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-02-14 12:09:41 -0500 |
| commit | de5a458cb037bb8e1e80c849c5e6525f9413b43a (patch) | |
| tree | 97d7aebcf21e4db3c3e19d4a9c7ec906114e5558 /CMakeLists.txt | |
| download | therapy-de5a458cb037bb8e1e80c849c5e6525f9413b43a.tar.gz therapy-de5a458cb037bb8e1e80c849c5e6525f9413b43a.tar.bz2 therapy-de5a458cb037bb8e1e80c849c5e6525f9413b43a.zip | |
Monitor stuff is looking pretty cool!
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 33 |
1 files changed, 33 insertions, 0 deletions
| diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..c0e0339 --- /dev/null +++ b/CMakeLists.txt | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | cmake_minimum_required(VERSION 2.6) | ||
| 2 | project(Aromatherapy) | ||
| 3 | |||
| 4 | # Use our modified FindSDL2* modules | ||
| 5 | 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 | |||
| 9 | # Bump up warning levels appropriately for clang, gcc & msvc | ||
| 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 | |||
| 24 | # Look up SDL2 and add the include directory to our include path | ||
| 25 | find_package(OpenGL REQUIRED) | ||
| 26 | find_package(GLEW REQUIRED) | ||
| 27 | find_package(GLFW REQUIRED) | ||
| 28 | |||
| 29 | # include_directories(${SDL2_INCLUDE_DIR}) | ||
| 30 | set(CMAKE_BUILD_TYPE Debug) | ||
| 31 | add_executable(Aromatherapy src/main.cpp src/map.cpp src/renderer.cpp) | ||
| 32 | target_link_libraries(Aromatherapy ${OPENGL_LIBRARY} ${GLEW_LIBRARY} ${GLFW_LIBRARY}) | ||
| 33 | install(TARGETS Aromatherapy RUNTIME DESTINATION ${BIN_DIR}) | ||
