CMakeLists.txt
changeset 8347 716c05f19401
parent 8333 416cb5e5a405
child 8348 c039ac6f33e0
--- a/CMakeLists.txt	Sat Dec 29 22:50:10 2012 +0100
+++ b/CMakeLists.txt	Sun Dec 30 02:43:24 2012 +0100
@@ -130,8 +130,8 @@
         find_package(SDL_mixer REQUIRED)
         set(DYLIB_SMPEG "-dylib_file @loader_path/Frameworks/smpeg.framework/Versions/A/smpeg:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/smpeg.framework/Versions/A/smpeg")
         set(DYLIB_MIKMOD "-dylib_file @loader_path/Frameworks/mikmod.framework/Versions/A/mikmod:${SDLMIXER_LIBRARY}/Versions/A/Frameworks/mikmod.framework/Versions/A/mikmod")
-        set(pascal_flags "-k${DYLIB_SMPEG}" "-k${DYLIB_MIKMOD}" ${pascal_flags})
-        set(CMAKE_C_FLAGS "${DYLIB_SMPEG}" "${DYLIB_MIKMOD}" ${CMAKE_C_FLAGS})
+        set(CMAKE_C_FLAGS "${DYLIB_SMPEG}" "${DYLIB_MIKMOD}")
+        list(APPEND pascal_flags "-k${DYLIB_SMPEG}" "-k${DYLIB_MIKMOD}")
     endif()
 
     #CMAKE_OSX_ARCHITECTURES and CMAKE_OSX_SYSROOT need to be set for universal binary and correct linking
@@ -161,9 +161,9 @@
     endif()
 
     #add user framework directory, other paths can be passed via FPFLAGS
-    set(pascal_flags "-Ff~/Library/Frameworks" ${pascal_flags})
+    list(APPEND pascal_flags "-Ff~/Library/Frameworks")
     #set deployment target
-    set(pascal_flags "-k-macosx_version_min" "-k${minimum_macosx_version}" "-XR${CMAKE_OSX_SYSROOT}" ${pascal_flags})
+    list(APPEND pascal_flags "-k-macosx_version_min" "-k${minimum_macosx_version}" "-XR${CMAKE_OSX_SYSROOT}")
 
     #silly libav that always brings in VideoDecoderAcceleration, avaible only from 10.6.3
     if(NOT NOVIDEOREC AND ${minimum_macosx_version} VERSION_LESS "10.6")
@@ -184,7 +184,7 @@
 endif (CMAKE_BUILD_TYPE)
 
 #set default flags values for all projects (unless MINIMAL_FLAGS is true)
-if(NOT MINIMAL_FLAGS)
+if(NOT ${MINIMAL_FLAGS})
     set(CMAKE_C_FLAGS "-pipe")
     set(CMAKE_C_FLAGS_RELEASE "-w -Os -fomit-frame-pointer")
     set(CMAKE_C_FLAGS_DEBUG "-Wall -O0 -g -DDEBUG")
@@ -210,7 +210,7 @@
     endif()
 endif()
 
-set(pascal_flags ${fpflags_parsed}              # user flags
+list(APPEND pascal_flags ${fpflags_parsed}              # user flags
                  "-vm4079,4080,4081"            # fpc output format
                  "-B"                           # compile all units
                  "-FE${PROJECT_BINARY_DIR}/bin" # fpc output directory
@@ -218,19 +218,18 @@
                  "-Cs2000000"                   # stack size
                  "-vewnq"                       # fpc output verbosity
                  "-dDEBUGFILE"                  # macro for engine output
-                 ${pascal_flags}                # adding to list
                  )
-set(haskell_flags "-O2" ${ghflags_parsed} ${haskell_flags})
+list(APPEND haskell_flags "-O2" ${ghflags_parsed})
 
 #get BUILD_TYPE and enable/disable optimisation
 message(STATUS "Using ${CMAKE_BUILD_TYPE} configuration")
 if(CMAKE_BUILD_TYPE MATCHES "DEBUG")
-    set(pascal_flags "-O-" "-g" "-gl" "-gv" ${pascal_flags})
-    set(haskell_flags "-Wall" "-debug" "-dcore-lint" "-fno-warn-unused-do-bind" ${haskell_flags})
+    list(APPEND pascal_flags "-O-" "-g" "-gl" "-gv")
+    list(APPEND haskell_flags "-Wall" "-debug" "-dcore-lint" "-fno-warn-unused-do-bind")
 else()
 #    set(pascal_flags "-O3" "-OpPENTIUM4" "-CfSSE3" "-Xs" "-Si" ${pascal_flags})
-    set(pascal_flags "-Os" "-Xs" "-Si" ${pascal_flags})
-    set(haskell_flags "-w" "-fno-warn-unused-do-bind" ${haskell_flags})
+    list(APPEND pascal_flags "-Os" "-Xs" "-Si")
+    list(APPEND haskell_flags "-w" "-fno-warn-unused-do-bind")
 endif()
 
 
@@ -264,14 +263,14 @@
     message(STATUS "LUA will be provided by the bundled sources")
     add_subdirectory(misc/liblua)
     #linking with liblua.a requires system readline
-    set(pascal_flags "-k${EXECUTABLE_OUTPUT_PATH}/lib${LUA_LIBRARY}.a" "-k-lreadline" ${pascal_flags})
+    list(APPEND pascal_flags "-k${EXECUTABLE_OUTPUT_PATH}/lib${LUA_LIBRARY}.a" "-k-lreadline")
 endif()
 
 
 #physfs library (static on unix, dll on win32)
 add_subdirectory(misc/physfs)
 if(NOT WIN32)
-    set(pascal_flags "-k${LIBRARY_OUTPUT_PATH}/libphysfs.a" ${pascal_flags})
+    list(APPEND pascal_flags "-k${LIBRARY_OUTPUT_PATH}/libphysfs.a")
 endif()