Skip to content

Commit

Permalink
COMP: Add support for appending a suffix to Autoscoper artifacts
Browse files Browse the repository at this point in the history
The option Autoscoper_ARTIFACT_SUFFIX allows users to specify a custom
suffix to be appended to the names of Autoscoper artifacts, aiding in the
unique identification of artifacts based on selected build options.

This is done anticipating the support for packaging multiple backend-specific
versions of Autoscoper in SlicerAutoscoperM.
  • Loading branch information
jcfr committed Dec 13, 2023
1 parent e14b2da commit d476e2c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ if(Autoscoper_RENDERING_BACKEND STREQUAL "OpenCL")
message(STATUS "Setting Autoscoper_OPENCL_USE_ICD_LOADER to ${Autoscoper_OPENCL_USE_ICD_LOADER}")
endif()

set(Autoscoper_ARTIFACT_SUFFIX "" CACHE STRING "Suffix for Autoscoper artifact names")
mark_as_advanced(Autoscoper_ARTIFACT_SUFFIX)
mark_as_superbuild(Autoscoper_ARTIFACT_SUFFIX)
message(STATUS "Setting Autoscoper_ARTIFACT_SUFFIX to '${Autoscoper_ARTIFACT_SUFFIX}'")

#-----------------------------------------------------------------------------
# Set a default build type if none was specified
#-----------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions autoscoper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ if(Autoscoper_CONFIGURE_LAUCHER_SCRIPT AND CMAKE_VERSION VERSION_LESS "3.20" AND
)
endif()

set_target_properties(autoscoper PROPERTIES
OUTPUT_NAME "autoscoper${Autoscoper_ARTIFACT_SUFFIX}"
)

set_target_properties(autoscoper PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${Autoscoper_BIN_DIR}"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${Autoscoper_BIN_DIR}"
Expand Down
6 changes: 6 additions & 0 deletions libautoscoper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ target_compile_definitions(libautoscoper PUBLIC
Autoscoper_RENDERING_USE_${Autoscoper_RENDERING_BACKEND}_BACKEND
)

set_target_properties(libautoscoper PROPERTIES
RUNTIME_OUTPUT_NAME "libautoscoper${Autoscoper_ARTIFACT_SUFFIX}"
LIBRARY_OUTPUT_NAME "libautoscoper${Autoscoper_ARTIFACT_SUFFIX}"
ARCHIVE_OUTPUT_NAME "libautoscoper${Autoscoper_ARTIFACT_SUFFIX}"
)

set_target_properties(libautoscoper PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${Autoscoper_BIN_DIR}"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${Autoscoper_BIN_DIR}"
Expand Down

0 comments on commit d476e2c

Please sign in to comment.