Skip to content

Commit

Permalink
WIP: Create ANTSConfig.cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
dzenanz committed Jan 16, 2024
1 parent 62550fc commit e587cc1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ANTS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,18 @@ if(BUILD_SHARED_LIBS AND ((NOT USE_SYSTEM_ITK) OR ((NOT USE_SYSTEM_VTK) AND USE_
install(DIRECTORY ${CMAKE_BINARY_DIR}/../staging/${CMAKE_INSTALL_LIBDIR}/
DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()

export(TARGETS ${ANTSTargets} FILE "${CMAKE_CURRENT_BINARY_DIR}/ANTS-targets.cmake")

install(EXPORT antsTargets
FILE antsTargets.cmake
DESTINATION lib/cmake/ANTS)

include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"ANTSConfigVersion.cmake"
VERSION ${CPACK_PACKAGE_VERSION}
COMPATIBILITY AnyNewerVersion)

install(FILES "ANTSConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/ANTSConfigVersion.cmake"
DESTINATION lib/cmake/ANTS)
3 changes: 3 additions & 0 deletions Examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ install(TARGETS antsUtilities
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT DEVELOPMENT_antsUtilities
)
set(ANTSTargets antsUtilities)

macro(STATIC_ANTS_BUILD ANTS_FUNCTION_NAME EXTRA_LIBS)
set( ANTS_FUNCTION_NAME ${ANTS_FUNCTION_NAME} )
Expand All @@ -31,6 +32,7 @@ macro(STATIC_ANTS_BUILD ANTS_FUNCTION_NAME EXTRA_LIBS)
message(STATUS "${ANTS_FUNCTION_NAME} ${EXTRA_LIBS}")
target_link_libraries(l_${ANTS_FUNCTION_NAME} antsUtilities ${EXTRA_LIBS} )
configure_file( template_for_executables.cxx.in cli_${ANTS_FUNCTION_NAME}.cxx )
list(APPEND ANTSTargets l_${ANTS_FUNCTION_NAME})

if (ANTS_INSTALL_LIBS_ONLY)
install(TARGETS l_${ANTS_FUNCTION_NAME}
Expand Down Expand Up @@ -65,6 +67,7 @@ macro(DYNAMIC_ANTS_BUILD ANTS_FUNCTION_NAME EXTRA_LIBS)
message(STATUS "${ANTS_FUNCTION_NAME} ${EXTRA_LIBS}")
target_link_libraries(l_${ANTS_FUNCTION_NAME} antsUtilities ${EXTRA_LIBS} )
configure_file( template_for_executables.cxx.in cli_${ANTS_FUNCTION_NAME}.cxx )
list(APPEND ANTSTargets l_${ANTS_FUNCTION_NAME})

if (ANTS_INSTALL_LIBS_ONLY)
install(TARGETS l_${ANTS_FUNCTION_NAME}
Expand Down

0 comments on commit e587cc1

Please sign in to comment.