]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/CMakeLists.txt
...
[cpPlugins.git] / lib / cpPlugins / CMakeLists.txt
1 ## =============================
2 ## = Set names and directories =
3 ## =============================
4
5 SET(lib_NAME cpPlugins)
6 SET(lib_DIR  cpPlugins)
7
8 ## =========================
9 ## = Configure local files =
10 ## =========================
11
12 CONFIGURE_FILE(
13   Config.h.in
14   ${PROJECT_BINARY_DIR}/lib/${lib_DIR}/Config.h
15   @ONLY
16   )
17
18 ## ===============
19 ## = Source code =
20 ## ===============
21
22 FILE(GLOB lib_HEADERS_H   "*.h")
23 FILE(GLOB lib_HEADERS_HPP "*.hpp")
24 FILE(GLOB lib_HEADERS_HXX "*.hxx")
25 FILE(GLOB lib_SOURCES_C   "*.c")
26 FILE(GLOB lib_SOURCES_CPP "*.cpp")
27 FILE(GLOB lib_SOURCES_CXX "*.cxx")
28
29 IF(USE_QT4)
30   SET(
31     lib_QT_UI
32     ActorAxesProperties.ui
33     ActorImageProperties.ui
34     ActorPolyDataProperties.ui
35     )
36   SET(
37     lib_QT_Headers
38     ActorProperties.h
39     ActorAxesProperties.h
40     ActorImageProperties.h
41     ActorPolyDataProperties.h
42     ActorPropertiesQtDialog.h
43     ParametersQtDialog.h
44     )
45   SET(
46     lib_QT_Sources
47     ActorProperties.cxx
48     ActorAxesProperties.cxx
49     ActorImageProperties.cxx
50     ActorPolyDataProperties.cxx
51     ActorPropertiesQtDialog.cxx
52     ParametersQtDialog.cxx
53     )
54   SET(
55     lib_QT_Resources
56     )
57
58   QT4_WRAP_UI(lib_QT_Wrapped_Headers ${lib_QT_UI})
59   QT4_WRAP_CPP(lib_QT_Wrapped_MOC_Sources ${lib_QT_Headers})
60   QT4_ADD_RESOURCES(lib_QT_Wrapped_Resources_Sources ${lib_QT_Resources})
61
62   SET(
63     lib_HEADERS_H
64     ${lib_HEADERS_H}
65     ${lib_QT_Wrapped_Headers}
66     )
67
68   SET(
69     lib_SOURCES_CXX
70     ${lib_SOURCES_CXX}
71     ${lib_QT_Sources}
72     ${lib_QT_Wrapped_Headers}
73     ${lib_QT_Wrapped_MOC_Sources}
74     ${lib_QT_Wrapped_Resources_Sources}
75     )
76
77 ENDIF(USE_QT4)
78
79 # ===================================
80 # = Integrate all source file names =
81 # ===================================
82
83 SET(
84   lib_HEADERS
85   ${lib_HEADERS_H}
86   ${lib_HEADERS_HPP}
87   ${lib_HEADERS_HXX}
88   )
89
90 SET(
91   lib_SOURCES
92   ${lib_SOURCES_C}
93   ${lib_SOURCES_CPP}
94   ${lib_SOURCES_CXX}
95   )
96
97 SET(
98   target_LIBRARIES
99   ${ITK_LIBRARIES}
100   ${VTK_LIBRARIES}
101   cpExtensions
102   cpPlugins_tinyxml2
103   ${cpPlugins_LIBRARIES}
104   )
105 IF(NOT WIN32)
106   SET(
107     target_LIBRARIES
108     ${target_LIBRARIES}
109     dl
110     )
111 ENDIF(NOT WIN32)
112
113 ## =====================
114 ## = Compilation rules =
115 ## =====================
116
117 ADD_LIBRARY(${lib_NAME} SHARED  ${lib_SOURCES})
118 SET_TARGET_PROPERTIES(
119   ${lib_NAME} PROPERTIES
120   VERSION "${prj_VER}"
121   SOVERSION "${prj_sVER}"
122   )
123 ADD_DEPENDENCIES(${lib_NAME} ${cpPlugins_LIBRARIES})
124 GENERATE_EXPORT_HEADER(
125   ${lib_NAME}
126   BASE_NAME ${lib_NAME}
127   EXPORT_MACRO_NAME ${lib_NAME}_EXPORT
128   EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/${lib_DIR}/${lib_NAME}_Export.h
129   STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
130   )
131 TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
132
133 ## ========================
134 ## == Installation rules ==
135 ## ========================
136
137 INSTALL(
138   TARGETS ${lib_NAME}
139   RUNTIME DESTINATION bin
140   LIBRARY DESTINATION lib
141   ARCHIVE DESTINATION lib/static
142   )
143 INSTALL(
144   FILES
145   ${lib_HEADERS}
146   DESTINATION include/${lib_DIR}
147   )
148
149 ## eof - $RCSfile$