summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-03-21 13:39:24 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-03-21 13:39:24 (GMT)
commitcd992170db7a85f00d4ad38f78f0b38c33f83d1f (patch)
treeab14ac8e8e9a3cd06669358b9f5829ba7d42ae49 /Source/CPack
parent8da0997872d454062bc50b3d4ff5d2777583202f (diff)
parentd84ba668d7dd77ac38b3795f92e4ef0f894c696e (diff)
downloadCMake-cd992170db7a85f00d4ad38f78f0b38c33f83d1f.zip
CMake-cd992170db7a85f00d4ad38f78f0b38c33f83d1f.tar.gz
CMake-cd992170db7a85f00d4ad38f78f0b38c33f83d1f.tar.bz2
Merge topic 'cpack-osx-optional-CoreServices'
d84ba668 CPack: Avoid using OS X CoreServices if compiler fails on header (#16021)
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 521b395..d6de77d 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -22,10 +22,12 @@
#include <CoreFoundation/CoreFoundation.h>
+#ifdef HAVE_CoreServices
// For the old LocaleStringToLangAndRegionCodes() function, to convert
// to the old Script Manager RegionCode values needed for the 'LPic' data
// structure used for generating multi-lingual SLAs.
#include <CoreServices/CoreServices.h>
+#endif
static const char* SLAHeader =
"data 'LPic' (5000) {\n"
@@ -643,9 +645,11 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
kCFStringEncodingMacRoman);
LangCode lang = 0;
RegionCode region = 0;
+#ifdef HAVE_CoreServices
OSStatus err = LocaleStringToLangAndRegionCodes(iso_language_cstr,
&lang, &region);
if (err != noErr)
+#endif
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
"No language/region code available for " << iso_language_cstr
@@ -653,10 +657,12 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
free(iso_language_cstr);
return 0;
}
+#ifdef HAVE_CoreServices
free(iso_language_cstr);
header_data.push_back(region);
header_data.push_back(i);
header_data.push_back(0);
+#endif
}
ofs << "data 'LPic' (5000) {\n";
ofs << std::hex << std::uppercase << std::setfill('0');