Advertisement
Guest User

CMakeLists.txt

a guest
Nov 5th, 2011
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.94 KB | None | 0 0
  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.torproject.org/projects/vidalia.html. No part of Vidalia,
  9. ## including this file, may be copied, modified, propagated, or distributed
  10. ## except according to the terms described in the LICENSE file.
  11. ##
  12.  
  13.  
  14. set(VER_MAJOR "0")
  15. set(VER_MINOR "2")
  16. set(VER_PATCH "15")
  17. set(VERSION "${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}")
  18. message(STATUS "Configuring Vidalia ${VERSION}")
  19. project(Vidalia)
  20.  
  21. ## Specify the minimim required CMake version
  22. cmake_minimum_required(VERSION 2.4.7)
  23. if (COMMAND cmake_policy)
  24. # Force CMake 2.4 compatibility for handling linker search paths
  25. cmake_policy(SET CMP0003 OLD)
  26. endif(COMMAND cmake_policy)
  27.  
  28. ## We declare this option here, because it determines the minimum
  29. ## required Qt version
  30. option(USE_MARBLE "Enable the KDE Marble-based map widget." OFF)
  31.  
  32. ## Specify the minimum version of Qt required
  33. set(QT_MIN_VERSION "4.3.0")
  34.  
  35. ## Specify the Qt libraries used
  36. include(FindQt4)
  37. find_package(Qt4 REQUIRED)
  38. set(QT_USE_QTNETWORK true)
  39. set(QT_USE_QTXML true)
  40. if (USE_MARBLE)
  41. set(QT_USE_QTSVG true)
  42. set(QT_USE_QTWEBKIT true)
  43. set(QT_USE_QTSCRIPT true)
  44. set(QT_USE_QTDBUS true)
  45. endif(USE_MARBLE)
  46. include(${QT_USE_FILE})
  47. include(${CMAKE_SOURCE_DIR}/cmake/VidaliaMacros.cmake)
  48. include(CheckIncludeFile)
  49. include(CheckIncludeFileCXX)
  50. include(CheckTypeSize)
  51. include(CheckFunctionExists)
  52. if (WIN32)
  53. include(${CMAKE_SOURCE_DIR}/cmake/FindWiX.cmake)
  54. endif(WIN32)
  55. if (MSVC)
  56. include(${CMAKE_SOURCE_DIR}/cmake/FindOpenSSL.cmake)
  57. endif(MSVC)
  58.  
  59. if(MSVC_IDE)
  60. set(CMAKE_SUPPRESS_REGENERATION TRUE)
  61. set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
  62. set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
  63. endif(MSVC_IDE)
  64.  
  65. ## Define Vidalia-specific CMake options
  66. if (APPLE)
  67. option(OSX_TIGER_COMPAT "Build an OS X 10.4 Compatible Vidalia." OFF)
  68. if (OSX_TIGER_COMPAT)
  69. set(CMAKE_EXE_LINKER_FLAGS "-mmacosx-version-min=10.4"
  70. CACHE STRING "Flags used by the linker." FORCE)
  71. set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk"
  72. CACHE STRING "isysroot used for universal binary support" FORCE)
  73. endif(OSX_TIGER_COMPAT)
  74.  
  75. option(OSX_FAT_BINARY "Build Vidalia as a Universal binary." OFF)
  76. if (OSX_FAT_BINARY)
  77. set(CMAKE_OSX_ARCHITECTURES "ppc;i386"
  78. CACHE STRING "OS X build architectures" FORCE)
  79. set(CMAKE_EXE_LINKER_FLAGS "-mmacosx-version-min=10.4"
  80. CACHE STRING "Flags used by the linker." FORCE)
  81. set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.4u.sdk"
  82. CACHE STRING "isysroot used for universal binary support" FORCE)
  83. endif(OSX_FAT_BINARY)
  84.  
  85. option(OSX_FORCE_32BIT "Force a 32-bit build for compatibility." OFF)
  86. if (OSX_FORCE_32BIT)
  87. add_definitions(-m32)
  88. set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32"
  89. CACHE STRING "Flags used by the linker." FORCE)
  90. endif(OSX_FORCE_32BIT)
  91. endif(APPLE)
  92.  
  93. ## Define if compiled with Windows 2k support
  94. option(WIN2K "Enable Windows 2k support." OFF)
  95.  
  96. ## UPnP support is currently optional (enabled by default)
  97. option(USE_MINIUPNPC "Enable UPnP support using the MiniUPnPc library." ON)
  98.  
  99. ## Crash reporting via Google Breakpad is optional (disabled by default)
  100. option(USE_BREAKPAD "Enable Google Breakpad crash reporting." OFF)
  101. if (USE_BREAKPAD)
  102. include(${CMAKE_SOURCE_DIR}/cmake/FindBreakpad.cmake)
  103. endif(USE_BREAKPAD)
  104.  
  105. ## Automatic software update is optional (disabled by default)
  106. if (WIN32)
  107. option(USE_AUTOUPDATE "Enable automatic software update support." OFF)
  108. endif(WIN32)
  109.  
  110. ## Find the KDE Marble library
  111. if (USE_MARBLE)
  112. include(${CMAKE_SOURCE_DIR}/cmake/FindMarble.cmake)
  113. endif(USE_MARBLE)
  114.  
  115. ## Find the MaxMind GeoIP library
  116. option(USE_GEOIP "Enable GeoIP lookups via a local MaxMind database" OFF)
  117. if (USE_GEOIP)
  118. include(${CMAKE_SOURCE_DIR}/cmake/FindGeoIP.cmake)
  119. endif(USE_GEOIP)
  120.  
  121. ## Check for system header files
  122. check_include_file("limits.h" HAVE_LIMITS_H)
  123. check_include_file("sys/limits.h" HAVE_SYS_LIMITS_H)
  124. check_include_file("signal.h" HAVE_SIGNAL_H)
  125.  
  126. ## Check for the sizes of various data types
  127. check_type_size(int SIZEOF_INT)
  128.  
  129. ## Check for the existence of some platform-specific functions
  130. if (HAVE_SIGNAL_H)
  131. set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} "signal.h")
  132. check_function_exists(sigaction HAVE_SIGACTION)
  133. check_function_exists(signal HAVE_SIGNAL)
  134. endif(HAVE_SIGNAL_H)
  135.  
  136. ## Write out a configuration file
  137. configure_file(
  138. ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
  139. ${CMAKE_CURRENT_BINARY_DIR}/config.h
  140. )
  141. include_directories(${CMAKE_CURRENT_BINARY_DIR})
  142.  
  143. ## Add the actual source directories
  144. add_subdirectory(src)
  145. add_subdirectory(doc)
  146. add_subdirectory(pkg)
  147.  
  148.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement