Skip to content

Commit

Permalink
Setting CMAKE_OSX_DEPLOYMENT_TARGET as cache entry (#9498)
Browse files Browse the repository at this point in the history
  • Loading branch information
franramirez688 committed Aug 30, 2021
1 parent 7c4c9ce commit 20dcffc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion conan/tools/cmake/toolchain.py
Expand Up @@ -319,7 +319,8 @@ class AppleSystemBlock(Block):
# but full path is necessary for others
set(CMAKE_OSX_SYSROOT {{ CMAKE_OSX_SYSROOT }} CACHE STRING "" FORCE)
{% if CMAKE_OSX_DEPLOYMENT_TARGET is defined %}
set(CMAKE_OSX_DEPLOYMENT_TARGET {{ CMAKE_OSX_DEPLOYMENT_TARGET }})
# Setting CMAKE_OSX_DEPLOYMENT_TARGET if "os.version" is defined by the used conan profile
set(CMAKE_OSX_DEPLOYMENT_TARGET "{{ CMAKE_OSX_DEPLOYMENT_TARGET }}" CACHE STRING "")
{% endif %}
""")

Expand Down
2 changes: 1 addition & 1 deletion conans/test/unittests/tools/cmake/test_cmaketoolchain.py
Expand Up @@ -164,4 +164,4 @@ def conanfile_apple():
def test_osx_deployment_target(conanfile_apple):
toolchain = CMakeToolchain(conanfile_apple)
content = toolchain.content
assert 'set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)' in content
assert 'set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "")' in content

0 comments on commit 20dcffc

Please sign in to comment.