Skip to content

Commit cf430eb

Browse files
jcfrNicole Aucoin
and
Nicole Aucoin
committed
ENH: Fix GenerateCLP install rules. See Slicer#44
* Introduce GenerateCLP_INSTALL_CMAKE_DIR variable allowing to configure install location for "GenerateCLP.cmake" macro. * GenerateCLP_INSTALL_NO_DEVELOPMENT: Change default value from ON to OFF. This will ensure GenerateCLP macro and dependent files are installed by default. * GenerateCLPLauncher: - Update hardcoded location of ITK libraries. It was changed from "bin" to "lib" in ITKv4. - Update forward install dir to account for that fact both GenerateCLP and launcher are installed in the same directory. * Ensure following files are installed: - UseGenerateCLP.cmake - GenerateCLPConfig.cmake - GenerateCLP.cmake Co-authored-by: Nicole Aucoin <[email protected]>
1 parent 4e64fb7 commit cf430eb

File tree

2 files changed

+42
-20
lines changed

2 files changed

+42
-20
lines changed

GenerateCLP/CMakeLists.txt

+41-20
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ endif()
7474
#-----------------------------------------------------------------------------
7575
include(CTest)
7676

77+
#-----------------------------------------------------------------------------
78+
# Install tree directories
79+
#-----------------------------------------------------------------------------
80+
81+
if(NOT DEFINED GenerateCLP_INSTALL_CMAKE_DIR)
82+
set(GenerateCLP_INSTALL_CMAKE_DIR lib/GenerateCLP)
83+
endif()
84+
7785
#-----------------------------------------------------------------------------
7886
# Output directories.
7987
#-----------------------------------------------------------------------------
@@ -133,27 +141,12 @@ if(NOT DEFINED GenerateCLP_INSTALL_BIN_DIR)
133141
set(GenerateCLP_INSTALL_BIN_DIR bin)
134142
endif()
135143
if(NOT DEFINED ${PROJECT_NAME}_INSTALL_NO_DEVELOPMENT)
136-
set(${PROJECT_NAME}_INSTALL_NO_DEVELOPMENT ON)
144+
set(${PROJECT_NAME}_INSTALL_NO_DEVELOPMENT OFF)
137145
endif()
138146
if(NOT ${PROJECT_NAME}_INSTALL_NO_DEVELOPMENT)
139-
install(TARGETS GenerateCLP RUNTIME
140-
DESTINATION ${GenerateCLP_INSTALL_BIN_DIR} COMPONENT Development
141-
)
142-
endif()
143-
144-
# --------------------------------------------------------------------------
145-
# Install support files
146-
# --------------------------------------------------------------------------
147-
if(NOT ${PROJECT_NAME}_INSTALL_NO_DEVELOPMENT)
148-
install(FILES ${GenerateCLP_BINARY_DIR}/GenerateCLPConfig.cmake_install
149-
DESTINATION lib/GenerateCLP
150-
COMPONENT Development
151-
RENAME GenerateCLPConfig.cmake
152-
)
153-
install(FILES ${GenerateCLP_BINARY_DIR}/UseGenerateCLP.cmake_install
154-
DESTINATION lib/GenerateCLP
147+
install(TARGETS GenerateCLP
148+
RUNTIME DESTINATION ${GenerateCLP_INSTALL_BIN_DIR}
155149
COMPONENT Development
156-
RENAME UseGenerateCLP.cmake
157150
)
158151
endif()
159152

@@ -173,11 +166,11 @@ set(GenerateCLP_FORWARD_PATH_BUILD " \\
173166
")
174167
set(GenerateCLP_FORWARD_PATH_INSTALL " \\
175168
\".\", \\
176-
\"${ITK_DIR}/bin\", \\
169+
\"${ITK_DIR}/lib\", \\
177170
\"${ModuleDescriptionParser_DIR}/bin\" \\
178171
")
179172
set(GenerateCLP_FORWARD_EXE GenerateCLP)
180-
set(GenerateCLP_FORWARD_DIR_INSTALL "..")
173+
set(GenerateCLP_FORWARD_DIR_INSTALL ".")
181174

182175
# --------------------------------------------------------------------------
183176
# Build launcher
@@ -222,6 +215,34 @@ configure_file(
222215
)
223216
include(GenerateGenerateCLPConfig.cmake)
224217

218+
# --------------------------------------------------------------------------
219+
# Install support files
220+
# --------------------------------------------------------------------------
221+
if(NOT ${PROJECT_NAME}_INSTALL_NO_DEVELOPMENT)
222+
223+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/GenerateCLP.cmake
224+
DESTINATION ${GenerateCLP_INSTALL_CMAKE_DIR}
225+
COMPONENT Development
226+
)
227+
228+
configure_file(
229+
GenerateCLPInstallConfig.cmake.in
230+
${GenerateCLP_BINARY_DIR}/GenerateCLPConfig.cmake_install
231+
@ONLY
232+
)
233+
install(FILES ${GenerateCLP_BINARY_DIR}/GenerateCLPConfig.cmake_install
234+
DESTINATION lib/GenerateCLP
235+
COMPONENT Development
236+
RENAME GenerateCLPConfig.cmake
237+
)
238+
239+
install(FILES ${GenerateCLP_SOURCE_DIR}/UseGenerateCLP.cmake.in
240+
DESTINATION lib/GenerateCLP
241+
COMPONENT Development
242+
RENAME UseGenerateCLP.cmake
243+
)
244+
endif()
245+
225246
# --------------------------------------------------------------------------
226247
# Testing
227248
# --------------------------------------------------------------------------

GenerateCLP/GenerateCLPInstallConfig.cmake.in

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ endif(WIN32)
99

1010
set(GenerateCLP_INCLUDE_DIRS "${GenerateCLP_CONFIG_DIR}/../../include/GenerateCLP")
1111
set(GenerateCLP_LIBRARY_DIRS "${GenerateCLP_CONFIG_DIR}")
12+
set(GenerateCLP_CMAKE_DIR "${GenerateCLP_CONFIG_DIR}")
1213
set(GenerateCLP_USE_FILE "${GenerateCLP_CONFIG_DIR}/UseGenerateCLP.cmake")
1314
set(GENERATECLP_EXE "${GenerateCLP_CONFIG_DIR}/../../bin/GenerateCLP")
1415
if(NOT WIN32)

0 commit comments

Comments
 (0)