Browse Source

ENH: Expose variable CTK_LIBRARIES in CTKConfig.cmake.in

Jean-Christophe Fillion-Robin 15 years ago
parent
commit
254a75a2f8

+ 1 - 1
CMake/ctkMacroBuildApp.cmake

@@ -120,7 +120,7 @@ MACRO(ctkMacroBuildApp)
   TARGET_LINK_LIBRARIES(${proj_name} ${my_libs})
 
   # Update CTK_BASE_LIBRARIES
-#   SET(CTK_BASE_LIBRARIES ${my_libs} ${lib_name} CACHE INTERNAL "CTK libraries" FORCE)
+#   SET(CTK_BASE_LIBRARIES ${my_libs} ${lib_name} CACHE INTERNAL "CTK base libraries" FORCE)
   
   # Install headers
   FILE(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h")

+ 2 - 1
CMake/ctkMacroBuildLib.cmake

@@ -120,7 +120,8 @@ MACRO(ctkMacroBuildLib)
   TARGET_LINK_LIBRARIES(${lib_name} ${my_libs})
 
   # Update CTK_BASE_LIBRARIES
-  SET(CTK_BASE_LIBRARIES ${my_libs} ${lib_name} CACHE INTERNAL "CTK libraries" FORCE)
+  SET(CTK_BASE_LIBRARIES ${my_libs} ${lib_name} CACHE INTERNAL "CTK base libraries" FORCE)
+  SET(CTK_LIBRARIES ${CTK_LIBRARIES} ${lib_name} CACHE INTERNAL "CTK libraries" FORCE)
   
   # Install headers
   FILE(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h")

+ 5 - 2
CMakeLists.txt

@@ -106,9 +106,12 @@ SET(CMAKE_MODULE_PATH
 #-----------------------------------------------------------------------------
 # Clear CTK_BASE_INCLUDE_DIRS and CTK_BASE_LIBRARIES
 #
-SET(CTK_BASE_LIBRARIES CACHE INTERNAL "CTK libraries" FORCE)
+SET(CTK_BASE_LIBRARIES CACHE INTERNAL "CTK base libraries" FORCE)
 SET(CTK_BASE_INCLUDE_DIRS CACHE INTERNAL "CTK includes" FORCE)
 
+# Variable use in CTKConfig.cmake.in
+SET(CTK_LIBRARIES CACHE INTERNAL "CTK libraries" FORCE)
+
 #-----------------------------------------------------------------------------
 # CMake Function(s) and Macro(s)
 #
@@ -222,7 +225,7 @@ ctkMacroSetupQt()
 
 # Update CTK_BASE_LIBRARIES with QT libraries
 IF(QT4_FOUND)
-  SET(CTK_BASE_LIBRARIES ${CTK_BASE_LIBRARIES} ${QT_LIBRARIES} CACHE INTERNAL "CTK libraries" FORCE)
+  SET(CTK_BASE_LIBRARIES ${CTK_BASE_LIBRARIES} ${QT_LIBRARIES} CACHE INTERNAL "CTK base libraries" FORCE)
 ENDIF()
 
 #-----------------------------------------------------------------------------

+ 4 - 0
CTKConfig.cmake.in

@@ -39,6 +39,10 @@
 # This file is configured by CTK and used by the UseCTK.cmake module
 # to load CTK's settings for an external project.
 
+
+# List all libraries
+SET(CTK_LIBRARIES @CTK_LIBRARIES@)
+
 @CTK_CONFIG_INSTALL_ONLY@
 
 # The CTK include file directories.

+ 7 - 6
Utilities/CMake/FindCTK.cmake

@@ -21,20 +21,21 @@
 # - Find a CTK installation or build tree.
 # The following variables are set if CTK is found.  If CTK is not
 # found, CTK_FOUND is set to false.
-#  CTK_FOUND         - Set to true when VTK is found.
-#  CTK_USE_FILE      - CMake file to use VTK.
-#  CTK_MAJOR_VERSION - The VTK major version number.
-#  CTK_MINOR_VERSION - The VTK minor version number
+#  CTK_FOUND         - Set to true when CTK is found.
+#  CTK_USE_FILE      - CMake file to use CTK.
+#  CTK_MAJOR_VERSION - The CTK major version number.
+#  CTK_MINOR_VERSION - The CTK minor version number
 #                       (odd non-release).
-#  CTK_BUILD_VERSION - The VTK patch level
+#  CTK_BUILD_VERSION - The CTK patch level
 #                       (meaningless for odd minor).
 #  CTK_INCLUDE_DIRS  - Include directories for CTK
 #  CTK_LIBRARY_DIRS  - Link directories for CTK libraries
+#  CTK_LIBRARIES     - List of libraries
 #
 # The following cache entries must be set by the user to locate VTK:
 #  CTK_DIR  - The directory containing CTKConfig.cmake.
 #             This is either the root of the build tree,
-#             or the lib/vtk directory.  This is the 
+#             or the lib/ctk directory.  This is the
 #             only cache entry.
 #