]> Creatis software - cpPlugins.git/blobdiff - cmake/cpPluginsConfig.cmake.in
..
[cpPlugins.git] / cmake / cpPluginsConfig.cmake.in
index 8c2e0a86998995b665759ff65f8536f323725d1e..7a2c72a42cd2023c2d7f50b7676a34271b3abf09 100644 (file)
-# ===================================
-# -- Some configurations variables --
-# ===================================
+#================================
+## == Find cpPlugins-cmake tools ==
+#================================
 
-SET(cpPlugins_with_QT4 "@QT4_FOUND@")
+SET(ITK_DIR "@ITK_DIR@")
+SET(VTK_DIR "@VTK_DIR@")
+IF("@Qt4_FOUND@" STREQUAL "TRUE")
+  SET(USE_QT4 ON)
+  SET(QT_QMAKE_EXECUTABLE "@QT_QMAKE_EXECUTABLE@")
+ENDIF("@Qt4_FOUND@" STREQUAL "TRUE")
 
-# =========================
-# -- Include directories --
-# =========================
+#====================
+## == Find libraries ==
+#====================
 
-INCLUDE_DIRECTORIES(
-  @PROJECT_SOURCE_DIR@/lib
-  @PROJECT_SOURCE_DIR@/lib/third_party
-  @PROJECT_SOURCE_DIR@/lib/third_party/ItkVtkGlue
-  @PROJECT_BINARY_DIR@/lib
-  @PROJECT_BINARY_DIR@/lib/third_party
-  @PROJECT_BINARY_DIR@/lib/third_party/ItkVtkGlue
-  @CMAKE_INSTALL_PREFIX@/include
-  @CMAKE_INSTALL_PREFIX@/include/third_party
-  @CMAKE_INSTALL_PREFIX@/include/third_party/ItkVtkGlue
+SET(
+  cpPlugins_AllInstances
+  "@cpPlugins_AllInstances@"
+  CACHE STRING "All instances from templated code"
   )
+MARK_AS_ADVANCED(FORCE cpPlugins_AllInstances)
 
-# =========================
-# -- Library directories --
-# =========================
+SET(
+  _all_libs
+  cp_tinyxml2
+  cpExtensions
+  cpPlugins
+  cpPluginsDataObjects
+  )
+IF(USE_QT4)
+  LIST(APPEND _all_libs cp_QCustomPlot cpBaseQtApplication)
+ENDIF(USE_QT4)
+SET(cpPlugins_Libraries ${_all_libs} CACHE STRING "cpPlugins base libraries")
+MARK_AS_ADVANCED(FORCE cpPlugins_Libraries)
 
-IF(MSVC)
-  LINK_DIRECTORIES(
-    @PROJECT_BINARY_DIR@/$(ConfigurationName)
-    @CMAKE_INSTALL_PREFIX@/bin
-    @CMAKE_INSTALL_PREFIX@/lib
-    )
-ELSE(MSVC)
-  LINK_DIRECTORIES(
+SET(_all_libs ${cpPlugins_AllInstances} ${cpPlugins_Libraries})
+SET(_l_locations)
+FOREACH(_l ${_all_libs})
+  FIND_LIBRARY(
+    ${_l}_LIB NAMES ${_l}
+    PATHS
     @PROJECT_BINARY_DIR@
     @CMAKE_INSTALL_PREFIX@/bin
     @CMAKE_INSTALL_PREFIX@/lib
+    ${_l_locations}
     )
-ENDIF(MSVC)
+  IF(${_l}_LIB)
+    MARK_AS_ADVANCED(FORCE ${_l}_LIB)
+    GET_FILENAME_COMPONENT(_dir ${${_l}_LIB} DIRECTORY)
+    LIST(APPEND _l_locations ${_dir})
+    LIST(REMOVE_DUPLICATES _l_locations)
+  ENDIF(${_l}_LIB)
+ENDFOREACH(_l)
+IF(_l_locations)
+  LINK_DIRECTORIES(${_l_locations})
+ENDIF(_l_locations)
 
-# ===================
-# -- Library names --
-# ===================
+## ==============================
+## == Find include directories ==
+## ==============================
 
-SET(cpExtensions_LIBRARY cpExtensions)
-SET(cpPlugins_Interface_LIBRARY cpPlugins_Interface)
-SET(cpPlugins_LIBRARY cpPlugins)
+## TODO: this is not completely correct!!!
+INCLUDE_DIRECTORIES(
+  @CMAKE_INSTALL_PREFIX@/include
+  @CMAKE_INSTALL_PREFIX@/include/cpPlugins/cpInstances
+  @PROJECT_SOURCE_DIR@
+  @PROJECT_BINARY_DIR@
+  @PROJECT_SOURCE_DIR@/lib
+  @PROJECT_BINARY_DIR@/lib
+  @PROJECT_SOURCE_DIR@/lib/cpInstances
+  @PROJECT_BINARY_DIR@/lib/cpInstances
+  )
 
-# ======================
-# -- Executable names --
-# ======================
+## ============================
+## == Find bash applications ==
+## ============================
 
 SET(
-  cpPlugins_createHost_APP
-  @PROJECT_BINARY_DIR@/cpPlugins_createHost
+  _exec_programs
+  "@cpPlugins_bash_CreateRealConfig_APP@"
+  "@cpPlugins_bash_CreateInstances_APP@"
+  "@cpPlugins_bash_CreateDemanglers_APP@"
+  "@cpPlugins_bash_CreatePlugins_APP@"
+  "@cpPlugins_bash_HostCreator_APP@"
   )
 
+SET(_b_locations)
+FOREACH(_p ${_exec_programs})
+  FIND_PROGRAM(
+    ${_p}_APP
+    NAMES ${_p}
+    HINTS /usr /usr/local
+    PATHS @CMAKE_INSTALL_PREFIX@/bin @PROJECT_BINARY_DIR@ ${_b_locations}
+    PATH_SUFFIXES bin sbin
+    DOC "Where is ${_prog}?"
+    )
+  IF(${_p}_APP)
+    MARK_AS_ADVANCED(FORCE ${_p}_APP)
+    GET_FILENAME_COMPONENT(_dir ${${_p}_APP} DIRECTORY)
+    LIST(APPEND _b_locations ${_dir})
+    LIST(REMOVE_DUPLICATES _b_locations)
+  ENDIF(${_p}_APP)
+ENDFOREACH(_p)
+
+## ==========================
+## == Configuration values ==
+## ==========================
+
+SET(cpPlugins_CONFIG_NUMBER_OF_FILES "@cpPlugins_CONFIG_NUMBER_OF_FILES@" CACHE STRING "Internal")
+SET(cpPlugins_CONFIG_PROCESS_DIMENSIONS "@cpPlugins_CONFIG_PROCESS_DIMENSIONS@" CACHE STRING "Internal")
+SET(cpPlugins_CONFIG_VISUAL_DIMENSIONS "@cpPlugins_CONFIG_VISUAL_DIMENSIONS@" CACHE STRING "Internal")
+
+MARK_AS_ADVANCED(FORCE cpPlugins_CONFIG_NUMBER_OF_FILES)
+MARK_AS_ADVANCED(FORCE cpPlugins_CONFIG_PROCESS_DIMENSIONS)
+MARK_AS_ADVANCED(FORCE cpPlugins_CONFIG_VISUAL_DIMENSIONS)
+
 ## eof - $RCSfile$