]> Creatis software - cpPlugins.git/blob - cmake/cpPluginsConfig.cmake.in
Cast image filter added. ROI filter modified.
[cpPlugins.git] / cmake / cpPluginsConfig.cmake.in
1 ## ================================
2 ## == Find cpPlugins-cmake tools ==
3 ## ================================
4
5 SET(ITK_DIR "@ITK_DIR@")
6 SET(VTK_DIR "@VTK_DIR@")
7 IF("@Qt4_FOUND@" STREQUAL "TRUE")
8   SET(USE_QT4 ON)
9   SET(QT_QMAKE_EXECUTABLE "@QT_QMAKE_EXECUTABLE@")
10 ENDIF("@Qt4_FOUND@" STREQUAL "TRUE")
11
12 ## ====================
13 ## == Find libraries ==
14 ## ====================
15
16 SET(
17   cpPlugins_AllInstances
18   "@cpPlugins_AllInstances@"
19   CACHE STRING "All instances from templated code"
20   )
21 MARK_AS_ADVANCED(FORCE cpPlugins_AllInstances)
22
23 SET(
24   _all_libs
25   cp_tinyxml2
26   cpExtensions
27   cpPlugins
28   cpPluginsDataObjects
29   )
30 IF(USE_QT4)
31   LIST(APPEND _all_libs cp_QCustomPlot cpBaseQtApplication)
32 ENDIF(USE_QT4)
33 SET(cpPlugins_Libraries ${_all_libs} CACHE STRING "cpPlugins base libraries")
34 MARK_AS_ADVANCED(FORCE cpPlugins_Libraries)
35
36 SET(_all_libs ${cpPlugins_AllInstances} ${cpPlugins_Libraries})
37 SET(_l_locations)
38 FOREACH(_l ${_all_libs})
39   FIND_LIBRARY(
40     ${_l}_LIB NAMES ${_l}
41     PATHS
42     @PROJECT_BINARY_DIR@
43     @CMAKE_INSTALL_PREFIX@/bin
44     @CMAKE_INSTALL_PREFIX@/lib
45     ${_l_locations}
46     )
47   IF(${_l}_LIB)
48     MARK_AS_ADVANCED(FORCE ${_l}_LIB)
49     GET_FILENAME_COMPONENT(_dir ${${_l}_LIB} DIRECTORY)
50     LIST(APPEND _l_locations ${_dir})
51     LIST(REMOVE_DUPLICATES _l_locations)
52   ENDIF(${_l}_LIB)
53 ENDFOREACH(_l)
54 IF(_l_locations)
55   LINK_DIRECTORIES(${_l_locations})
56 ENDIF(_l_locations)
57
58 ## ==============================
59 ## == Find include directories ==
60 ## ==============================
61
62 ## TODO: this is not completely correct!!!
63 INCLUDE_DIRECTORIES(
64   @CMAKE_INSTALL_PREFIX@/include
65   @CMAKE_INSTALL_PREFIX@/include/cpPlugins/cpInstances
66   @PROJECT_SOURCE_DIR@
67   @PROJECT_BINARY_DIR@
68   @PROJECT_SOURCE_DIR@/lib
69   @PROJECT_BINARY_DIR@/lib
70   @PROJECT_SOURCE_DIR@/lib/cpInstances
71   @PROJECT_BINARY_DIR@/lib/cpInstances
72   )
73
74 ## ============================
75 ## == Find bash applications ==
76 ## ============================
77
78 SET(
79   _exec_programs
80   "@cpPlugins_bash_CreateRealConfig_APP@"
81   "@cpPlugins_bash_CreateInstances_APP@"
82   "@cpPlugins_bash_CreateDemanglers_APP@"
83   "@cpPlugins_bash_CreatePlugins_APP@"
84   "@cpPlugins_bash_HostCreator_APP@"
85   )
86
87 SET(_b_locations)
88 FOREACH(_p ${_exec_programs})
89   FIND_PROGRAM(
90     ${_p}_APP
91     NAMES ${_p}
92     HINTS /usr /usr/local
93     PATHS @CMAKE_INSTALL_PREFIX@/bin @PROJECT_BINARY_DIR@ ${_b_locations}
94     PATH_SUFFIXES bin sbin
95     DOC "Where is ${_prog}?"
96     )
97   IF(${_p}_APP)
98     MARK_AS_ADVANCED(FORCE ${_p}_APP)
99     GET_FILENAME_COMPONENT(_dir ${${_p}_APP} DIRECTORY)
100     LIST(APPEND _b_locations ${_dir})
101     LIST(REMOVE_DUPLICATES _b_locations)
102   ENDIF(${_p}_APP)
103 ENDFOREACH(_p)
104
105 ## ==========================
106 ## == Configuration values ==
107 ## ==========================
108
109 SET(cpPlugins_CONFIG_NUMBER_OF_FILES "@cpPlugins_CONFIG_NUMBER_OF_FILES@" CACHE STRING "Internal")
110 SET(cpPlugins_CONFIG_PROCESS_DIMENSIONS "@cpPlugins_CONFIG_PROCESS_DIMENSIONS@" CACHE STRING "Internal")
111 SET(cpPlugins_CONFIG_VISUAL_DIMENSIONS "@cpPlugins_CONFIG_VISUAL_DIMENSIONS@" CACHE STRING "Internal")
112
113 MARK_AS_ADVANCED(FORCE cpPlugins_CONFIG_NUMBER_OF_FILES)
114 MARK_AS_ADVANCED(FORCE cpPlugins_CONFIG_PROCESS_DIMENSIONS)
115 MARK_AS_ADVANCED(FORCE cpPlugins_CONFIG_VISUAL_DIMENSIONS)
116
117 ## eof - $RCSfile$