Advertisement
Guest User

reet

a guest
Jul 23rd, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 2.44 KB | None | 0 0
  1. # Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
  2. #
  3. # This file is free software; as a special exception the author gives
  4. # unlimited permission to copy and/or distribute it, with or without
  5. # modifications, as long as this notice is preserved.
  6. #
  7. # This program is distributed in the hope that it will be useful, but
  8. # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
  9. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10.  
  11. # We require CMake >= 3.0
  12. cmake_minimum_required(VERSION 3.0)
  13.  
  14. # Set projectname (must be done AFTER setting configurationtypes)
  15. project(TrinityCore)
  16.  
  17. # CMake policies (can not be handled elsewhere)
  18. cmake_policy(SET CMP0005 OLD)
  19. if(POLICY CMP0043)
  20.   cmake_policy(SET CMP0043 OLD) # Disable 'Ignore COMPILE_DEFINITIONS_<Config> properties'
  21. endif()
  22.  
  23. if(POLICY CMP0054)
  24.   cmake_policy(SET CMP0054 NEW) # Only interpret if() arguments as variables or keywords when unquoted - prevents intepreting if (SOME_STRING_VARIABLE MATCHES "MSVC") as if (SOME_STRING_VARIABLE MATCHES "1")
  25. endif()
  26.  
  27. # add this options before PROJECT keyword
  28. set(CMAKE_DISABLE_SOURCE_CHANGES ON)
  29. set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
  30.  
  31. # Set RPATH-handing (CMake parameters)
  32. set(CMAKE_SKIP_BUILD_RPATH 0)
  33. set(CMAKE_BUILD_WITH_INSTALL_RPATH 0)
  34. set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
  35. set(CMAKE_INSTALL_RPATH_USE_LINK_PATH 1)
  36.  
  37. # set macro-directory
  38. set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/macros")
  39.  
  40. # build in Release-mode by default if not explicitly set
  41. if( NOT CMAKE_BUILD_TYPE )
  42.   set(CMAKE_BUILD_TYPE "Release")
  43. endif()
  44.  
  45. include(CheckCXXSourceRuns)
  46. include(CheckIncludeFiles)
  47. include(ConfigureScripts)
  48.  
  49. # set default buildoptions and print them
  50. include(cmake/options.cmake)
  51.  
  52. # turn off PCH totally if enabled (hidden setting, mainly for devs)
  53. if( NOPCH )
  54.   set(USE_COREPCH 0)
  55.   set(USE_SCRIPTPCH 0)
  56. endif()
  57.  
  58. include(CheckPlatform)
  59.  
  60. include(GroupSources)
  61. include(AutoCollect)
  62.  
  63. find_package(PCHSupport)
  64. find_package(MySQL)
  65.  
  66. if(NOT WITHOUT_GIT)
  67.   find_package(Git)
  68. endif()
  69.  
  70. # Find revision ID and hash of the sourcetree
  71. include(cmake/genrev.cmake)
  72.  
  73. # print out the results before continuing
  74. include(cmake/showoptions.cmake)
  75.  
  76. # add dependencies
  77. add_subdirectory(dep)
  78.  
  79. # add core sources
  80. add_subdirectory(src)
  81.  
  82. find_package(Boost 1.36.0)
  83. if(Boost_FOUND)
  84.   include_directories(${Boost_INCLUDE_DIRS})
  85.   add_executable(foo foo.cc)
  86. endif()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement