Skip to content

Commit

Permalink
Merge pull request #56 from SeverinDiederichs/export_targets_for_Fetc…
Browse files Browse the repository at this point in the history
…hContent

Add export targets for FetchContent
  • Loading branch information
SeverinDiederichs authored Mar 3, 2025
1 parent 0d721bb commit d8102ab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,11 @@ install(
${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake
)

if(NOT PROJECT_IS_TOP_LEVEL)
# Export all targets for FetchContent builds
export(
EXPORT ${PROJECT_NAME}Targets
FILE "${CMAKE_BINARY_DIR}/${PROJECT_NAME}Targets.cmake"
)
endif()

0 comments on commit d8102ab

Please sign in to comment.