allow FPFLAGS and GHFLAGS only in cmakes able to support them
authorkoda
Wed, 18 Jul 2012 15:05:56 +0100
changeset 7397 833fc211ca2d
parent 7396 7c0e07c23aad
child 7398 2b7b939014b5
allow FPFLAGS and GHFLAGS only in cmakes able to support them
CMakeLists.txt
--- a/CMakeLists.txt	Mon Jul 16 23:08:42 2012 -0400
+++ b/CMakeLists.txt	Wed Jul 18 15:05:56 2012 +0100
@@ -159,10 +159,19 @@
 set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
 set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
 
-separate_arguments(fpflags_full UNIX_COMMAND ${FPFLAGS})
+#parse additional parameters
+if(FPFLAGS OR GHFLAGS)
+    math(EXPR cmake_version "${CMAKE_MAJOR_VERSION}*10000 + ${CMAKE_MINOR_VERSION}*100 + ${CMAKE_PATCH_VERSION}")
+    if(cmake_version LESS "020800")
+        message(STATUS "FPFLAGS and GHFLAGS are available only from Cmake 2.8, ignoring...")
+    else()
+        separate_arguments(fpflags_full UNIX_COMMAND ${FPFLAGS})
+        separate_arguments(ghflags_full UNIX_COMMAND ${GHFLAGS})
+    endif()
+endif()
+
 set(pascal_flags ${fpflags_full} "-B" "-FE../bin" "-Cs2000000" "-vewn" "-dDEBUGFILE" ${pascal_flags})
-separate_arguments(ghflags_full UNIX_COMMAND ${GHFLAGS})
-set(haskell_flags "-O2" ${haskell_flags} ${ghflags_full})
+set(haskell_flags "-O2" ${ghflags_full} ${haskell_flags})
 
 if(Optz)
 #    set(pascal_flags "-O3" "-OpPENTIUM4" "-CfSSE3" "-Xs" "-Si" ${pascal_flags})