support WARNING message status on cmake 2.6 (
bug #524)
--- a/CMakeLists.txt Thu Feb 28 23:02:12 2013 +0100
+++ b/CMakeLists.txt Thu Feb 28 23:05:07 2013 +0100
@@ -2,11 +2,19 @@
#initialise cmake environment
cmake_minimum_required(VERSION 2.6.0)
+if(CMAKE_VERSION VERSION_LESS "2.8")
+ set(WARNING "WARNING: ")
+ set(allow_parse_args FALSE)
+else()
+ set(WARNING WARNING)
+ set(allow_parse_args TRUE)
+endif()
foreach(hwpolicy CMP0003 CMP0012 CMP0017)
if(POLICY ${hwpolicy})
cmake_policy(SET ${hwpolicy} NEW)
endif()
endforeach()
+
#use available modules, fallback to ours if not present (CMP0017 helps)
set(CMAKE_MODULE_PATH "${CMAKE_ROOT}/Modules" "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
@@ -53,7 +61,7 @@
message(STATUS "Building revision ${revision_number} from hash ${revision_hash} ${HGCHANGED}")
if(HGCHANGED)
- MESSAGE(WARNING "Notice: you have uncommitted changes in your repository")
+ MESSAGE(${WARNING} "Notice: you have uncommitted changes in your repository")
endif()
set(version_suffix "-${revision_number}${HGCHANGED}")
endif()
@@ -114,7 +122,7 @@
if(NOT minimum_macosx_version)
message(FATAL_ERROR "sw_vers not found! Need explicit MACOSX_DEPLOYMENT_TARGET variable set")
else()
- message(WARNING "sw_vers not found! Fallback to MACOSX_DEPLOYMENT_TARGET variable")
+ message(${WARNING} "sw_vers not found! Fallback to MACOSX_DEPLOYMENT_TARGET variable")
set(current_macosx_version ${minimum_macosx_version})
endif()
endif()
@@ -171,7 +179,7 @@
#silly libav that always brings in VideoDecoderAcceleration, avaible only from 10.6.3
if(NOT NOVIDEOREC AND ${minimum_macosx_version} VERSION_LESS "10.6")
- set(WARNING "Video recording support before OS X 10.6 is experimental")
+ set(${WARNING} "Video recording support before OS X 10.6 is experimental")
endif()
endif(APPLE)
@@ -205,9 +213,8 @@
#parse additional parameters
if(FPFLAGS OR GHFLAGS)
- set(cmake_version "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}")
- if(cmake_version VERSION_LESS "2.8")
- message(WARNING "FPFLAGS and GHFLAGS are available only when using CMake >= 2.8")
+ if(${allow_parse_args})
+ message(${WARNING} "FPFLAGS and GHFLAGS are available only when using CMake >= 2.8")
else()
separate_arguments(fpflags_parsed UNIX_COMMAND ${FPFLAGS})
separate_arguments(ghflags_parsed UNIX_COMMAND ${GHFLAGS})
@@ -257,7 +264,7 @@
add_subdirectory(gameServer)
message(STATUS "Found GHC: ${ghc_executable}")
else()
- message(WARNING "Could NOT find GHC, server will not be built")
+ message(${WARNING} "Could NOT find GHC, server will not be built")
set(HAVE_NETSERVER false)
endif()
else()
--- a/hedgewars/CMakeLists.txt Thu Feb 28 23:02:12 2013 +0100
+++ b/hedgewars/CMakeLists.txt Thu Feb 28 23:05:07 2013 +0100
@@ -91,7 +91,7 @@
)
if(${BUILD_ENGINE_LIBRARY})
- message(WARNING "Engine will be built as library (experimental)")
+ message(${WARNING} "Engine will be built as library (experimental)")
list(APPEND pascal_flags "-dHWLIBRARY")
# create position independent code, only required for x68_64 builds, similar to -fPIC
@@ -160,7 +160,7 @@
list(APPEND pascal_flags "-k${PNG_LIBRARY}")
endif()
else()
- message(WARNING "Screenshots will be in BMP format because libpng was not found")
+ message(${WARNING} "Screenshots will be in BMP format because libpng was not found")
endif()
else()
message(STATUS "Screenshots will be in BMP format per user request")
@@ -200,7 +200,7 @@
list(APPEND pascal_flags "-k${FFMPEG_LIBAVCODEC}" "-k${FFMPEG_LIBAVFORMAT}" "-k${FFMPEG_LIBAVUTIL}")
ENDIF()
else()
- message(WARNING "Could NOT find FFMPEG/LibAV, video recording will be disabled")
+ message(${WARNING} "Could NOT find FFMPEG/LibAV, video recording will be disabled")
endif()
else()
message(STATUS "Video recording disabled by user")