Skip to content

Commit

Permalink
Feat: remove the CMAKE_OSX_DEPLOYMENT_TARGET from CACHE after read
Browse files Browse the repository at this point in the history
  • Loading branch information
ErniGH committed Mar 14, 2024
1 parent 9d3e483 commit a433805
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion conan_provider.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ function(detect_os OS OS_API_LEVEL OS_SDK OS_SUBSYSTEM OS_VERSION)
if(DEFINED CONAN_CUSTOM_CMAKE_OSX_DEPLOYMENT_TARGET)
message(STATUS "CMake-Conan: cmake_osx_deployment_target=${CMAKE_OSX_DEPLOYMENT_TARGET}")
set(${OS_VERSION} ${CMAKE_OSX_DEPLOYMENT_TARGET} PARENT_SCOPE)
# Remove the CMAKE_OSX_DEPLOYMENT_TARGET from the CACHE to avoid errors
if($CACHE{CMAKE_OSX_DEPLOYMENT_TARGET})
unset(CMAKE_OSX_DEPLOYMENT_TARGET CACHE)
endif()
endif()
endif()
endif()
Expand Down Expand Up @@ -621,7 +625,7 @@ set(CONAN_BUILD_PROFILE "default" CACHE STRING "Conan build profile")
set(CONAN_INSTALL_ARGS "--build=missing" CACHE STRING "Command line arguments for conan install")

if(DEFINED CMAKE_OSX_DEPLOYMENT_TARGET)
set(CONAN_CUSTOM_CMAKE_OSX_DEPLOYMENT_TARGET CMAKE_OSX_DEPLOYMENT_TARGET)
set(CONAN_CUSTOM_CMAKE_OSX_DEPLOYMENT_TARGET TRUE)
endif ()

find_program(_cmake_program NAMES cmake NO_PACKAGE_ROOT_PATH NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH)
Expand Down

0 comments on commit a433805

Please sign in to comment.