Add modern CMake package configuration with target exports #199
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Modernize CMake setup to support
find_package(SciTokens)for downstream projects. Addresses request from xrootd integration discussion.Changes
CMake Package Configuration
SciTokensConfig.cmake.intemplate with automatic dependency resolutionSciTokensConfigVersion.cmakewith SameMajorVersion compatibilitySciTokens::SciTokensnamespaced target viaSciTokensTargets.cmake${CMAKE_INSTALL_LIBDIR}/cmake/SciTokens/CMakeLists.txt Updates
SciTokens::SciTokensALIAS target for in-tree usageCMakePackageConfigHelpersfor config file generationRPM Packaging
%{_libdir}/cmake/SciTokens/to -devel packageUsage
Downstream projects can now use modern CMake patterns:
The namespaced target automatically handles include directories, C++11 requirements, and transitive dependencies (OpenSSL, CURL, SQLite3, UUID).
Version Management
Version is defined once in
project(scitokens-cpp VERSION 1.3.0)and automatically exported to version file viawrite_basic_package_version_file(). No manual version file maintenance required.Backward Compatibility
All existing installation paths, headers, and library names unchanged. Legacy variables (
SCITOKENS_LIBRARIES,SCITOKENS_INCLUDE_DIRS) still defined for compatibility. No breaking changes.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.