KDL not detecting SIP 4.10 for Python bindings
Submitted by Alexis Maldonado on Tue, 2010-03-30 16:08 |
Hi *,
We use fairly updated Debian Sid machines at the lab, that come with CMake
version 2.8.1 and SIP version 4.10.1.
The current check for SIP uses a string comparison to check if SIP is at
least version 4.7.9, but it fails with 4.10.x.
Example: (Part of the config/FindSIPandPython.cmake file)
SET (SIP_MIN_VERSION 040709)
IF (SIP_VERSION EQUAL "${SIP_MIN_VERSION}" OR SIP_VERSION GREATER
"${SIP_MIN_VERSION}")
There is better support for version comparison starting with CMake 2.6.
Would you consider asking for CMake 2.6 as a requirement? In case you do,
I'm attaching a patch that uses the new version comparison commands.
Then you could do it like this:
SET (SIP_MIN_VERSION "4.7.9")
IF (${SIP_VERSION} VERSION_EQUAL "${SIP_MIN_VERSION}" OR ${SIP_VERSION}
VERSION_GREATER "${SIP_MIN_VERSION}")
CMake 2.4.7 was released in July 2007 and and 2.6.0 in May 2008. Maybe it
has been enough time to get CMake 2.6 on all normal development machines.
Greetings!
Alexis Maldonado
TU-Muenchen
Index: config/FindSIPandPython.cmake
===================================================================
--- config/FindSIPandPython.cmake (revision 31543)
+++ config/FindSIPandPython.cmake (working copy)
@@ -18,11 +18,10 @@
#INCLUDE(${PROJ_SOURCE_DIR}/config/FindSIP.cmake)
IF (SIP_FOUND)
# check for SIP version
- # minimal version is 4.4
- SET (SIP_MIN_VERSION 040709)
- IF (SIP_VERSION EQUAL "${SIP_MIN_VERSION}" OR SIP_VERSION GREATER "${SIP_MIN_VERSION}")
+ SET (SIP_MIN_VERSION "4.7.9")
+ IF (${SIP_VERSION} VERSION_EQUAL "${SIP_MIN_VERSION}" OR ${SIP_VERSION} VERSION_GREATER "${SIP_MIN_VERSION}")
SET (SIP_IS_GOOD TRUE)
- ENDIF (SIP_VERSION EQUAL "${SIP_MIN_VERSION}" OR SIP_VERSION GREATER "${SIP_MIN_VERSION}")
+ ENDIF (${SIP_VERSION} VERSION_EQUAL "${SIP_MIN_VERSION}" OR ${SIP_VERSION} VERSION_GREATER "${SIP_MIN_VERSION}")
IF (NOT SIP_IS_GOOD)
MESSAGE (STATUS "SIP is required in version 4.7.9 or later!")
@@ -40,4 +39,4 @@
MESSAGE(STATUS "Python bindings disabled due dependency problems!")
ENDIF (SIP_IS_GOOD)
-ENDIF (PYTHON_LIBRARIES AND PYTHON_INCLUDE_PATH)
\ No newline at end of file
+ENDIF (PYTHON_LIBRARIES AND PYTHON_INCLUDE_PATH)
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt (revision 31543)
+++ CMakeLists.txt (working copy)
@@ -1,13 +1,9 @@
#
# Test CMake version
#
-CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
#MARK_AS_ADVANCED( FORCE CMAKE_BACKWARDS_COMPATIBILITY )
-# for CMake 2.6 corrected behaviour (see "cmake --help-policy CMP0003")
-IF(COMMAND cmake_policy AND ${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
- CMAKE_POLICY(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy AND ${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
###################################################
# #
@@ -108,7 +104,6 @@
## #
############################################################
-IF ( "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" STREQUAL "2.4" )
OPTION( CPACK_PACKAGES "Set to ON to build the packages. Requires cmake >2.4" OFF )
IF (CPACK_PACKAGES)
@@ -140,8 +135,3 @@
#SET(CPACK_PACKAGE_EXECUTABLES "OrocosExec" "Orocos Executable")
INCLUDE(CPack)
ENDIF (CPACK_PACKAGES)
-ELSE ( "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" STREQUAL "2.4" )
-
- MESSAGE ( "Disabling packaging for version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}")
-
-ENDIF ( "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" STREQUAL "2.4" )
----- End forwarded message -----