summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2013-03-22 18:19:53 +0100
committerPiotr Dziwinski <piotrdz@gmail.com>2013-03-22 19:17:08 +0100
commit4a30800cf16d403a7c25d78388e2822aa396ac86 (patch)
tree772753228bab7b0b4ba47e89580ed86de0ca098f /CMakeLists.txt
parent1406464f0ce0b804298e2ee034bdd8bc7856e0dc (diff)
downloadcolobot-4a30800cf16d403a7c25d78388e2822aa396ac86.tar.gz
colobot-4a30800cf16d403a7c25d78388e2822aa396ac86.tar.bz2
colobot-4a30800cf16d403a7c25d78388e2822aa396ac86.zip
Fixes for compiling on MSYS
* fixed SDL_main() and putenv() issues * disabled desktop subdir for MSYS * disabled building CBot_console for now
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 17 insertions, 1 deletions
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/)