Hello,
On 18/03/15 06:08, James Turner wrote:
I’d imagine this is a FAQ, but I’ve Googled without success. Apologies if the
answer is out there.
With Cmake 3.2.1, some behaviour seems to have changed, in the handling of
CMAKE_OSX_DEPLOYMENT_TARGET.
I am trying to build using the 10.9 SDK, but with macosx-min-version set to
10.7 (I need to code-sign on 10.9 for Gatekeeper v2).
Previously I was doing:
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
And this would cause cmake to set:
-mmacosx-version-min=10.7
As of 3.2.1, setting CMAKE_OSX_DEPLOYMENT_TARGET to 10.7 fail (with newest
Xcode) because there is no 10.7 SDK. So I changed my CMake files to do:
SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7”)
This works but unfortunately CMake i.s explicitly setting the flag too, so I
end up with both value in my CXXFLAGS:
-mmacosx-version-min=10.9
-mmacosx-version-min=10.7
What is the correct way to request this now, such that the flag is only
generated once?
As far as I remember if you don't set a SDK CMake tries to use the
min-version as such. So in your case you could try:
-DCMAKE_OSX_SYSROOT=macosx -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7
If you set CMAKE_OSX_SYSROOT to macosx it will use the latest one.
Otherwise you could also specify a version like macosx10.9.
Hope that helps,
Gregor
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake