root/vidalia/trunk/CMakeLists.txt

Revision 2987, 3.0 kB (checked in by edmanm, 3 days ago)

Bump to 0.1.8.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1##
2##  $Id$
3##
4##  This file is part of Vidalia, and is subject to the license terms in the
5##  LICENSE file, found in the top level directory of this distribution. If
6##  you did not receive the LICENSE file with this file, you may obtain it
7##  from the Vidalia source package distributed by the Vidalia Project at
8##  http://www.vidalia-project.net/. No part of Vidalia, including this file,
9##  may be copied, modified, propagated, or distributed except according to
10##  the terms described in the LICENSE file.
11##
12
13
14set(VER_MAJOR   "0")
15set(VER_MINOR   "1")
16set(VER_PATCH   "8")
17set(VERSION     "${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}")
18message(STATUS  "Configuring Vidalia ${VERSION}")
19project(Vidalia)
20
21## Specify the minimim required CMake version
22cmake_minimum_required(VERSION 2.4.0)
23if (COMMAND cmake_policy)
24  # Force CMake 2.4 compatibility for handling linker search paths
25  cmake_policy(SET CMP0003 OLD)
26endif(COMMAND cmake_policy)
27
28## Require Qt >= 4.2.0
29set(QT_MIN_VERSION    "4.2.0")
30
31## Specify the Qt libraries used
32include(FindQt4)
33find_package(Qt4 REQUIRED)
34set(QT_USE_QTNETWORK  true)
35set(QT_USE_QTXML      true)
36include(${QT_USE_FILE})
37include(${CMAKE_SOURCE_DIR}/cmake/VidaliaMacros.cmake)
38include(CheckIncludeFile)
39include(CheckIncludeFileCXX)
40include(CheckTypeSize)
41include(CPack)
42
43if(MSVC_IDE)
44    set(CMAKE_SUPPRESS_REGENERATION TRUE)
45    set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
46    set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
47endif(MSVC_IDE)
48 
49## Define Vidalia-specific CMake options
50if (APPLE)
51  option(OSX_FAT_BINARY "Build Vidalia as a Universal binary." OFF)
52  if (OSX_FAT_BINARY)
53    set(CMAKE_OSX_ARCHITECTURES "ppc;i386"
54        CACHE STRING "OS X build architectures" FORCE)
55    set(CMAKE_EXE_LINKER_FLAGS "-mmacosx-version-min=10.4"
56        CACHE STRING "Flags used by the linker." FORCE)
57  endif(OSX_FAT_BINARY)
58endif(APPLE)
59
60## Check for QSslSocket
61set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${QT_INCLUDES})
62check_include_file_cxx("qsslsocket.h" HAVE_QSSLSOCKET_H)
63if (HAVE_QSSLSOCKET_H)
64  check_symbol_exists(QT_NO_OPENSSL "QtGlobal" QT_NO_SSL_SUPPORT)
65  if (NOT QT_NO_SSL_SUPPORT)
66    option(USE_QSSLSOCKET "Use Qt's QSslSocket for GeoIP lookups." ON)
67  endif(NOT QT_NO_SSL_SUPPORT)
68endif(HAVE_QSSLSOCKET_H)
69if (USE_QSSLSOCKET)
70  if (MSVC OR UNIX)
71    include(${CMAKE_SOURCE_DIR}/cmake/FindOpenSSL.cmake)
72  endif(MSVC OR UNIX)
73endif(USE_QSSLSOCKET)
74
75## UPnP support is currently optional (enabled by default)
76option(USE_MINIUPNPC "Enable UPnP support using the MiniUPnPc library." ON)
77
78## Check for system header files
79check_include_file("limits.h" HAVE_LIMITS_H)
80check_include_file("sys/limits.h" HAVE_SYS_LIMITS_H)
81
82## Check for the sizes of various data types
83check_type_size(int SIZEOF_INT)
84
85## Write out a configuration file
86configure_file(
87  ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
88  ${CMAKE_CURRENT_BINARY_DIR}/config.h
89)
90include_directories(${CMAKE_CURRENT_BINARY_DIR})
91
92## Add the actual source directories
93add_subdirectory(src)
94add_subdirectory(doc)
95add_subdirectory(pkg)
96
Note: See TracBrowser for help on using the browser.