diff --git a/CMakeLists.txt b/CMakeLists.txt index 089d5df..6ba65bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,23 +1,19 @@ cmake_minimum_required(VERSION 3.20) -project(stlab-enum-ops VERSION 1.0.0 DESCRIPTION "Type-safe operators for enums" LANGUAGES CXX) -# Setup cpp-library infrastructure -set(CPM_SOURCE_CACHE ${CMAKE_SOURCE_DIR}/.cpm-cache CACHE PATH "CPM cache" FORCE) +# Project declaration - cpp_library_setup will use this name and detect version from git tags +project(stlab-enum-ops) + +set(CPM_SOURCE_CACHE ${CMAKE_SOURCE_DIR}/.cpm-cache CACHE PATH "CPM cache") include(cmake/CPM.cmake) -# Fetch cpp-library via CPM (using local path for development) -CPMAddPackage( - URI "gh:stlab/cpp-library@1.1.2" - DOWNLOAD_ONLY YES -) -include(${cpp-library_SOURCE_DIR}/cpp-library.cmake) +# Fetch cpp-library via CPM +CPMAddPackage("gh:stlab/cpp-library@3.0.0") +include(${cpp-library_SOURCE_DIR}/cpp-library.cmake) -# Configure library (handles both lightweight and full modes automatically) +# Let cpp-library handle the project declaration and version detection cpp_library_setup( - NAME stlab-enum-ops - VERSION ${PROJECT_VERSION} - DESCRIPTION "${PROJECT_DESCRIPTION}" + DESCRIPTION "Type-safe operators for enums" NAMESPACE stlab HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/stlab/enum_ops.hpp EXAMPLES enum_ops_example enum_ops_example_fail