Parcourir la source

COMP: Superbuild - Now downloading Log4Qt from
http://github.com/commontk/Log4Qt

That new repository contains two branches:
- the default one named "patched"
- an other one named "svn-mirror" which is used
to track the official repository of Log4Qt (see http://log4qt.svn.sourceforge.net/viewvc/log4qt/trunk/)

Since the patched are kept in a separate branch, that will make easier:
1) merge of the official mirror with our patched version easier
2) eventual contribution back to the upstream svn easier

Jean-Christophe Fillion-Robin il y a 15 ans
Parent
commit
4a3d7b4370

+ 29 - 0
CMakeExternals/Log4Qt.cmake

@@ -0,0 +1,29 @@
+#
+# Log4Qt
+#
+SET(Log4Qt_DEPENDS)
+ctkMacroShouldAddExternalProject(Log4Qt_LIBRARIES add_project)
+IF(${add_project})
+
+  # Sanity checks
+  IF(DEFINED Log4Qt_DIR AND NOT EXISTS ${Log4Qt_DIR})
+    MESSAGE(FATAL_ERROR "Log4Qt_DIR variable is defined but corresponds to non-existing directory")
+  ENDIF()
+  
+  IF(NOT DEFINED Log4Qt_DIR)
+    SET(proj Log4Qt)
+#     MESSAGE(STATUS "Adding project:${proj}")
+    SET(Log4Qt_DEPENDS ${proj})
+    ExternalProject_Add(${proj}
+        GIT_REPOSITORY "git://github.com/commontk/Log4Qt.git"
+        GIT_TAG "patched"
+        CMAKE_GENERATOR ${gen}
+        BUILD_COMMAND ""
+        CMAKE_ARGS
+          ${ep_common_args}
+          -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+        )
+    SET(Log4Qt_DIR ${ep_install_dir})
+      
+  ENDIF()
+ENDIF()

+ 0 - 28
CMakeExternals/log4qt.cmake

@@ -1,28 +0,0 @@
-#
-# log4qt
-#
-SET(log4qt_DEPENDS)
-ctkMacroShouldAddExternalProject(log4qt_LIBRARIES add_project)
-IF(${add_project})
-
-  # Sanity checks
-  IF(DEFINED log4qt_DIR AND NOT EXISTS ${log4qt_DIR})
-    MESSAGE(FATAL_ERROR "log4qt_DIR variable is defined but corresponds to non-existing directory")
-  ENDIF()
-  
-  IF(NOT DEFINED log4qt_DIR)
-    SET(proj log4qt)
-#     MESSAGE(STATUS "Adding project:${proj}")
-    SET(log4qt_DEPENDS ${proj})
-    ExternalProject_Add(${proj}
-        DOWNLOAD_COMMAND ""
-        CMAKE_GENERATOR ${gen}
-        SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/${proj}
-        CMAKE_ARGS
-          ${ep_common_args}
-          -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
-        )
-    SET(log4qt_DIR ${ep_install_dir})
-      
-  ENDIF()
-ENDIF()

+ 4 - 4
Libs/Core/CMakeLists.txt

@@ -6,9 +6,9 @@ SET(CMAKE_MODULE_PATH ${CTKCore_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH})
 # CMake Macros
 INCLUDE(CMake/ctkMacroBFDCheck.cmake)
 
-FIND_PACKAGE(log4qt)
-if ( NOT log4qt_FOUND )
-  MESSAGE(FATAL_ERROR "error: log4qt package is required to build ${PROJECT_NAME}" )
+FIND_PACKAGE(Log4Qt)
+if (NOT Log4Qt_FOUND)
+  MESSAGE(FATAL_ERROR "error: Log4Qt package is required to build ${PROJECT_NAME}" )
 endif()
 #
 # See CTK/CMake/ctkMacroBuildLib.cmake for details
@@ -18,7 +18,7 @@ SET(KIT_export_directive "CTK_CORE_EXPORT")
 
 # Additional directories to include
 SET(KIT_include_directories
-  ${log4qt_INCLUDE_DIR}
+  ${Log4Qt_INCLUDE_DIR}
   )
   
 # Source files

+ 1 - 1
Libs/Core/target_libraries.cmake

@@ -7,5 +7,5 @@
 SET(target_libraries
   QT_LIBRARIES
   BFD_LIBRARIES
-  log4qt_LIBRARIES
+  Log4Qt_LIBRARIES
   )

+ 3 - 3
SuperBuild.cmake

@@ -93,7 +93,7 @@ ctkMacroGetAllNonCTKTargetLibraries("${ALL_TARGET_LIBRARIES}" NON_CTK_DEPENDENCI
 #
 SET(external_projects
   CTKData
-  log4qt
+  Log4Qt
   KWStyle
   PythonQt
   DCMTK
@@ -120,7 +120,7 @@ ExternalProject_Add(${proj}
   INSTALL_COMMAND ""
   DEPENDS
     # Mandatory dependencies
-    ${log4qt_DEPENDS}
+    ${Log4Qt_DEPENDS}
     # Optionnal dependencies
     ${CTKData_DEPENDS}
     ${QtMobility_DEPENDS}
@@ -217,7 +217,7 @@ ExternalProject_Add(${proj}
     -DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}     # FindPythonQt expects PYTHON_INCLUDE_DIR variable to be defined
     -DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY}         # FindPythonQt expects PYTHON_LIBRARY variable to be defined
     -DPYTHONQT_INSTALL_DIR:PATH=${PYTHONQT_INSTALL_DIR} # FindPythonQt expects PYTHONQT_INSTALL_DIR variable to be defined
-    -Dlog4qt_DIR:PATH=${log4qt_DIR} # Findlog4qt expects log4qt_DIR variable to be defined
+    -DLog4Qt_DIR:PATH=${Log4Qt_DIR} # FindLog4Qt expects Log4Qt_DIR variable to be defined
   SOURCE_DIR ${CTK_SOURCE_DIR}
   BINARY_DIR ${CTK_BINARY_DIR}/CTK-build
   BUILD_COMMAND ""

+ 31 - 0
Utilities/CMake/FindLog4Qt.cmake

@@ -0,0 +1,31 @@
+#  Log4Qt_INCLUDE_DIR   - Directories to include to use log4qt
+#  Log4Qt_LIBRARIES     - Files to link against to use log4qt
+#  Log4Qt_FOUND         - If false, don't try to use log4qt
+
+IF( NOT Log4Qt_FOUND )
+  SET( Log4Qt_DIR "/usr/include/log4qt/"
+    CACHE PATH "Root of Log4Qt source tree (optional)." )
+  MARK_AS_ADVANCED(Log4Qt_DIR)
+ENDIF()
+
+FIND_PATH(Log4Qt_category_INCLUDE_DIR log4qt.h
+  PATHS
+    ${Log4Qt_DIR}/include/log4qt
+  NO_DEFAULT_PATH
+)
+
+FIND_LIBRARY(Log4Qt_LIBRARIES Log4Qt
+  PATHS
+    ${Log4Qt_DIR}/
+    ${Log4Qt_DIR}/Release
+    ${Log4Qt_DIR}/Debug
+    ${Log4Qt_DIR}/lib/Release
+    ${Log4Qt_DIR}/lib/Debug
+    ${Log4Qt_DIR}/lib
+  NO_DEFAULT_PATH
+)
+
+if(Log4Qt_category_INCLUDE_DIR AND Log4Qt_LIBRARIES)
+  set(Log4Qt_INCLUDE_DIR ${Log4Qt_DIR}/include ${Log4Qt_DIR}/src)
+  set(Log4Qt_FOUND "YES" )
+endif()