diff options
author | David Ameiss <netshark@ameissnet.com> | 2014-11-10 14:24:18 -0600 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2014-11-10 22:03:26 +0000 |
commit | afae2b64e2aab4d63ccef3c652507e747594ea93 (patch) | |
tree | 4f237286a5d8828abcb58c62b2650fb38729026e | |
parent | c44ff776c4d270a8ae1d2fea39eae8c0a14d9dd9 (diff) | |
download | wireshark-afae2b64e2aab4d63ccef3c652507e747594ea93.tar.gz |
Allow building under OSX Yosemite using cmake.
CFPropertyListCreateFromStream() has been deprecated in Yosemite, in favor of CFPropertyListCreateWithStream(). The autotools
build checks for the existence of the new function, but the cmake build does not. So, add a check for it to CMakeLists.txt, and
update cmakeconfig.h.in to provide the "template" for HAVE_CFPROPERTYLISTCREATEWITHSTREAM.
Change-Id: I1a4e3e1ce83092ecf7725527b921eeca80b18d4b
Note: CFPropertyListCreateWithStream() works under Mavericks as well.
Reviewed-on: https://code.wireshark.org/review/5226
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
-rw-r--r-- | CMakeLists.txt | 22 | ||||
-rw-r--r-- | ConfigureChecks.cmake | 6 | ||||
-rw-r--r-- | cmakeconfig.h.in | 3 |
3 files changed, 20 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 175e278415..3ca9754f38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -751,6 +751,17 @@ endif() message(STATUS "C-Flags: ${CMAKE_C_FLAGS}") message(STATUS "CXX-Flags: ${CMAKE_CXX_FLAGS}") +if(APPLE) + # + # We assume that APPLE means OS X so that we have the OS X + # frameworks. + # + set(HAVE_OS_X_FRAMEWORKS 1) + FIND_LIBRARY (APPLE_APPLICATION_SERVICES_LIBRARY ApplicationServices) + FIND_LIBRARY (APPLE_CORE_FOUNDATION_LIBRARY CoreFoundation) + FIND_LIBRARY (APPLE_SYSTEM_CONFIGURATION_LIBRARY SystemConfiguration) +endif() + include(ConfigureChecks.cmake) #Big or little endian ? @@ -864,17 +875,6 @@ gmx_test_large_files(GMX_LARGEFILES) add_definitions( -DTOP_SRCDIR=\"${CMAKE_SOURCE_DIR}\" ) -if(APPLE) - # - # We assume that APPLE means OS X so that we have the OS X - # frameworks. - # - set(HAVE_OS_X_FRAMEWORKS 1) - FIND_LIBRARY (APPLE_APPLICATION_SERVICES_LIBRARY ApplicationServices) - FIND_LIBRARY (APPLE_CORE_FOUNDATION_LIBRARY CoreFoundation) - FIND_LIBRARY (APPLE_SYSTEM_CONFIGURATION_LIBRARY SystemConfiguration) -endif() - if(WIN32) set(WS_MSVC_NORETURN "__declspec(noreturn)") diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 010187237c..0919b98514 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -93,6 +93,12 @@ check_function_exists("setresgid" HAVE_SETRESGID) check_function_exists("setresuid" HAVE_SETRESUID) check_function_exists("strptime" HAVE_STRPTIME) check_function_exists("sysconf" HAVE_SYSCONF) +if (APPLE) + cmake_push_check_state() + set(CMAKE_REQUIRED_LIBRARIES ${APPLE_CORE_FOUNDATION_LIBRARY}) + check_function_exists("CFPropertyListCreateWithStream" HAVE_CFPROPERTYLISTCREATEWITHSTREAM) + cmake_pop_check_state() +endif() #Struct members include(CheckStructHasMember) diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in index 326818e086..7f1c91a5c9 100644 --- a/cmakeconfig.h.in +++ b/cmakeconfig.h.in @@ -183,6 +183,9 @@ /* Define to 1 if you have OS X frameworks */ #cmakedefine HAVE_OS_X_FRAMEWORKS 1 +/* Define to 1 if you have the OS X CFPropertyListCreateWithStream function */ +#cmakedefine HAVE_CFPROPERTYLISTCREATEWITHSTREAM 1 + /* Define if pcap_breakloop is known */ #cmakedefine HAVE_PCAP_BREAKLOOP 1 |