]> Creatis software - bbtk.git/blobdiff - kernel/cmake/BBTKConfigurePackage.cmake
Feature #1774
[bbtk.git] / kernel / cmake / BBTKConfigurePackage.cmake
index ea783e73416d91d50af0878a92534fc7d74a547f..83cc430bf52178a1eebaee1ccef7a9838aabfcf3 100644 (file)
@@ -1,11 +1,56 @@
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+# ==================================
+#           W A R N I N G !
+# ==================================
+#
+# This file is dupplicated as BBTKConfigurePackage2.cmake
+#
+# Only ONE commented out line, in BBTKConfigurePackage2.cmake differs
+# :-(
+# In case of modification, mind to modify BBTKConfigurePackage2.cmake as well!
+#
+
+
+MESSAGE(STATUS "")
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "CONFIGURING BBTK PACKAGE ${BBTK_PACKAGE_NAME}")
 
 #---------------------------------------------------------------------------
 SET(${BBTK_PACKAGE_NAME}_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 #---------------------------------------------------------------------------
 
-
 #---------------------------------------------------------------------------
 IF(NOT BBTK_CORE_PACKAGE)
+  #---------------------------------------------------------------------------
+  SET(BBTK_PACKAGE_LIBS 
+    ${BBTK_PACKAGE_LIBS}
+    ${BBTK_LIBRARIES})
+  MARK_AS_ADVANCED(BBTK_DIR)
   #-------------------------------------------------------------------------
   # If not a core package must include necessary cmake scripts
   INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackagePaths.cmake)
@@ -31,7 +76,7 @@ IF(NOT BBTK_CORE_PACKAGE)
     )
   IF (WIN32)
     INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/bbtkPackage
-      DESTINATION "" )
+      DESTINATION "." )
   ENDIF (WIN32)
   #---------------------------------------------------------------------------
 ELSE(NOT BBTK_CORE_PACKAGE)
@@ -87,7 +132,7 @@ IF(${BBTK_PACKAGE_NAME}_USE_VTK)
   SET(USE_VTK ON CACHE BOOL "Use VTK" FORCE)
   SET(${BBTK_PACKAGE_NAME}_LIBS
     ${${BBTK_PACKAGE_NAME}_LIBS}
-    ${BBTK_VTK_LIBRARIES}
+    ${VTK_LIBRARIES}
     )
 ENDIF(${BBTK_PACKAGE_NAME}_USE_VTK)
 
@@ -95,23 +140,58 @@ IF(${BBTK_PACKAGE_NAME}_USE_ITK)
   SET(USE_ITK ON CACHE BOOL "Use ITK" FORCE)
   SET(${BBTK_PACKAGE_NAME}_LIBS
     ${${BBTK_PACKAGE_NAME}_LIBS}
-    ${BBTK_ITK_LIBRARIES}
+    ${ITK_LIBRARIES}
     )
 ENDIF(${BBTK_PACKAGE_NAME}_USE_ITK)
 
+IF(${BBTK_PACKAGE_NAME}_USE_QT)
+  SET(USE_QT4 ON CACHE BOOL "Use QT" FORCE)
+  SET(${BBTK_PACKAGE_NAME}_LIBS
+    ${${BBTK_PACKAGE_NAME}_LIBS}
+    ${QT_LIBRARIES}
+    )
+ENDIF(${BBTK_PACKAGE_NAME}_USE_QT)
+
+#----------
+
 IF(${BBTK_PACKAGE_NAME}_USE_GDCM)
-  SET(USE_GDCM ON CACHE BOOL "Use GDCM" FORCE)
+  SET(USE_GDCM ON CACHE BOOL "Use GDCM" )
+  SET(USE_GDCM2 OFF CACHE BOOL "Use GDCM2" )
+  SET(USE_GDCM_VTK ON CACHE BOOL "Use GDCM_VTK" FORCE)
   SET(${BBTK_PACKAGE_NAME}_LIBS
     ${${BBTK_PACKAGE_NAME}_LIBS}
-    ${BBTK_GDCM_LIBRARIES}
+    ${GDCM_LIBRARIES}
     )
+       IF(USE_GDCM)
+               IF(USE_GDCM2)
+               message(FATAL_ERROR "You cannot select both GDCM and GDCM2 (DICOM library readers)")
+               ENDIF(USE_GDCM2)
+       ENDIF(USE_GDCM)
 ENDIF(${BBTK_PACKAGE_NAME}_USE_GDCM)
 
+#----------
+
+IF(${BBTK_PACKAGE_NAME}_USE_GDCM2)
+  SET(USE_GDCM2 ON CACHE BOOL "Use GDCM2" FORCE)
+  SET(USE_GDCM2_VTK ON CACHE BOOL "Use GDCM2_VTK" FORCE)
+  SET(${BBTK_PACKAGE_NAME}_LIBS
+    ${${BBTK_PACKAGE_NAME}_LIBS}
+    ${GDCM2_LIBRARIES}
+    )
+       IF(USE_GDCM2)
+               IF(USE_GDCM)
+               message(FATAL_ERROR "You cannot select both GDCM and GDCM2 (DICOM library readers)")
+               ENDIF(USE_GDCM)
+       ENDIF(USE_GDCM2)
+ENDIF(${BBTK_PACKAGE_NAME}_USE_GDCM2)
+
+#----------
+
 IF(${BBTK_PACKAGE_NAME}_USE_GSMIS)
   SET(USE_GSMIS ON CACHE BOOL "Use GSMIS" FORCE)
   SET(${BBTK_PACKAGE_NAME}_LIBS
     ${${BBTK_PACKAGE_NAME}_LIBS}
-    ${BBTK_GSMIS_LIBRARIES}
+    ${GSMIS_LIBRARIES}
     )
 ENDIF(${BBTK_PACKAGE_NAME}_USE_GSMIS)
 
@@ -123,7 +203,7 @@ IF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS)
     IF(WIN32)
       SET(${BBTK_PACKAGE_NAME}_LIBS
         ${${BBTK_PACKAGE_NAME}_LIBS}
-        ${BBTK_WXWIDGETS_LIBRARIES}
+        ${WXWIDGETS_LIBRARIES}
         )
     ENDIF(WIN32)
   ELSE(BBTK_CORE_PACKAGE)
@@ -136,7 +216,7 @@ IF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS)
       IF(WIN32)
         SET(${BBTK_PACKAGE_NAME}_LIBS
           ${${BBTK_PACKAGE_NAME}_LIBS}
-          ${BBTK_WXWIDGETS_LIBRARIES}
+          ${WXWIDGETS_LIBRARIES}
           )
       ENDIF(WIN32)
     ENDIF(NOT BBTK_BUILT_WITH_WX)
@@ -146,16 +226,23 @@ ENDIF(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS)
 
 #---------------------------------------------------------------------------
 
-
+MESSAGE(STATUS "")
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "${BBTK_PACKAGE_NAME} link libraries:")
+MESSAGE(STATUS "${${BBTK_PACKAGE_NAME}_LIBS}")
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "")
 
 #---------------------------------------------------------------------------
-# Recurse into subdirs
-SUBDIRS(src)
-SUBDIRS(doc)
-SUBDIRS(bbs)
-SUBDIRS(data)
+# Recurse into ADD_SUBDIRECTORY
+ADD_SUBDIRECTORY(src)
+ADD_SUBDIRECTORY(doc)
+ADD_SUBDIRECTORY(bbs)
+ADD_SUBDIRECTORY(data)
 #---------------------------------------------------------------------------
 
+MESSAGE(STATUS "=======================================")
+MESSAGE(STATUS "")
 
 #-----------------------------------------------------------------------------
 # EOF