From 4a30800cf16d403a7c25d78388e2822aa396ac86 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Fri, 22 Mar 2013 18:19:53 +0100 Subject: Fixes for compiling on MSYS * fixed SDL_main() and putenv() issues * disabled desktop subdir for MSYS * disabled building CBot_console for now --- CMakeLists.txt | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e25826..60839be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,6 +74,7 @@ set(COLOBOT_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wold-style-cast ${CXX11_FLAGS}" set(COLOBOT_CXX_FLAGS_RELEASE "-O2") set(COLOBOT_CXX_FLAGS_DEBUG "-g -O0") + # Asserts can be enabled/disabled regardless of build type option(ASSERTS "Enable assert()s" ON) @@ -83,6 +84,9 @@ option(TESTS "Enable tests" ON) # CBot can also be a static library option(CBOT_STATIC "Build CBot as static libary" OFF) +# Generate desktop files, manpage, etc. +option(DESKTOP ON) + # Doxygen docs are optional for installation option(INSTALL_DOCS "Install Doxygen-generated documentation" OFF) @@ -90,8 +94,16 @@ option(INSTALL_DOCS "Install Doxygen-generated documentation" OFF) option(OPENAL_SOUND "Build openal sound support" OFF) +# Hacks for MSYS +if (MSYS) + set(COLOBOT_CXX_FLAGS "${COLOBOT_CXX_FLAGS} -U__STRICT_ANSI__") # fixes putenv() + set(USE_SDL_MAIN 1) # fixes SDL_main + set(DESKTOP OFF) # MSYS doesn't have the necessary tools +endif() + + ## -# Required packages +# Searching for packages ## find_package(OpenGL 1.4 REQUIRED) @@ -115,6 +127,10 @@ find_package(GLEW REQUIRED) include("${colobot_SOURCE_DIR}/cmake/FindLibSndFile.cmake") +if (${OPENAL_SOUND}) + find_package(OpenAL REQUIRED) +endif() + ## # Additional settings to use when cross-compiling with MXE (http://mxe.cc/) -- cgit v1.2.3-1-g7c22