Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:

# CMake linting and formatting
- repo: https://github.com/BlankSpruce/gersemi
rev: 0.22.3
rev: 0.25.1
hooks:
- id: gersemi
name: CMake linting
Expand Down
8 changes: 6 additions & 2 deletions cmake/beman-install-library-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,22 @@ function(beman_install_library name)
set(package_name "${name}")
list(GET name_parts -1 component_name)

include(GNUInstallDirs)

install(
TARGETS "${target_name}"
COMPONENT "${install_component_name}"
EXPORT "${export_name}"
FILE_SET HEADERS
FILE_SET CXX_MODULES
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${package_name}/modules
Comment on lines 69 to +75
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this alway installed?

header, or modules without cmake config packages is NOT useable, or?

)

set_target_properties(
"${target_name}"
PROPERTIES EXPORT_NAME "${component_name}"
)

include(GNUInstallDirs)

# Determine the prefix for project-specific variables
string(TOUPPER "${name}" project_prefix)
string(REPLACE "." "_" project_prefix "${project_prefix}")
Expand Down Expand Up @@ -158,6 +160,8 @@ function(beman_install_library name)
DESTINATION "${package_install_dir}"
NAMESPACE beman::
FILE "${config_targets_file}"
CXX_MODULES_DIRECTORY
cxx-modules
COMPONENT "${install_component_name}"
)
else()
Expand Down
30 changes: 10 additions & 20 deletions cmake/use-fetch-content.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ message(TRACE "BemanExemplar_projectDir=\"${BemanExemplar_projectDir}\"")

message(TRACE "BEMAN_EXEMPLAR_LOCKFILE=\"${BEMAN_EXEMPLAR_LOCKFILE}\"")
file(
REAL_PATH
"${BEMAN_EXEMPLAR_LOCKFILE}"
REAL_PATH "${BEMAN_EXEMPLAR_LOCKFILE}"
BemanExemplar_lockfile
BASE_DIRECTORY "${BemanExemplar_projectDir}"
EXPAND_TILDE
Expand All @@ -38,8 +37,7 @@ function(BemanExemplar_provideDependency method package_name)

# Get the "dependencies" field and store it in BemanExemplar_dependenciesObj
string(
JSON
BemanExemplar_dependenciesObj
JSON BemanExemplar_dependenciesObj
ERROR_VARIABLE BemanExemplar_error
GET "${BemanExemplar_rootObj}"
"dependencies"
Expand All @@ -50,8 +48,7 @@ function(BemanExemplar_provideDependency method package_name)

# Get the length of the libraries array and store it in BemanExemplar_dependenciesObj
string(
JSON
BemanExemplar_numDependencies
JSON BemanExemplar_numDependencies
ERROR_VARIABLE BemanExemplar_error
LENGTH "${BemanExemplar_dependenciesObj}"
)
Expand All @@ -73,8 +70,7 @@ function(BemanExemplar_provideDependency method package_name)
# Get the dependency object at BemanExemplar_index
# and store it in BemanExemplar_depObj
string(
JSON
BemanExemplar_depObj
JSON BemanExemplar_depObj
ERROR_VARIABLE BemanExemplar_error
GET "${BemanExemplar_dependenciesObj}"
"${BemanExemplar_index}"
Expand All @@ -88,8 +84,7 @@ function(BemanExemplar_provideDependency method package_name)

# Get the "name" field and store it in BemanExemplar_name
string(
JSON
BemanExemplar_name
JSON BemanExemplar_name
ERROR_VARIABLE BemanExemplar_error
GET "${BemanExemplar_depObj}"
"name"
Expand All @@ -103,8 +98,7 @@ function(BemanExemplar_provideDependency method package_name)

# Get the "package_name" field and store it in BemanExemplar_pkgName
string(
JSON
BemanExemplar_pkgName
JSON BemanExemplar_pkgName
ERROR_VARIABLE BemanExemplar_error
GET "${BemanExemplar_depObj}"
"package_name"
Expand All @@ -118,8 +112,7 @@ function(BemanExemplar_provideDependency method package_name)

# Get the "git_repository" field and store it in BemanExemplar_repo
string(
JSON
BemanExemplar_repo
JSON BemanExemplar_repo
ERROR_VARIABLE BemanExemplar_error
GET "${BemanExemplar_depObj}"
"git_repository"
Expand All @@ -133,8 +126,7 @@ function(BemanExemplar_provideDependency method package_name)

# Get the "git_tag" field and store it in BemanExemplar_tag
string(
JSON
BemanExemplar_tag
JSON BemanExemplar_tag
ERROR_VARIABLE BemanExemplar_error
GET "${BemanExemplar_depObj}"
"git_tag"
Expand All @@ -149,14 +141,12 @@ function(BemanExemplar_provideDependency method package_name)
if(method STREQUAL "FIND_PACKAGE")
if(package_name STREQUAL BemanExemplar_pkgName)
string(
APPEND
BemanExemplar_debug
APPEND BemanExemplar_debug
"Redirecting find_package calls for ${BemanExemplar_pkgName} "
"to FetchContent logic.\n"
)
string(
APPEND
BemanExemplar_debug
APPEND BemanExemplar_debug
"Fetching ${BemanExemplar_repo} at "
"${BemanExemplar_tag} according to ${BemanExemplar_lockfile}."
)
Expand Down