cmake_minimum_required(VERSION 2.6) project(AromatherapyMapEditor) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${AromatherapyMapEditor_SOURCE_DIR}/cmake") # Set an output directory for our binaries set(BIN_DIR ${AromatherapyMapEditor_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(wxWidgets REQUIRED core base) include(${wxWidgets_USE_FILE}) find_package(libxml2 REQUIRED) set(ALL_LIBS ${wxWidgets_LIBRARIES} ${LIBXML2_LIBRARIES} ) include_directories( ${LIBXML2_INCLUDE_DIR} src ) set(CMAKE_BUILD_TYPE Debug) add_executable(AromatherapyMapEditor src/main.cpp src/map.cpp src/frame.cpp src/widget.cpp src/tile_widget.cpp src/object.cpp src/world.cpp ) target_link_libraries(AromatherapyMapEditor ${ALL_LIBS}) install(TARGETS AromatherapyMapEditor RUNTIME DESTINATION ${BIN_DIR})