Skip to content

Commit

Permalink
Provide an export set, should address #108
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-rifkin committed Dec 4, 2024
1 parent a734656 commit 2f5b014
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmake/InstallRules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ install(
COMPONENT ${package_name}-development
)

if(LIBASSERT_PROVIDE_EXPORT_SET)
export(
TARGETS ${target_name}
NAMESPACE libassert::
FILE "${PROJECT_BINARY_DIR}/${package_name}-targets.cmake"
)
endif()

# support packaging library
if(PROJECT_IS_TOP_LEVEL)
include(CPack)
Expand Down
5 changes: 5 additions & 0 deletions cmake/OptionVariables.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ option(
)
option(LIBASSERT_USE_EXTERNAL_MAGIC_ENUM "Obtain magic_enum via find_package instead of FetchContent" OFF)

option(LIBASSERT_PROVIDE_EXPORT_SET "" ON)
mark_as_advanced(
LIBASSERT_PROVIDE_EXPORT_SET
)

# -- internal --

set(LIBASSERT_DESIRED_CXX_STANDARD cxx_std_17 CACHE STRING "")
Expand Down

0 comments on commit 2f5b014

Please sign in to comment.