Small cmake Patch vor libkscan in kdegraphics

Marcus Hufgard (Kalkwerk Hufgard GmbH) Marcus.Hufgard at hufgard.de
Mon Mar 27 07:22:50 BST 2006


Hi!

Here you get a small patch wich includes san in libkscan at build.

Please put it into trunk.

By

Marcus



Index: kdegraphics/cmake/modules/FindSane.cmake
===================================================================
--- kdegraphics/cmake/modules/FindSane.cmake    (Revision 0)
+++ kdegraphics/cmake/modules/FindSane.cmake    (Revision 0)
@@ -0,0 +1,40 @@
+# Marcus Hufgard <Hufgardm at hufgard.de> 2006
+# cmake macro to test if we use sane
+#
+#  SANE_FOUND - system has Jasper
+#  SANE_INCLUDE_DIR - the Jasper include directory
+#  SANE_LIBRARIES - The libraries needed to use Jasper
+
+FIND_PATH(SANE_INCLUDE_DIR sane/sane.h
+   /usr/include
+   /usr/local/include
+)
+
+FIND_LIBRARY(SANE_LIBRARY NAMES  sane libsane
+   PATHS
+   /usr/lib/sane
+   /usr/lib
+   /usr/local/lib/sane
+   /usr/local/lib
+)
+
+if (SANE_INCLUDE_DIR AND SANE_LIBRARY)
+   set(SANE_FOUND TRUE)
+   set(SANE_LIBRARIES ${SANE_LIBRARY})
+else (SANE_INCLUDE_DIR AND SANE_LIBRARY)
+   set(SANE_FOUND FALSE)
+endif (SANE_INCLUDE_DIR AND SANE_LIBRARY)
+
+if (SANE_FOUND)
+   if (NOT Sane_FIND_QUIETLY)
+      message(STATUS "Found sane: ${SANE_LIBRARIES}")
+   endif (NOT Sane_FIND_QUIETLY)
+else (SANE_FOUND)
+   if (NOT Sane_FIND_QUIETLY)
+      message(STATUS "don't find sane so you can't build libkscan and 
kooka")
+   endif (NOT Sane_FIND_QUIETLY)
+endif (SANE_FOUND)
+
+MARK_AS_ADVANCED(SANE_INCLUDE_DIR SANE_LIBRARIES SANE_LIBRARY)
+
+
Index: kdegraphics/libkscan/CMakeLists.txt
===================================================================
--- kdegraphics/libkscan/CMakeLists.txt    (Revision 522918)
+++ kdegraphics/libkscan/CMakeLists.txt    (Arbeitskopie)
@@ -2,7 +2,7 @@
 
 add_subdirectory( pics )
 
-include_directories( ${CMAKE_SOURCE_DIR}/libkscan ${KDE4_INCLUDE_DIR} 
${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}  )
+include_directories( ${CMAKE_SOURCE_DIR}/libkscan ${KDE4_INCLUDE_DIR} 
${QT_INCLUDES} ${SANE_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} 
${CMAKE_CURRENT_BINARY_DIR}  )
 
 
 ########### next target ###############
@@ -30,7 +30,7 @@
 
 kde4_add_library(kscan SHARED ${kscan_LIB_SRCS})
 
-target_link_libraries(kscan  ${KDE4_KDECORE_LIBS} )
+target_link_libraries(kscan  ${KDE4_KDECORE_LIBS} ${SANE_LIBRARIES})
 
 set_target_properties(kscan PROPERTIES VERSION 1.0.0 SOVERSION 1 )
 install_targets(${LIB_INSTALL_DIR} kscan )
Index: kdegraphics/CMakeLists.txt
===================================================================
--- kdegraphics/CMakeLists.txt    (Revision 522918)
+++ kdegraphics/CMakeLists.txt    (Arbeitskopie)
@@ -20,6 +20,7 @@
 
 macro_optional_find_package(KPDF)
 macro_optional_find_package(Gphoto2)
+macro_optional_find_package(Sane)
 if (APPLE)
    find_package(Carbon REQUIRED)
 endif (APPLE)
@@ -52,6 +53,11 @@
     add_subdirectory(kamera)
 endif(KDE4_GPHOTO2)
 
+if(SANE_LIBRARY)
+    add_subdirectory(libkscan)
+    add_subdirectory(kooka)
+endif(SANE_LIBRARY)
+
 add_subdirectory(kcoloredit)
 add_subdirectory(kfax)
 add_subdirectory(kfile-plugins)
@@ -60,14 +66,12 @@
 add_subdirectory(kiconedit)
 add_subdirectory(kmrml)
 add_subdirectory(kolourpaint)
-add_subdirectory(kooka)
 add_subdirectory(kpdf)
 add_subdirectory(kpovmodeler)
 add_subdirectory(kruler)
 add_subdirectory(ksnapshot)
 add_subdirectory(kuickshow)
 #add_subdirectory(kviewshell)
-add_subdirectory(libkscan)
 
 MESSAGE(STATUS "Perhaps not install FindKDE4. It will conflict when we 
install with rpm/deb package")
 add_subdirectory( cmake )







More information about the kde-core-devel mailing list