From bc63fa57ced1c7329f7fdcfd168eaf7e290158bc Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 8 Feb 2018 00:19:24 -0500 Subject: Modernized CMake files Also removed an unnecessary cmake package helper. --- tools/mapedit/CMakeLists.txt | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'tools') diff --git a/tools/mapedit/CMakeLists.txt b/tools/mapedit/CMakeLists.txt index b225834..4ce9133 100644 --- a/tools/mapedit/CMakeLists.txt +++ b/tools/mapedit/CMakeLists.txt @@ -1,26 +1,9 @@ -cmake_minimum_required(VERSION 2.6) -project(AromatherapyMapEditor) +cmake_minimum_required (VERSION 3.1) +project (AromatherapyMapEditor) +# Set directory to look for package helpers. 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 -O0") - 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}) @@ -48,5 +31,7 @@ add_executable(AromatherapyMapEditor src/undo.cpp src/mapselect_combo.cpp ) + +set_property(TARGET AromatherapyMapEditor PROPERTY CXX_STANDARD 11) +set_property(TARGET AromatherapyMapEditor PROPERTY CXX_STANDARD_REQUIRED ON) target_link_libraries(AromatherapyMapEditor ${ALL_LIBS}) -install(TARGETS AromatherapyMapEditor RUNTIME DESTINATION ${BIN_DIR}) -- cgit 1.4.1