-include(CheckCXXCompilerFlag)
-check_cxx_compiler_flag(-Wall Wall)
-if(Wall)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
-endif(Wall)
-check_cxx_compiler_flag(-Wextra Wextra)
-if(Wextra)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
-endif(Wextra)
-check_cxx_compiler_flag(-ansi ansi)
-if(ansi)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ansi")
-endif(ansi)
-
-set(QT_MIN_VERSION "4.4.0")
-
-# By default, we build all binaries
-if(NOT DEFINED BUILD)
- set(BUILD all)
-endif(NOT DEFINED BUILD)
-
-# User might define which binaries to build by invoking cmake -DBUILD=<string>,
-# where <string> might contain any combination of "core", "client", "mono" or "all"
-if(BUILD MATCHES all)
- set(BUILD_CORE true)
- set(BUILD_QTCLIENT true)
- set(BUILD_MONO true)
- message(STATUS "Building Quassel Client, Quassel Core and monolithic Quassel.")
-else(BUILD MATCHES all)
- if(BUILD MATCHES core)
- set(BUILD_CORE true)
- message(STATUS "Building Quassel Core")
- endif(BUILD MATCHES core)
- if(BUILD MATCHES client)
- set(BUILD_QTCLIENT true)
- message(STATUS "Building Quassel Client")
- endif(BUILD MATCHES client)
- if(BUILD MATCHES mono)
- set(BUILD_MONO true)
- message(STATUS "Building monolithic Quassel")
- endif(BUILD MATCHES mono)
-endif(BUILD MATCHES all)
+if(CMAKE_COMPILER_IS_GNUCXX)
+ include(CheckCXXCompilerFlag)
+ check_cxx_compiler_flag(-Wall HAVE_WALL)
+ if(HAVE_WALL)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+ endif(HAVE_WALL)
+ check_cxx_compiler_flag(-Wextra HAVE_WEXTRA)
+ if(HAVE_WEXTRA)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
+ endif(HAVE_WEXTRA)
+ check_cxx_compiler_flag(-ansi HAVE_ANSI)
+ if(HAVE_ANSI)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ansi")
+ endif(HAVE_ANSI)
+endif(CMAKE_COMPILER_IS_GNUCXX)
+
+set(QT_MIN_VERSION "4.3.0")
+
+if(APPLE AND DEPLOY)
+ set(CMAKE_OSX_ARCHITECTURES "i386;ppc")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.4")
+ set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk/")
+endif(APPLE AND DEPLOY)