From 3b9586671c54622db43dbce01d56c5f1d64a8ca0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 18 Dec 2023 14:12:17 -0500 Subject: CMakePackageConfigHelpers: Clarify Apple platform selection template name The template added by commit 37bc3400cd (CMakePackageConfigHelpers: Add generate_apple_platform_selection_file(), 2023-11-03) is specific to Apple platforms. Give it an Apple-specific name. --- Modules/CMakePackageConfigHelpers.cmake | 2 +- Modules/Internal/ApplePlatformSelection.cmake.in | 24 ++++++++++++++++++++++++ Modules/Internal/PlatformSelectionFile.cmake.in | 24 ------------------------ 3 files changed, 25 insertions(+), 25 deletions(-) create mode 100644 Modules/Internal/ApplePlatformSelection.cmake.in delete mode 100644 Modules/Internal/PlatformSelectionFile.cmake.in diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake index ab38820..ab46d09 100644 --- a/Modules/CMakePackageConfigHelpers.cmake +++ b/Modules/CMakePackageConfigHelpers.cmake @@ -442,7 +442,7 @@ function(generate_apple_platform_selection_file _output_file) endif() endforeach() - configure_package_config_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/Internal/PlatformSelectionFile.cmake.in" "${_output_file}" + configure_package_config_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/Internal/ApplePlatformSelection.cmake.in" "${_output_file}" INSTALL_DESTINATION "${_gpsf_INSTALL_DESTINATION}" NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO diff --git a/Modules/Internal/ApplePlatformSelection.cmake.in b/Modules/Internal/ApplePlatformSelection.cmake.in new file mode 100644 index 0000000..493d650 --- /dev/null +++ b/Modules/Internal/ApplePlatformSelection.cmake.in @@ -0,0 +1,24 @@ +@PACKAGE_INIT@ + +string(TOLOWER "${CMAKE_OSX_SYSROOT}" _CMAKE_OSX_SYSROOT_LOWER) +if(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)iphonesimulator") + @_branch_IOS_SIMULATOR_CONFIG_FILE@ +elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)iphoneos") + @_branch_IOS_CONFIG_FILE@ +elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)appletvsimulator") + @_branch_TVOS_SIMULATOR_CONFIG_FILE@ +elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)appletvos") + @_branch_TVOS_CONFIG_FILE@ +elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)watchsimulator") + @_branch_WATCHOS_SIMULATOR_CONFIG_FILE@ +elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)watchos") + @_branch_WATCHOS_CONFIG_FILE@ +elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)xrsimulator") + @_branch_VISIONOS_SIMULATOR_CONFIG_FILE@ +elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)xros") + @_branch_VISIONOS_CONFIG_FILE@ +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + @_branch_MACOS_CONFIG_FILE@ +else() + message(FATAL_ERROR "Platform not supported") +endif() diff --git a/Modules/Internal/PlatformSelectionFile.cmake.in b/Modules/Internal/PlatformSelectionFile.cmake.in deleted file mode 100644 index 493d650..0000000 --- a/Modules/Internal/PlatformSelectionFile.cmake.in +++ /dev/null @@ -1,24 +0,0 @@ -@PACKAGE_INIT@ - -string(TOLOWER "${CMAKE_OSX_SYSROOT}" _CMAKE_OSX_SYSROOT_LOWER) -if(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)iphonesimulator") - @_branch_IOS_SIMULATOR_CONFIG_FILE@ -elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)iphoneos") - @_branch_IOS_CONFIG_FILE@ -elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)appletvsimulator") - @_branch_TVOS_SIMULATOR_CONFIG_FILE@ -elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)appletvos") - @_branch_TVOS_CONFIG_FILE@ -elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)watchsimulator") - @_branch_WATCHOS_SIMULATOR_CONFIG_FILE@ -elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)watchos") - @_branch_WATCHOS_CONFIG_FILE@ -elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)xrsimulator") - @_branch_VISIONOS_SIMULATOR_CONFIG_FILE@ -elseif(_CMAKE_OSX_SYSROOT_LOWER MATCHES "(^|/)xros") - @_branch_VISIONOS_CONFIG_FILE@ -elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - @_branch_MACOS_CONFIG_FILE@ -else() - message(FATAL_ERROR "Platform not supported") -endif() -- cgit v0.12