Skip to content

Commit f25859e

Browse files
committed
remove YSTDLIB_CPP_* to ystdlib_* change
1 parent 277dc1d commit f25859e

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

CMake/ystdlib-config.cmake.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ include(CMakeFindDependencyMacro)
66

77
find_dependency(Boost REQUIRED)
88

9-
set_and_check(ystdlib_INCLUDE_DIR "@PACKAGE_ystdlib_INSTALL_INCLUDE_DIR@")
9+
set_and_check(YSTDLIB_CPP_INCLUDE_DIR "@PACKAGE_YSTDLIB_CPP_INSTALL_INCLUDE_DIR@")
1010

11-
check_required_components(ystdlib)
11+
check_required_components(YSTDLIB_CPP)
1212

1313
# Avoid repeatedly including the targets
1414
if(NOT TARGET ystdlib::ystdlib)

CMake/ystdlib-cpp-helpers.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ endfunction()
2828
# Adds a c++20 interface library in the subdirectory NAME with the target NAME and alias
2929
# NAMESPACE::NAME. Libraries with multiple levels of namespace nesting are currently not supported.
3030
#
31-
# If `ystdlib_ENABLE_TESTS` is ON, builds the unit tests specific to the current library, and
31+
# If `YSTDLIB_CPP_ENABLE_TESTS` is ON, builds the unit tests specific to the current library, and
3232
# links this library against the unified unit test target for the entire `ystdlib` project.
3333
#
3434
# @param {string} NAME
@@ -141,7 +141,7 @@ function(cpp_library)
141141
CXX
142142
)
143143

144-
if(ystdlib_ENABLE_TESTS)
144+
if(YSTDLIB_CPP_ENABLE_TESTS)
145145
# Build library-specific unit test target
146146
set(_UNIT_TEST_TARGET "unit-test-${arg_cpp_lib_NAME}")
147147
add_executable(${_UNIT_TEST_TARGET})

CMakeLists.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
cmake_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

77
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
88
include(ystdlib-cpp-helpers)
99
include(CMakePackageConfigHelpers)
1010
include(GNUInstallDirs)
1111

1212
option(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
1616
if("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")
1818
elseif("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")
2020
elseif("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")
2222
else()
2323
message(
2424
FATAL_ERROR
2525
"Unsupported compiler: ${CMAKE_CXX_COMPILER_ID}. Please use AppleClang, Clang, or GNU."
2626
)
2727
endif()
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
)
3434
endif()
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)
5252
endif()
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)
5656
endif()
5757

5858
find_package(Boost REQUIRED)
5959
if(Boost_FOUND)
6060
message(STATUS "Found Boost ${Boost_VERSION}.")
6161
endif()
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)
8585
endif()
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

9090
add_subdirectory(src/ystdlib)
9191

@@ -109,14 +109,14 @@ foreach(install_target_name IN LISTS ystdlib_targets)
109109
endforeach()
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

114114
configure_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

122122
write_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

Comments
 (0)