[soprano] /: Further improve FindRaptor.cmake

Raymond Wooninck tittiatcoke at gmail.com
Fri Aug 5 10:10:25 UTC 2011


Git commit c7c5c16fa790053cd6b654b5cdd11984ffa29b9d by Raymond Wooninck.
Committed on 05/08/2011 at 12:05.
Pushed by rwooninck into branch 'master'.

Further improve FindRaptor.cmake
  - Only Raptor2 is required
  - If Raptor2 is not found, but Raptor1 then a nice message is printed
  - Version check for Raptor2 has been moved to the main CMakeList.txt

NOTICE: Untested on windows.

CCMAIL:kde-buildsystem at kde.org
CCMAIL:trueg:kde.org
CCMAIL:kde at michael-jansen.biz

M  +9    -4    CMakeLists.txt
M  +8    -39   cmake/modules/FindRaptor.cmake

http://commits.kde.org/soprano/c7c5c16fa790053cd6b654b5cdd11984ffa29b9d

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 600d373..c5aa056 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,10 +42,7 @@ include(${QT_USE_FILE})
 
 if(NOT SOPRANO_DISABLE_RAPTOR_PARSER OR NOT SOPRANO_DISABLE_RAPTOR_SERIALIZER OR NOT SOPRANO_DISABLE_REDLAND_BACKEND)
   find_package(Rasqal)
-  ## Dear packagers! There were serious bug that was fixed in 2.0.4. comparing to 2.0.3
-  ## But, if for some reasons you can' ship 2.0.4, there is|are backport(s) of this fix to 2.0.3
-  ## One of such backports was created by ArchLinux team. You may wish to contact them for it.
-  find_package(Raptor 2.0.4)
+  find_package(Raptor)
   find_package(Redland)
 
   if(WIN32)
@@ -99,6 +96,13 @@ if(REDLAND_FOUND)
    macro_ensure_version( "1.0.5" ${REDLAND_VERSION} REDLAND_VERSION_GOOD )
 endif(REDLAND_FOUND)
 
+## Dear packagers! There were serious bug that was fixed in 2.0.4. comparing to 2.0.3
+## But, if for some reasons you can' ship 2.0.4, there is|are backport(s) of this fix to 2.0.3
+## One of such backports was created by ArchLinux team. You may wish to contact them for it.
+if(RAPTOR_FOUND)
+	macro_ensure_version( "2.0.4" ${RAPTOR_VERSION} RAPTOR_HAVE_TRIG )
+endif(RAPTOR_FOUND)
+
 if(REDLAND_FOUND AND NOT SOPRANO_DISABLE_REDLAND_BACKEND)
   set(BUILD_REDLAND_BACKEND TRUE)
 endif(REDLAND_FOUND AND NOT SOPRANO_DISABLE_REDLAND_BACKEND)
@@ -312,6 +316,7 @@ endif(NOT BUILD_VIRTUOSO_BACKEND)
 
 if(NOT BUILD_RAPTOR_PARSER)
   message("   * Raptor RDF parser (missing libraptor - http://librdf.org)")
+  message("     !! The Raptor RDF parser is required to build KDELIBS !!")
 endif(NOT BUILD_RAPTOR_PARSER)
 
 if(NOT BUILD_RAPTOR_SERIALIZER)
diff --git a/cmake/modules/FindRaptor.cmake b/cmake/modules/FindRaptor.cmake
index c5043c8..ec528f5 100644
--- a/cmake/modules/FindRaptor.cmake
+++ b/cmake/modules/FindRaptor.cmake
@@ -32,7 +32,6 @@ MACRO ( FIND_RAPTOR libname libhints includehints )
 ENDMACRO ()
 
 
-
 # Check if we have cached results in case the last round was successful.
 if ( NOT( RAPTOR_INCLUDE_DIR AND RAPTOR_LIBRARIES ) OR NOT RAPTOR_FOUND )
 
@@ -40,44 +39,14 @@ if ( NOT( RAPTOR_INCLUDE_DIR AND RAPTOR_LIBRARIES ) OR NOT RAPTOR_FOUND )
     include(MacroEnsureVersion)
     find_package(PkgConfig)
 
-    # Vy default look for version 2.0
-    if (NOT Raptor_FIND_VERSION )
-        set( Raptor_FIND_VERSION "2.0")
-        set( Raptor_FIND_VERSION_MAJOR "2" )
-        set( Raptor_FIND_VERSION_MINOR "0" )
-    endif ()
-
-    if ( Raptor_FIND_VERSION_MAJOR EQUAL "2" )
-
-        if ( NOT WIN32 )
-            pkg_check_modules(PC_RAPTOR2 QUIET raptor2)
-            if ( PC_RAPTOR2_FOUND )
-                set(RAPTOR_DEFINITIONS ${PC_RAPTOR2_CFLAGS_OTHER})
-                set(RAPTOR_VERSION ${PC_RAPTOR2_VERSION} CACHE STRING "Raptor Version found" )
-            endif ()
-        endif ()
-        find_raptor( raptor2 "${PC_RAPTOR2_LIBDIR};${PC_RAPTOR2_LIBRARY_DIRS}" "${PC_RAPTOR2_INCLUDEDIR};${PC_RAPTOR2_INCLUDE_DIRS}")
-
-    elseif ( Raptor_FIND_VERSION_MAJOR EQUAL "1" )
-
-        if ( NOT WIN32 )
-            pkg_check_modules(PC_RAPTOR QUIET raptor)
-            if ( PC_RAPTOR_FOUND )
-                set(RAPTOR_DEFINITIONS ${PC_RAPTOR_CFLAGS_OTHER})
-                set(RAPTOR_VERSION ${PC_RAPTOR_VERSION} CACHE STRING "Raptor Version found" )
-            endif ()
+    if ( NOT WIN32 )
+        pkg_check_modules(PC_RAPTOR2 QUIET raptor2)
+        if ( PC_RAPTOR2_FOUND )
+            set(RAPTOR_DEFINITIONS ${PC_RAPTOR2_CFLAGS_OTHER})
+            set(RAPTOR_VERSION ${PC_RAPTOR2_VERSION} CACHE STRING "Raptor Version found" )
         endif ()
-        find_raptor( raptor "${PC_RAPTOR_LIBDIR};${PC_RAPTOR_LIBRARY_DIRS}" "${PC_RAPTOR_INCLUDEDIR};${PC_RAPTOR_INCLUDE_DIRS}")
-
-    else ()
-
-        message( FATAL_ERROR "No idea how to check for version : ${Raptor_FIND_VERSION}")
-
-    endif()
-
-    if (RAPTOR_VERSION)
-        MACRO_ENSURE_VERSION("1.4.16" ${RAPTOR_VERSION} RAPTOR_HAVE_TRIG)
-    endif (RAPTOR_VERSION)
+    endif ()
+    find_raptor( raptor2 "${PC_RAPTOR2_LIBDIR};${PC_RAPTOR2_LIBRARY_DIRS}" "${PC_RAPTOR2_INCLUDEDIR};${PC_RAPTOR2_INCLUDE_DIRS}")
 
     mark_as_advanced(RAPTOR_INCLUDE_DIR RAPTOR_LIBRARIES)
 
@@ -92,7 +61,7 @@ find_package_handle_standard_args(
 
 mark_as_advanced(RAPTOR_VERSION)
 
-if (NOT RAPTOR_FOUND AND Raptor_FIND_VERSION_MAJOR EQUAL "2" AND NOT Raptor_FIND_QUIET )
+if (NOT RAPTOR_FOUND )
     pkg_check_modules(PC_RAPTOR QUIET raptor)
     if (PC_RAPTOR_FOUND)
         message( STATUS "You have raptor1 version ${PC_RAPTOR_VERSION} installed. Please update." )


More information about the Kde-buildsystem mailing list