diff options
Diffstat (limited to 'tools/mapedit/CMakeLists.txt')
| -rw-r--r-- | tools/mapedit/CMakeLists.txt | 45 |
1 files changed, 45 insertions, 0 deletions
| diff --git a/tools/mapedit/CMakeLists.txt b/tools/mapedit/CMakeLists.txt new file mode 100644 index 0000000..9a024c8 --- /dev/null +++ b/tools/mapedit/CMakeLists.txt | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | cmake_minimum_required(VERSION 2.6) | ||
| 2 | project(AromatherapyMapEditor) | ||
| 3 | |||
| 4 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${AromatherapyMapEditor_SOURCE_DIR}/cmake") | ||
| 5 | # Set an output directory for our binaries | ||
| 6 | set(BIN_DIR ${AromatherapyMapEditor_SOURCE_DIR}/bin) | ||
| 7 | |||
| 8 | # Bump up warning levels appropriately for clang, gcc & msvc | ||
| 9 | # Also set debug/optimization flags depending on the build type. IDE users choose this when | ||
| 10 | # selecting the build mode in their IDE | ||
| 11 | if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") | ||
| 12 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -std=c++11") | ||
| 13 | set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG} -g") | ||
| 14 | set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} -O2") | ||
| 15 | elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") | ||
| 16 | if (CMAKE_CXX_FLAGS MATCHES "/W[0-4]") | ||
| 17 | string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") | ||
| 18 | else() | ||
| 19 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") | ||
| 20 | endif() | ||
| 21 | endif() | ||
| 22 | |||
| 23 | # Look up SDL2 and add the include directory to our include path | ||
| 24 | find_package(wxWidgets REQUIRED core base) | ||
| 25 | include(${wxWidgets_USE_FILE}) | ||
| 26 | |||
| 27 | find_package(libxml2 REQUIRED) | ||
| 28 | |||
| 29 | set(ALL_LIBS | ||
| 30 | ${wxWidgets_LIBRARIES} | ||
| 31 | ${LIBXML2_LIBRARIES} | ||
| 32 | ) | ||
| 33 | |||
| 34 | include_directories( | ||
| 35 | ${LIBXML2_INCLUDE_DIR} | ||
| 36 | src | ||
| 37 | ) | ||
| 38 | |||
| 39 | set(CMAKE_BUILD_TYPE Debug) | ||
| 40 | add_executable(AromatherapyMapEditor | ||
| 41 | src/main.cpp | ||
| 42 | src/map.cpp | ||
| 43 | ) | ||
| 44 | target_link_libraries(AromatherapyMapEditor ${ALL_LIBS}) | ||
| 45 | install(TARGETS AromatherapyMapEditor RUNTIME DESTINATION ${BIN_DIR}) | ||
