11cmake_minimum_required (VERSION 3.23)
22
3- set (ystdlib_VERSION "0.0.1" CACHE STRING "Project version." )
3+ set (YSTDLIB_CPP_VERSION "0.0.1" CACHE STRING "Project version." )
44
5- project (ystdlib VERSION "${ystdlib_VERSION } " LANGUAGES CXX)
5+ project (YSTDLIB_CPP VERSION "${YSTDLIB_CPP_VERSION } " LANGUAGES CXX)
66
77list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR} /CMake" )
88include (ystdlib-cpp-helpers)
99include (CMakePackageConfigHelpers)
1010include (GNUInstallDirs)
1111
1212option (BUILD_SHARED_LIBS "Build using shared libraries." OFF )
13- option (ystdlib_BUILD_TESTING "Build the testing tree for ystdlib-cpp." ON )
13+ option (YSTDLIB_CPP_BUILD_TESTING "Build the testing tree for ystdlib-cpp." ON )
1414
1515# Require compiler versions that support the C++20 features necessary for compiling ystdlib-cpp
1616if ("AppleClang" STREQUAL "${CMAKE_CXX_COMPILER_ID} " )
17- set (ystdlib_CMAKE_CXX_COMPILER_MIN_VERSION "16" )
17+ set (YSTDLIB_CPP_CMAKE_CXX_COMPILER_MIN_VERSION "16" )
1818elseif ("Clang" STREQUAL "${CMAKE_CXX_COMPILER_ID} " )
19- set (ystdlib_CMAKE_CXX_COMPILER_MIN_VERSION "16" )
19+ set (YSTDLIB_CPP_CMAKE_CXX_COMPILER_MIN_VERSION "16" )
2020elseif ("GNU" STREQUAL "${CMAKE_CXX_COMPILER_ID} " )
21- set (ystdlib_CMAKE_CXX_COMPILER_MIN_VERSION "11" )
21+ set (YSTDLIB_CPP_CMAKE_CXX_COMPILER_MIN_VERSION "11" )
2222else ()
2323 message (
2424 FATAL_ERROR
2525 "Unsupported compiler: ${CMAKE_CXX_COMPILER_ID} . Please use AppleClang, Clang, or GNU."
2626 )
2727endif ()
28- if ("${CMAKE_CXX_COMPILER_VERSION} " VERSION_LESS "${ystdlib_CMAKE_CXX_COMPILER_MIN_VERSION } " )
28+ if ("${CMAKE_CXX_COMPILER_VERSION} " VERSION_LESS "${YSTDLIB_CPP_CMAKE_CXX_COMPILER_MIN_VERSION } " )
2929 message (
3030 FATAL_ERROR
3131 "${CMAKE_CXX_COMPILER_ID} version ${CMAKE_CXX_COMPILER_VERSION} is too low. Must be at \
32- least ${ystdlib_CMAKE_CXX_COMPILER_MIN_VERSION } ."
32+ least ${YSTDLIB_CPP_CMAKE_CXX_COMPILER_MIN_VERSION } ."
3333 )
3434endif ()
3535
@@ -41,7 +41,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS
4141 FORCE
4242)
4343
44- if (ystdlib_IS_TOP_LEVEL )
44+ if (YSTDLIB_CPP_IS_TOP_LEVEL )
4545 # Include dependency settings if the project isn't being included as a subproject.
4646 # NOTE: We mark the file optional because if the user happens to have the dependencies
4747 # installed, this file is not necessary.
@@ -51,16 +51,16 @@ if(ystdlib_IS_TOP_LEVEL)
5151 include (CTest)
5252endif ()
5353
54- if (BUILD_TESTING AND ystdlib_BUILD_TESTING )
55- set (ystdlib_ENABLE_TESTS ON )
54+ if (BUILD_TESTING AND YSTDLIB_CPP_BUILD_TESTING )
55+ set (YSTDLIB_CPP_ENABLE_TESTS ON )
5656endif ()
5757
5858find_package (Boost REQUIRED)
5959if (Boost_FOUND)
6060 message (STATUS "Found Boost ${Boost_VERSION} ." )
6161endif ()
6262
63- if (ystdlib_ENABLE_TESTS )
63+ if (YSTDLIB_CPP_ENABLE_TESTS )
6464 find_package (Catch2 3.8.0 REQUIRED)
6565 if (Catch2_FOUND)
6666 message (STATUS "Found Catch2 ${Catch2_VERSION} ." )
@@ -84,8 +84,8 @@ if(ystdlib_ENABLE_TESTS)
8484 catch_discover_tests(${UNIFIED_UNIT_TEST_TARGET} WORKING_DIRECTORY ${CMAKE_BINARY_DIR} /testbin)
8585endif ()
8686
87- set (ystdlib_INSTALL_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR} /cmake/ystdlib)
88- set (ystdlib_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR} )
87+ set (YSTDLIB_CPP_INSTALL_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR} /cmake/ystdlib)
88+ set (YSTDLIB_CPP_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR} )
8989
9090add_subdirectory (src/ystdlib)
9191
@@ -109,14 +109,14 @@ foreach(install_target_name IN LISTS ystdlib_targets)
109109endforeach ()
110110
111111
112- install (EXPORT ystdlib-targets NAMESPACE ystdlib:: DESTINATION ${ystdlib_INSTALL_CONFIG_DIR } )
112+ install (EXPORT ystdlib-targets NAMESPACE ystdlib:: DESTINATION ${YSTDLIB_CPP_INSTALL_CONFIG_DIR } )
113113
114114configure_package_config_file(
115115 ${CMAKE_CURRENT_LIST_DIR} /CMake/ystdlib-config.cmake.in
116116 ${CMAKE_CURRENT_BINARY_DIR} /ystdlib-config.cmake
117- INSTALL_DESTINATION ${ystdlib_INSTALL_CONFIG_DIR }
117+ INSTALL_DESTINATION ${YSTDLIB_CPP_INSTALL_CONFIG_DIR }
118118 PATH_VARS
119- ystdlib_INSTALL_INCLUDE_DIR
119+ YSTDLIB_CPP_INSTALL_INCLUDE_DIR
120120)
121121
122122write_basic_package_version_file(
@@ -128,6 +128,6 @@ install(
128128 FILES
129129 ${CMAKE_CURRENT_BINARY_DIR} /ystdlib-config.cmake
130130 ${CMAKE_CURRENT_BINARY_DIR} /ystdlib-config-version .cmake
131- DESTINATION ${ystdlib_INSTALL_CONFIG_DIR }
131+ DESTINATION ${YSTDLIB_CPP_INSTALL_CONFIG_DIR }
132132)
133133
0 commit comments