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