From dbd409d0410dff7f5d4b6bdd7f16d286accf01a5 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 24 Jun 2014 00:07:38 -0700 Subject: [PATCH] Fix OS X CMake build. I have ***NO*** idea why this makes a difference, but, without this change, APPLE_CORE_FOUNDATION_LIBRARY is apparently *not* set correctly for wsutil/CMakeLists.txt, and, with this change, it is. I guess there's something magic involved here with "global" CMake variables or something crazy such as that. Change-Id: I7a0046b9c249568cd666720838104f48e854e203 Reviewed-on: https://code.wireshark.org/review/2612 Reviewed-by: Guy Harris --- Makefile.am | 1 + cmake/modules/FindOS_X_FRAMEWORKS.cmake | 21 +++++++++++++++++++++ wsutil/CMakeLists.txt | 8 ++++++++ 3 files changed, 30 insertions(+) create mode 100644 cmake/modules/FindOS_X_FRAMEWORKS.cmake diff --git a/Makefile.am b/Makefile.am index 6b4d192bf8..741df08e33 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1010,6 +1010,7 @@ EXTRA_DIST = \ cmake/modules/FindLUA.cmake \ cmake/modules/FindLYNX.cmake \ cmake/modules/FindM.cmake \ + cmake/modules/FindOS_X_FRAMEWORKS.cmake \ cmake/modules/FindPCAP.cmake \ cmake/modules/FindPOD.cmake \ cmake/modules/FindPORTAUDIO.cmake \ diff --git a/cmake/modules/FindOS_X_FRAMEWORKS.cmake b/cmake/modules/FindOS_X_FRAMEWORKS.cmake new file mode 100644 index 0000000000..74abccc411 --- /dev/null +++ b/cmake/modules/FindOS_X_FRAMEWORKS.cmake @@ -0,0 +1,21 @@ +# +# - Find OS X frameworks +# Find various OS X frameworks if we're on OS X +# +# APPLE_APPLICATION_SERVICES_LIBRARY - ApplicationServices framework +# APPLE_CORE_FOUNDATION_LIBRARY - CoreFoundation frameowkr +# APPLE_SYSTEM_CONFIGURATION_LIBRARY - SystemConfiguration framework +# HAVE_OS_X_FRAMEWORKS - True if we're on OS X + + +if(APPLE) + # + # We assume that APPLE means OS X so that we have the OS X + # frameworks. + # + set(HAVE_OS_X_FRAMEWORKS 1) + set(OS_X_FRAMEWORKS_FOUND TRUE) + FIND_LIBRARY (APPLE_APPLICATION_SERVICES_LIBRARY ApplicationServices) + FIND_LIBRARY (APPLE_CORE_FOUNDATION_LIBRARY CoreFoundation) + FIND_LIBRARY (APPLE_SYSTEM_CONFIGURATION_LIBRARY SystemConfiguration) +endif() diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt index 2c80a56c17..0157e74785 100644 --- a/wsutil/CMakeLists.txt +++ b/wsutil/CMakeLists.txt @@ -93,6 +93,14 @@ set(WSUTIL_FILES ${WSUTIL_SSE42_FILES} ) +if(APPLE) + # + # We assume that APPLE means OS X so that we have the OS X + # frameworks. + # + FIND_LIBRARY (APPLE_CORE_FOUNDATION_LIBRARY CoreFoundation) +endif() + set(wsutil_LIBS ${APPLE_CORE_FOUNDATION_LIBRARY} ${GMODULE2_LIBRARIES}