MantisBT - CMake
View Issue Details
0015816CMakeCPackpublic2015-10-28 07:172016-03-07 09:12
Nicolas François 
Brad King 
normalmajoralways
closedfixed 
AppleMac OS X10.11.1
CMake 3.3.2 
CMake 3.5CMake 3.5 
0015816: When setting CMAKE_OSX_SYSROOT to macosx, CPack fails
On 10.11.1 and building against deployment target 10.9, the CMAKE_OSX_DEPLOYMENT_TARGET must be set to 10.9 and so CMAKE_OSX_SYSROOT to avoid the warning message from CMake.
Setting CMAKE_OSX_SYSROOT to macosx allows to select the latest SDK.
The compilation works and everything is fine.

But CPack fails because of the CPACK_OSX_SYSROOT variable set to CMAKE_OSX_SYSROOT, hence macosx; instead of being set to _CMAKE_OSX_SYSROOT_PATH which is the transformed variable in Darwin-Initialize.cmake.
Still in 3.4.0-rc2
No tags attached.
Issue History
2015-10-28 07:17Nicolas FrançoisNew Issue
2015-10-28 08:24Brad KingNote Added: 0039693
2015-10-28 10:10Nicolas FrançoisNote Added: 0039695
2015-10-28 10:17Brad KingNote Added: 0039696
2015-10-28 10:17Brad KingAssigned To => Brad King
2015-10-28 10:17Brad KingStatusnew => resolved
2015-10-28 10:17Brad KingResolutionopen => fixed
2015-10-28 10:17Brad KingFixed in Version => CMake 3.5
2015-10-28 10:17Brad KingTarget Version => CMake 3.5
2016-03-07 09:12Robert MaynardNote Added: 0040629
2016-03-07 09:12Robert MaynardStatusresolved => closed

Notes
(0039693)
Brad King   
2015-10-28 08:24   
Please try this patch:

diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 5756001..77f854d 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -586,7 +586,7 @@ _cpack_set_default(CPACK_WIX_SIZEOF_VOID_P "${CMAKE_SIZEOF_VOID_P}")
 
 # set sysroot so SDK tools can be used
 if(CMAKE_OSX_SYSROOT)
- _cpack_set_default(CPACK_OSX_SYSROOT "${CMAKE_OSX_SYSROOT}")
+ _cpack_set_default(CPACK_OSX_SYSROOT "${_CMAKE_OSX_SYSROOT_PATH}")
 endif()
 
 if(DEFINED CPACK_COMPONENTS_ALL)
(0039695)
Nicolas François   
2015-10-28 10:10   
This solved the problem, thank you.
(0039696)
Brad King   
2015-10-28 10:17   
Thanks for testing. Applied:

 CPack: Fix CPACK_OSX_SYSROOT with symbolic CMAKE_OSX_SYSROOT
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=63e2af0f [^]
(0040629)
Robert Maynard   
2016-03-07 09:12   
Closing resolved issues that have not been updated in more than 4 months.