summary refs log tree commit diff stats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2015-02-14 12:09:41 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2015-02-14 12:09:41 -0500
commitde5a458cb037bb8e1e80c849c5e6525f9413b43a (patch)
tree97d7aebcf21e4db3c3e19d4a9c7ec906114e5558 /CMakeLists.txt
downloadtherapy-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.txt33
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 @@
1cmake_minimum_required(VERSION 2.6)
2project(Aromatherapy)
3
4# Use our modified FindSDL2* modules
5set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${Aromatherapy_SOURCE_DIR}/cmake")
6# Set an output directory for our binaries
7set(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
12if (${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")
16elseif (${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()
22endif()
23
24# Look up SDL2 and add the include directory to our include path
25find_package(OpenGL REQUIRED)
26find_package(GLEW REQUIRED)
27find_package(GLFW REQUIRED)
28
29# include_directories(${SDL2_INCLUDE_DIR})
30set(CMAKE_BUILD_TYPE Debug)
31add_executable(Aromatherapy src/main.cpp src/map.cpp src/renderer.cpp)
32target_link_libraries(Aromatherapy ${OPENGL_LIBRARY} ${GLEW_LIBRARY} ${GLFW_LIBRARY})
33install(TARGETS Aromatherapy RUNTIME DESTINATION ${BIN_DIR})