ae45207b29
- Minimum G++ version: 4.8 - Minimum Visual Studio version: VS2012 - Added '-std=c++11' flag to G++ - Removed unused defines - Removed checks for standard library headers - Added CMake detections of '_vsnprintf' and '_snprintf' for Visual Studio 2015 - Removed bnpcap - Force Travis CI to use CMake 3.1.3 and G++5
70 lines
2.1 KiB
CMake
70 lines
2.1 KiB
CMake
# Required cmake version
|
|
cmake_minimum_required(VERSION 3.1.0)
|
|
|
|
# Put the include dirs which are in the source or build tree
|
|
# before all other include dirs, so the headers in the sources
|
|
# are prefered over the already installed ones
|
|
# since cmake 2.4.1
|
|
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
|
|
|
|
project(pvpgn CXX)
|
|
|
|
option(WITH_BNETD "compile the bnetd target" ON)
|
|
option(WITH_D2CS "compile the d2cs target" ON)
|
|
option(WITH_D2DBS "compile the d2dbs target" ON)
|
|
option(WITH_ANSI "enforce strict ISO C++ conforming" ON)
|
|
option(WITH_LUA "enable Lua support" OFF)
|
|
if(WIN32)
|
|
option(WITH_WIN32_GUI "enable GUI building (default on)" ON)
|
|
endif(WIN32)
|
|
|
|
#storage backends flags
|
|
option(WITH_MYSQL "include MySQL user accounts support" OFF)
|
|
option(WITH_SQLITE3 "include SQLite3 user accounts support" OFF)
|
|
option(WITH_PGSQL "include PostgreSQL user accounts support" OFF)
|
|
option(WITH_ODBC "include ODBC user accounts support" OFF)
|
|
include(ConfigureChecks.cmake)
|
|
|
|
|
|
if (CMAKE_COMPILER_IS_GNUCXX)
|
|
# Minimum G++ version: 4.8
|
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
|
|
message(FATAL_ERROR "G++ 4.8 or higher required")
|
|
endif()
|
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pedantic -Wno-variadic-macros")
|
|
|
|
# Pass CXX flags to flags.
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSEQAN_CXX_FLAGS_=\"${CMAKE_CXX_FLAGS}\"")
|
|
endif ()
|
|
|
|
if (MSVC)
|
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0)
|
|
message(FATAL_ERROR "Visual Studio 2012 or higher required")
|
|
endif()
|
|
endif ()
|
|
|
|
subdirs(src conf man files)
|
|
if(WITH_LUA)
|
|
add_subdirectory(lua)
|
|
endif(WITH_LUA)
|
|
|
|
ENABLE_TESTING()
|
|
|
|
# uninstall target
|
|
configure_file(
|
|
"${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in"
|
|
"${CMAKE_MODULE_PATH}/cmake_uninstall.cmake"
|
|
IMMEDIATE @ONLY)
|
|
|
|
add_custom_target(uninstall
|
|
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_MODULE_PATH}/cmake_uninstall.cmake)
|
|
|
|
# purge target
|
|
configure_file(
|
|
"${CMAKE_MODULE_PATH}/cmake_purge.cmake.in"
|
|
"${CMAKE_MODULE_PATH}/cmake_purge.cmake"
|
|
IMMEDIATE @ONLY)
|
|
|
|
add_custom_target(purge
|
|
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_MODULE_PATH}/cmake_purge.cmake)
|