summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-08-03 23:39:05 -0700
committerGuy Harris <guy@alum.mit.edu>2014-08-04 06:39:49 +0000
commitda5dd1830298248e6ae7a3c3d1b1184170d4d9b5 (patch)
tree3014cfa6114713be2e68e8b5997539103e26cadb /CMakeLists.txt
parent0294b29527d7bb6315cb1097c47e57a362803495 (diff)
downloadwireshark-da5dd1830298248e6ae7a3c3d1b1184170d4d9b5.tar.gz
CMake 2.8+ supports CMAKE_OSX_DEPLOYMENT_TARGET; don't do that stuff ourselves.
Do, however, do the "for a target of 10.4 or 10.5, build 32-bit only" stuff, as that's specific to programs that capture traffic, such as Wireshark (well, I guess we could just limit it to dumpcap, but...). Change-Id: I5f4d4d57fd126e5c295dedae9ed13b263035a911 Reviewed-on: https://code.wireshark.org/review/3403 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt42
1 files changed, 7 insertions, 35 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a3165d0b3..2163db3692 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -196,43 +196,15 @@ if( CMAKE_C_COMPILER_ID MATCHES "MSVC")
${WARNINGS_CFLAGS}
)
else()
- if(OSX_DEPLOY_TARGET)
+ if(CMAKE_OSX_DEPLOYMENT_TARGET)
if(APPLE)
- if(${OSX_DEPLOY_TARGET} STREQUAL "10.0")
+ if(${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.0")
message(FATAL_ERROR "We don't support building for OS X 10.0")
- elseif(${OSX_DEPLOY_TARGET} STREQUAL "10.1")
+ elseif(${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.1")
message(FATAL_ERROR "We don't support building for OS X 10.1")
- elseif(${OSX_DEPLOY_TARGET} STREQUAL "10.2")
+ elseif(${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.2")
message(FATAL_ERROR "We don't support building for OS X 10.2")
- elseif(${OSX_DEPLOY_TARGET} STREQUAL "10.3")
- # XXX - never tested.
- set(SDKPATH "/Developer/SDKs/MacOSX10.3.9.sdk")
- else()
- find_file(SDKPATH
- MacOSX${OSX_DEPLOY_TARGET}.sdk
- PATHS
- /Developer/SDKs
- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
- /Library/Developer/CommandLineTools/SDKs
- NO_DEFAULT_PATH
- )
- if(R{SDKPATH} STREQUAL "SDKPATH-NOTFOUND")
- message(FATAL_ERROR "We couldn't find the SDK for OS X ${OSX_DEPLOY_TARGET}")
- endif()
- endif()
- #
- # Add a -mmacosx-version-min flag to force tests
- # that use the compiler, as well as the build
- # itself, not to, for example, use compiler or
- # linker features not supported by the minimum
- # targeted version of the OS.
- #
- # Add an -isysroot flag to use the SDK.
- #
- set(CMAKE_C_FLAGS "-mmacosx-version-min=${OSX_DEPLOY_TARGET} -isysroot ${SDKPATH} ${CMAKE_C_FLAGS}")
- set(CMAKE_CXX_FLAGS "-mmacosx-version-min=${OSX_DEPLOY_TARGET} -isysroot ${SDKPATH} ${CMAKE_CXX_FLAGS}")
- set(WS_LINK_FLAGS "-mmacosx-version-min=${OSX_DEPLOY_TARGET} -isysroot ${SDKPATH} ${WS_LINK_FLAGS}")
- if(${OSX_DEPLOY_TARGET} STREQUAL "10.4" OR ${OSX_DEPLOY_TARGET} STREQUAL "10.5")
+ elseif(${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.4" OR ${CMAKE_OSX_DEPLOYMENT_TARGET} STREQUAL "10.5")
#
# Only 32-bit builds are supported. 10.5
# (and 10.4?) had a bug that causes some BPF
@@ -243,9 +215,9 @@ else()
set(CMAKE_CXX_FLAGS "-m32 ${CMAKE_CXX_FLAGS}")
set(WS_LINK_FLAGS "-m32 ${WS_LINK_FLAGS}")
endif()
- message(STATUS "Building for OS X ${OSX_DEPLOY_TARGET}")
+ message(STATUS "Building for OS X ${CMAKE_OSX_DEPLOYMENT_TARGET}")
else()
- message(FATAL_ERROR "OSX_DEPLOY_TARGET only applies when building for OS X")
+ message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET only applies when building for OS X")
endif()
endif()