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>
This commit is contained in:
David Ameiss 2014-11-10 14:24:18 -06:00 committed by Stig Bjørlykke
parent c44ff776c4
commit afae2b64e2
3 changed files with 20 additions and 11 deletions

View File

@ -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)")

View File

@ -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)

View File

@ -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