From de5a458cb037bb8e1e80c849c5e6525f9413b43a Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 14 Feb 2015 12:09:41 -0500 Subject: Monitor stuff is looking pretty cool! --- CMakeLists.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 CMakeLists.txt (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..c0e0339 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 2.6) +project(Aromatherapy) + +# Use our modified FindSDL2* modules +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${Aromatherapy_SOURCE_DIR}/cmake") +# Set an output directory for our binaries +set(BIN_DIR ${Aromatherapy_SOURCE_DIR}/bin) + +# Bump up warning levels appropriately for clang, gcc & msvc +# Also set debug/optimization flags depending on the build type. IDE users choose this when +# selecting the build mode in their IDE +if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -std=c++11") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG} -g") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} -O2") +elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") + if (CMAKE_CXX_FLAGS MATCHES "/W[0-4]") + string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + endif() +endif() + +# Look up SDL2 and add the include directory to our include path +find_package(OpenGL REQUIRED) +find_package(GLEW REQUIRED) +find_package(GLFW REQUIRED) + +# include_directories(${SDL2_INCLUDE_DIR}) +set(CMAKE_BUILD_TYPE Debug) +add_executable(Aromatherapy src/main.cpp src/map.cpp src/renderer.cpp) +target_link_libraries(Aromatherapy ${OPENGL_LIBRARY} ${GLEW_LIBRARY} ${GLFW_LIBRARY}) +install(TARGETS Aromatherapy RUNTIME DESTINATION ${BIN_DIR}) -- cgit 1.4.1