[Cmake-commits] CMake branch, next, updated. v3.5.0-521-g7a56d86

Brad King brad.king at kitware.com
Fri Mar 18 09:51:05 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  7a56d861f71e5d929a48f477657b70c6cad16159 (commit)
       via  32d1dc83abc6e3ea0d2299373b2bd3d1499fcb38 (commit)
      from  be7c99fb365692e332f6524139e3ea4b2d16d280 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7a56d861f71e5d929a48f477657b70c6cad16159
commit 7a56d861f71e5d929a48f477657b70c6cad16159
Merge: be7c99f 32d1dc8
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 18 09:51:03 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Mar 18 09:51:03 2016 -0400

    Merge topic 'cpack-osx-optional-CoreServices' into next
    
    32d1dc83 CPack: Avoid using OS X CoreServices if compiler fails on header (#16021)


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=32d1dc83abc6e3ea0d2299373b2bd3d1499fcb38
commit 32d1dc83abc6e3ea0d2299373b2bd3d1499fcb38
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 18 08:49:02 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Mar 18 08:55:22 2016 -0400

    CPack: Avoid using OS X CoreServices if compiler fails on header (#16021)
    
    Some compilers on OS X report errors in the CoreServices framework headers.
    Check for support of the header ahead of time and compile the relevant code
    only when the header is available.

diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 5b67a2d..eaad702 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -722,6 +722,10 @@ if(APPLE)
     CPack/cmCPackOSXX11Generator.cxx
     CPack/cmCPackPackageMakerGenerator.cxx
     )
+  check_include_file("CoreServices/CoreServices.h" HAVE_CoreServices)
+  if(HAVE_CoreServices)
+    set_property(SOURCE CPack/cmCPackDragNDropGenerator.cxx PROPERTY COMPILE_DEFINITIONS HAVE_CoreServices)
+  endif()
 endif()
 
 # Build CPackLib
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 521b395..8009204 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;
+#if 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;
           }
+#if 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');

-----------------------------------------------------------------------

Summary of changes:
 Source/CMakeLists.txt                      |    4 ++++
 Source/CPack/cmCPackDragNDropGenerator.cxx |    6 ++++++
 2 files changed, 10 insertions(+)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list