Browse Source

Build: Move `HAVE_CoreServices` to `cmCPackConfigure.h`

Alex Turbov 3 years ago
parent
commit
98e8b1755b

+ 0 - 1
Source/CMakeLists.txt

@@ -1144,7 +1144,6 @@ if(APPLE)
   # If it does not work, build with reduced functionality and warn.
   check_include_file("CoreServices/CoreServices.h" HAVE_CoreServices)
   if(HAVE_CoreServices)
-    set_property(SOURCE CPack/cmCPackDragNDropGenerator.cxx PROPERTY COMPILE_DEFINITIONS HAVE_CoreServices)
     target_link_libraries(CPackLib PUBLIC "-framework CoreServices")
   else()
     message(WARNING "This compiler does not appear to support\n"

+ 1 - 0
Source/CPack/cmCPackConfigure.h.in

@@ -4,3 +4,4 @@
 
 #cmakedefine01 ENABLE_BUILD_WIX_GENERATOR
 #cmakedefine01 ENABLE_BUILD_FREEBSD_PKG
+#cmakedefine01 HAVE_CoreServices

+ 4 - 3
Source/CPack/cmCPackDragNDropGenerator.cxx

@@ -14,6 +14,7 @@
 #include "cmsys/FStream.hxx"
 #include "cmsys/RegularExpression.hxx"
 
+#include "cmCPackConfigure.h"
 #include "cmCPackGenerator.h"
 #include "cmCPackLog.h"
 #include "cmDuration.h"
@@ -23,7 +24,7 @@
 #include "cmValue.h"
 #include "cmXMLWriter.h"
 
-#ifdef HAVE_CoreServices
+#if 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.
@@ -590,7 +591,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
                            kCFStringEncodingMacRoman);
         LangCode lang = 0;
         RegionCode region = 0;
-#ifdef HAVE_CoreServices
+#if HAVE_CoreServices
         OSStatus err =
           LocaleStringToLangAndRegionCodes(iso_language_cstr, &lang, &region);
         if (err != noErr)
@@ -601,7 +602,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
                           << iso_language_cstr << std::endl);
           return 0;
         }
-#ifdef HAVE_CoreServices
+#if HAVE_CoreServices
         header_data.push_back(region);
         header_data.push_back(i);
         header_data.push_back(0);