@@ -179,20 +179,23 @@ endif()
179
179
180
180
#---------------------------------------------------------------------
181
181
# Create the elastix executable and library.
182
- add_executable (elastix_exe
183
- Main/elastix.cxx
184
- Main/elastix.h
185
- Main/elxMainExeUtilities.cxx
186
- Main/elxMainExeUtilities.h
187
- Kernel/elxMainBase.cxx
188
- Kernel/elxMainBase.h
189
- Kernel/elxElastixMain.cxx
190
- Kernel/elxElastixMain.h
191
- ${InstallFilesForExecutables}
192
- )
193
- set_target_properties (elastix_exe PROPERTIES OUTPUT_NAME elastix)
194
- target_compile_definitions (elastix_exe PRIVATE ELX_CMAKE_VERSION="${CMAKE_VERSION} " )
195
- target_link_libraries (elastix_exe ${ELASTIX_TARGET_LINK_LIBRARIES} )
182
+
183
+ if (ELASTIX_BUILD_EXECUTABLE)
184
+ add_executable (elastix_exe
185
+ Main/elastix.cxx
186
+ Main/elastix.h
187
+ Main/elxMainExeUtilities.cxx
188
+ Main/elxMainExeUtilities.h
189
+ Kernel/elxMainBase.cxx
190
+ Kernel/elxMainBase.h
191
+ Kernel/elxElastixMain.cxx
192
+ Kernel/elxElastixMain.h
193
+ ${InstallFilesForExecutables}
194
+ )
195
+ set_target_properties (elastix_exe PROPERTIES OUTPUT_NAME elastix)
196
+ target_compile_definitions (elastix_exe PRIVATE ELX_CMAKE_VERSION="${CMAKE_VERSION} " )
197
+ target_link_libraries (elastix_exe ${ELASTIX_TARGET_LINK_LIBRARIES} )
198
+ endif ()
196
199
197
200
# The library type (STATIC or SHARED) is determined by the parameter
198
201
# BUILD_SHARED_LIBS.
@@ -216,20 +219,22 @@ target_link_libraries(elastix_lib ${ELASTIX_TARGET_LINK_LIBRARIES})
216
219
#---------------------------------------------------------------------
217
220
# Create the transformix executable.
218
221
219
- add_executable (transformix_exe
220
- Main/transformix.cxx
221
- Main/elastix.h
222
- Main/elxMainExeUtilities.cxx
223
- Main/elxMainExeUtilities.h
224
- Kernel/elxMainBase.cxx
225
- Kernel/elxMainBase.h
226
- Kernel/elxTransformixMain.cxx
227
- Kernel/elxTransformixMain.h
228
- ${InstallFilesForExecutables}
229
- )
230
- set_target_properties (transformix_exe PROPERTIES OUTPUT_NAME transformix)
231
- target_compile_definitions (transformix_exe PRIVATE ELX_CMAKE_VERSION="${CMAKE_VERSION} " )
232
- target_link_libraries (transformix_exe ${ELASTIX_TARGET_LINK_LIBRARIES} )
222
+ if (ELASTIX_BUILD_EXECUTABLE)
223
+ add_executable (transformix_exe
224
+ Main/transformix.cxx
225
+ Main/elastix.h
226
+ Main/elxMainExeUtilities.cxx
227
+ Main/elxMainExeUtilities.h
228
+ Kernel/elxMainBase.cxx
229
+ Kernel/elxMainBase.h
230
+ Kernel/elxTransformixMain.cxx
231
+ Kernel/elxTransformixMain.h
232
+ ${InstallFilesForExecutables}
233
+ )
234
+ set_target_properties (transformix_exe PROPERTIES OUTPUT_NAME transformix)
235
+ target_compile_definitions (transformix_exe PRIVATE ELX_CMAKE_VERSION="${CMAKE_VERSION} " )
236
+ target_link_libraries (transformix_exe ${ELASTIX_TARGET_LINK_LIBRARIES} )
237
+ endif ()
233
238
234
239
# The library type (STATIC or SHARED) is determined by the parameter
235
240
# BUILD_SHARED_LIBS.
@@ -254,13 +259,13 @@ set(ELASTIX_LIBRARIES elastix_lib transformix_lib PARENT_SCOPE)
254
259
#---------------------------------------------------------------------
255
260
# Define the install directory for elastix and transformix.
256
261
257
- if (NOT WIN32 )
262
+ if (ELASTIX_BUILD_EXECUTABLE AND NOT WIN32 )
258
263
# Tell the executables where to find the required .so files.
259
264
set_target_properties (elastix_exe transformix_exe
260
265
PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX} /lib:${ITK_DIR} " )
261
266
endif ()
262
267
263
- if (NOT ELASTIX_NO_INSTALL_EXECUTABLES)
268
+ if (ELASTIX_BUILD_EXECUTABLE AND NOT ELASTIX_NO_INSTALL_EXECUTABLES)
264
269
install (TARGETS elastix_exe transformix_exe
265
270
ARCHIVE DESTINATION ${ELASTIX_ARCHIVE_DIR}
266
271
LIBRARY DESTINATION ${ELASTIX_LIBRARY_DIR}
0 commit comments