From Mattias Helsing, "CMake have release 3.0 and 3.1 and we have some bad checks for cmake

major version when settings cmake policies in CMakeLists.txt. This fixes it"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14620 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2014-12-18 15:59:16 +00:00
parent 2a46857353
commit 4ce6b07886

View File

@ -22,25 +22,30 @@ if(COMMAND cmake_policy)
# tell CMake to prefer CMake's own CMake modules when available # tell CMake to prefer CMake's own CMake modules when available
# only available from cmake-2.8.4 # only available from cmake-2.8.4
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 3) if(${CMAKE_MAJOR_VERSION} GREATER 2 OR
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 8) OR
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 3))
cmake_policy(SET CMP0017 NEW) cmake_policy(SET CMP0017 NEW)
endif() endif()
# cmake-2.6.1 introduces policy cmp0008 decide how to treat full path libraries that do not appear to be valid library file names # cmake-2.6.1 introduces policy cmp0008 decide how to treat full path libraries that do not appear to be valid library file names
# quote from cvslog "Such libraries worked by accident in the VS IDE and Xcode generators in CMake 2.4 and below." # quote from cvslog "Such libraries worked by accident in the VS IDE and Xcode generators in CMake 2.4 and below."
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4 AND ${CMAKE_PATCH_VERSION} GREATER 0) if(${CMAKE_MAJOR_VERSION} GREATER 2 OR
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 6) OR
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 6 AND ${CMAKE_PATCH_VERSION} GREATER 0))
cmake_policy(SET CMP0008 OLD) cmake_policy(SET CMP0008 OLD)
endif() endif()
# disable autolinking to qtmain as we have our own main() functions (new in Qt 5.1) # disable autolinking to qtmain as we have our own main() functions (new in Qt 5.1)
if((${CMAKE_MAJOR_VERSION} EQUAL 2 OR ${CMAKE_MAJOR_VERSION} GREATER 2) AND if(${CMAKE_MAJOR_VERSION} GREATER 2 OR
(${CMAKE_MINOR_VERSION} EQUAL 8 OR ${CMAKE_MINOR_VERSION} GREATER 8) AND (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 8) OR
${CMAKE_PATCH_VERSION} GREATER 10) (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 9))
cmake_policy(SET CMP0020 OLD) cmake_policy(SET CMP0020 OLD)
endif() endif()
# nicer version check - but needs at least CMake 2.6.2? Worth upgrading the requirements? # nicer version check - but needs at least CMake 2.6.2? Worth upgrading the requirements?
#if("${CMAKE_VERSION}" VERSION_GREATER 2.8.10) #if("${CMAKE_VERSION}" VERSION_GREATER 2.8.10)
# or even easier (available in cmake-2.6)
#if(POLICY CMPxyzw)
endif() endif()