forked from vmangos/core
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup cmake a bit more. (vmangos#2817)
- Loading branch information
Showing
20 changed files
with
212 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
# First, get the root of the repository. | ||
get_filename_component(ROOT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) | ||
get_filename_component(ROOT_DIR "${ROOT_DIR}/.." ABSOLUTE) | ||
|
||
# Set the directory to find dependencies | ||
list(APPEND CMAKE_MODULE_PATH ${ROOT_DIR}/cmake/find) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
# Disable warnings in Visual Studio and add /MP | ||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /MP") | ||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996 /wd4355 /wd4244 /wd4267 /MP") | ||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /MP") | ||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /MP") |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
|
||
# Generic boolean options | ||
option(USE_STD_MALLOC "Use standard malloc instead of TBB" OFF) | ||
option(BUILD_FOR_HOST_CPU "Build specifically for the host CPU via `-march=native` (might not run on different machines)" ON) | ||
option(TBB_DEBUG "Use TBB debug libraries" OFF) | ||
option(USE_SCRIPTS "Compile scripts" ON) | ||
option(USE_EXTRACTORS "Compile extractors" OFF) | ||
option(USE_LIBCURL "Compile with libcurl for email support" OFF) | ||
option(USE_REALMMERGE "Compile helper tool for merging character databases" OFF) | ||
|
||
# Other options | ||
set(SUPPORTED_CLIENT_BUILD "CLIENT_BUILD_1_12_1" CACHE STRING "Client version the core will support") | ||
|
||
if(UNIX) | ||
option(DEBUG_SYMBOLS "Include Debug Symbols" ON) | ||
endif() | ||
|
||
# Precompile headers stuff | ||
find_package(PCHSupport) | ||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16") | ||
option(USE_PCH "Use precompiled headers" ON) | ||
endif() | ||
|
||
# TODO: I have no idea why `USE_PCH_OLD`, is needed if there is `USE_PCH` | ||
if(PCHSupport_FOUND AND (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16")) | ||
if(MSVC) | ||
option(USE_PCH_OLD "Use old precompiled headers implementation" ON) | ||
else() | ||
option(USE_PCH_OLD "Use old precompiled headers implementation" OFF) | ||
endif() | ||
else() | ||
unset(USE_PCH_OLD CACHE) | ||
endif() | ||
|
||
if((${CMAKE_VERSION} VERSION_LESS "3.16") OR USE_PCH_OLD) | ||
if(PCHSupport_FOUND) | ||
if(WIN32) | ||
option(USE_PCH "Use precompiled headers" ON) | ||
else() | ||
option(USE_PCH "Use precompiled headers" OFF) | ||
endif() | ||
endif() | ||
else() | ||
option(USE_PCH "Use precompiled headers" ON) | ||
endif() | ||
|
||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE) | ||
endif() | ||
|
||
|
||
message("") | ||
message(STATUS | ||
"This script builds the vMaNGOS server. | ||
Options that can be used in order to configure the process: | ||
PREFIX Path where the server should be installed to | ||
CMAKE_INSTALL_PREFIX Path where the server should be installed to | ||
USE_PCH Use precompiled headers | ||
USE_PCH_OLD Use precompiled headers | ||
USE_STD_MALLOC Use standard malloc instead of TBB | ||
BUILD_FOR_HOST_CPU Build specifically for the host CPU via `-march=native` (might not run on different machines) | ||
TBB_DEBUG Use TBB debug libraries | ||
USE_SCRIPTS Compile scripts | ||
USE_EXTRACTORS Compile extractors | ||
USE_LIBCURL Compile with libcurl for email support | ||
USE_REALMMERGE Compile helper tool for merging character databases | ||
SUPPORTED_CLIENT_BUILD Client version the core will support | ||
To set an option simply type -D<OPTION>=<VALUE> after 'cmake <srcs>'. | ||
Also, you can specify the generator with -G. see 'cmake --help' for more details | ||
For example: | ||
Build server | ||
cmake -DCMAKE_INSTALL_PREFIX=../opt/vmangos .. | ||
") |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# check what platform we're on 64-bit or 32-bit | ||
if(CMAKE_SIZEOF_VOID_P MATCHES 8) | ||
set(PLATFORM X64) | ||
message(STATUS "Detected 64-bit platform") | ||
IF(WIN32) | ||
ADD_DEFINITIONS("-D_WIN64") | ||
ENDIF() | ||
else() | ||
set(PLATFORM X86) | ||
message(STATUS "Detected 32-bit platform") | ||
endif() | ||
|
||
if(WIN32) | ||
include("${ROOT_DIR}/cmake/platform/win/settings.cmake") | ||
elseif(UNIX) | ||
include("${ROOT_DIR}/cmake/platform/unix/settings.cmake") | ||
endif() |
Oops, something went wrong.