diff --git a/conan_provider.cmake b/conan_provider.cmake index cba4606c..e6bb88a7 100644 --- a/conan_provider.cmake +++ b/conan_provider.cmake @@ -50,7 +50,7 @@ function(detect_os OS OS_API_LEVEL OS_SDK OS_SUBSYSTEM OS_VERSION) message(STATUS "CMake-Conan: cmake_osx_sysroot=${CMAKE_OSX_SYSROOT}") set(${OS_SDK} ${_OS_SDK} PARENT_SCOPE) endif() - if(DEFINED CMAKE_OSX_DEPLOYMENT_TARGET) + 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) endif() @@ -620,6 +620,10 @@ set(CONAN_HOST_PROFILE "default;auto-cmake" CACHE STRING "Conan host profile") 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) +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) if(NOT _cmake_program) get_filename_component(PATH_TO_CMAKE_BIN "${CMAKE_COMMAND}" DIRECTORY)