fixed indentation for cmake files

(cherry picked from commit a46d047f94)
This commit is contained in:
ipriver
2020-06-22 15:27:03 +03:00
committed by Shauren
parent c776218cb5
commit bde36062b7
30 changed files with 195 additions and 195 deletions

View File

@@ -19,12 +19,12 @@ project(TrinityCore)
# CMake policies (can not be handled elsewhere) # CMake policies (can not be handled elsewhere)
cmake_policy(SET CMP0005 NEW) cmake_policy(SET CMP0005 NEW)
if (CMAKE_VERSION VERSION_LESS "3.16.0") if(CMAKE_VERSION VERSION_LESS "3.16.0")
cmake_policy(SET CMP0043 OLD) # Disable 'Ignore COMPILE_DEFINITIONS_<Config> properties' cmake_policy(SET CMP0043 OLD) # Disable 'Ignore COMPILE_DEFINITIONS_<Config> properties'
else() else()
cmake_policy(SET CMP0043 NEW) # Cotire isn't used so set to NEW cmake_policy(SET CMP0043 NEW) # Cotire isn't used so set to NEW
endif() endif()
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") 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")
if(POLICY CMP0074) if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW) # find_package() uses <PackageName>_ROOT variables cmake_policy(SET CMP0074 NEW) # find_package() uses <PackageName>_ROOT variables
@@ -40,9 +40,9 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH 1)
list(APPEND CMAKE_MODULE_PATH list(APPEND CMAKE_MODULE_PATH
"${CMAKE_SOURCE_DIR}/cmake/macros") "${CMAKE_SOURCE_DIR}/cmake/macros")
if (CMAKE_VERSION VERSION_LESS "3.16.0") if(CMAKE_VERSION VERSION_LESS "3.16.0")
list(APPEND CMAKE_MODULE_PATH list(APPEND CMAKE_MODULE_PATH
"${CMAKE_SOURCE_DIR}/dep/cotire/CMake") "${CMAKE_SOURCE_DIR}/dep/cotire/CMake")
endif() endif()
# build in Release-mode by default if not explicitly set # build in Release-mode by default if not explicitly set
@@ -61,7 +61,7 @@ include(ConfigureScripts)
include(cmake/options.cmake) include(cmake/options.cmake)
# turn off PCH totally if enabled (hidden setting, mainly for devs) # turn off PCH totally if enabled (hidden setting, mainly for devs)
if( NOPCH ) if(NOPCH)
set(USE_COREPCH 0) set(USE_COREPCH 0)
set(USE_SCRIPTPCH 0) set(USE_SCRIPTPCH 0)
endif() endif()

View File

@@ -15,8 +15,8 @@
# destinations elsewhere in the CMake buildsystem (commented out on purpose) # destinations elsewhere in the CMake buildsystem (commented out on purpose)
# Override CMAKE_INSTALL_PREFIX on Windows platforms # Override CMAKE_INSTALL_PREFIX on Windows platforms
#if( WIN32 ) #if(WIN32)
# if( NOT CYGWIN ) # if(NOT CYGWIN)
# set(CMAKE_INSTALL_PREFIX # set(CMAKE_INSTALL_PREFIX
# "" CACHE PATH "Default install path") # "" CACHE PATH "Default install path")
# endif() # endif()

View File

@@ -108,7 +108,7 @@ target_compile_options(trinity-compile-option-interface
-Wno-narrowing -Wno-narrowing
-Wno-deprecated-register) -Wno-deprecated-register)
if (BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
# -fPIC is needed to allow static linking in shared libs. # -fPIC is needed to allow static linking in shared libs.
# -fvisibility=hidden sets the default visibility to hidden to prevent exporting of all symbols. # -fvisibility=hidden sets the default visibility to hidden to prevent exporting of all symbols.
target_compile_options(trinity-compile-option-interface target_compile_options(trinity-compile-option-interface

View File

@@ -24,7 +24,7 @@ if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
message(STATUS "GCC: SFMT enabled, SSE2 flags forced") message(STATUS "GCC: SFMT enabled, SSE2 flags forced")
endif() endif()
if( WITH_WARNINGS ) if(WITH_WARNINGS)
target_compile_options(trinity-warning-interface target_compile_options(trinity-warning-interface
INTERFACE INTERFACE
-W -W
@@ -42,7 +42,7 @@ if( WITH_WARNINGS )
message(STATUS "GCC: All warnings enabled") message(STATUS "GCC: All warnings enabled")
endif() endif()
if( WITH_COREDEBUG ) if(WITH_COREDEBUG)
target_compile_options(trinity-compile-option-interface target_compile_options(trinity-compile-option-interface
INTERFACE INTERFACE
-g3) -g3)
@@ -68,7 +68,7 @@ if(ASAN)
message(STATUS "GCC: Enabled Address Sanitizer") message(STATUS "GCC: Enabled Address Sanitizer")
endif() endif()
if (BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
target_compile_options(trinity-compile-option-interface target_compile_options(trinity-compile-option-interface
INTERFACE INTERFACE
-fPIC -fPIC

View File

@@ -12,7 +12,7 @@ else()
-xSSE2) -xSSE2)
endif() endif()
if( WITH_WARNINGS ) if(WITH_WARNINGS)
target_compile_options(trinity-warning-interface target_compile_options(trinity-warning-interface
INTERFACE INTERFACE
-w1) -w1)
@@ -20,7 +20,7 @@ if( WITH_WARNINGS )
message(STATUS "ICC: All warnings enabled") message(STATUS "ICC: All warnings enabled")
endif() endif()
if( WITH_COREDEBUG ) if(WITH_COREDEBUG)
target_compile_options(trinity-compile-option-interface target_compile_options(trinity-compile-option-interface
INTERFACE INTERFACE
-g) -g)

View File

@@ -19,7 +19,7 @@ target_compile_definitions(trinity-compile-option-interface
-D__SSE2__) -D__SSE2__)
message(STATUS "GCC: SFMT enabled, SSE2 flags forced") message(STATUS "GCC: SFMT enabled, SSE2 flags forced")
if( WITH_WARNINGS ) if(WITH_WARNINGS)
target_compile_options(trinity-warning-interface target_compile_options(trinity-warning-interface
INTERFACE INTERFACE
-W -W
@@ -33,7 +33,7 @@ if( WITH_WARNINGS )
message(STATUS "GCC: All warnings enabled") message(STATUS "GCC: All warnings enabled")
endif() endif()
if( WITH_COREDEBUG ) if(WITH_COREDEBUG)
target_compile_options(trinity-compile-option-interface target_compile_options(trinity-compile-option-interface
INTERFACE INTERFACE
-g3) -g3)

View File

@@ -129,7 +129,7 @@ if(NOT WITH_WARNINGS)
message(STATUS "MSVC: Disabled generic compiletime warnings") message(STATUS "MSVC: Disabled generic compiletime warnings")
endif() endif()
if (BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
# C4251: needs to have dll-interface to be used by clients of class '...' # C4251: needs to have dll-interface to be used by clients of class '...'
# C4275: non dll-interface class ...' used as base for dll-interface class '...' # C4275: non dll-interface class ...' used as base for dll-interface class '...'
target_compile_options(trinity-compile-option-interface target_compile_options(trinity-compile-option-interface

View File

@@ -36,7 +36,7 @@ function(CollectSourceFiles current_dir variable)
file(GLOB SUB_DIRECTORIES ${current_dir}/*) file(GLOB SUB_DIRECTORIES ${current_dir}/*)
foreach(SUB_DIRECTORY ${SUB_DIRECTORIES}) foreach(SUB_DIRECTORY ${SUB_DIRECTORIES})
if (IS_DIRECTORY ${SUB_DIRECTORY}) if(IS_DIRECTORY ${SUB_DIRECTORY})
CollectSourceFiles("${SUB_DIRECTORY}" "${variable}" "${ARGN}") CollectSourceFiles("${SUB_DIRECTORY}" "${variable}" "${ARGN}")
endif() endif()
endforeach() endforeach()
@@ -62,7 +62,7 @@ function(CollectIncludeDirectories current_dir variable)
list(APPEND ${variable} ${current_dir}) list(APPEND ${variable} ${current_dir})
file(GLOB SUB_DIRECTORIES ${current_dir}/*) file(GLOB SUB_DIRECTORIES ${current_dir}/*)
foreach(SUB_DIRECTORY ${SUB_DIRECTORIES}) foreach(SUB_DIRECTORY ${SUB_DIRECTORIES})
if (IS_DIRECTORY ${SUB_DIRECTORY}) if(IS_DIRECTORY ${SUB_DIRECTORY})
CollectIncludeDirectories("${SUB_DIRECTORY}" "${variable}" "${ARGN}") CollectIncludeDirectories("${SUB_DIRECTORY}" "${variable}" "${ARGN}")
endif() endif()
endforeach() endforeach()

View File

@@ -14,7 +14,7 @@
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" BUILDING_IN_SOURCE) string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" BUILDING_IN_SOURCE)
if( BUILDING_IN_SOURCE ) if(BUILDING_IN_SOURCE)
message(FATAL_ERROR " message(FATAL_ERROR "
This project requires an out of source build. Remove the file 'CMakeCache.txt' This project requires an out of source build. Remove the file 'CMakeCache.txt'
found in this directory before continuing, create a separate build directory found in this directory before continuing, create a separate build directory

View File

@@ -11,10 +11,10 @@
# Returns the base path to the script directory in the source directory # Returns the base path to the script directory in the source directory
function(WarnAboutSpacesInBuildPath) function(WarnAboutSpacesInBuildPath)
# Only check win32 since unix doesn't allow spaces in paths # Only check win32 since unix doesn't allow spaces in paths
if (WIN32) if(WIN32)
string(FIND "${CMAKE_BINARY_DIR}" " " SPACE_INDEX_POS) string(FIND "${CMAKE_BINARY_DIR}" " " SPACE_INDEX_POS)
if (SPACE_INDEX_POS GREATER -1) if(SPACE_INDEX_POS GREATER -1)
message("") message("")
message(WARNING " *** WARNING!\n" message(WARNING " *** WARNING!\n"
" *** Your selected build directory contains spaces!\n" " *** Your selected build directory contains spaces!\n"
@@ -51,7 +51,7 @@ function(GetScriptModuleList variable)
set(${variable}) set(${variable})
foreach(SCRIPT_MODULE ${LOCALE_SCRIPT_MODULE_LIST}) foreach(SCRIPT_MODULE ${LOCALE_SCRIPT_MODULE_LIST})
GetPathToScriptModule(${SCRIPT_MODULE} SCRIPT_MODULE_PATH) GetPathToScriptModule(${SCRIPT_MODULE} SCRIPT_MODULE_PATH)
if (IS_DIRECTORY ${SCRIPT_MODULE_PATH}) if(IS_DIRECTORY ${SCRIPT_MODULE_PATH})
list(APPEND ${variable} ${SCRIPT_MODULE}) list(APPEND ${variable} ${SCRIPT_MODULE})
endif() endif()
endforeach() endforeach()
@@ -76,7 +76,7 @@ function(IsDynamicLinkingRequired variable)
set(IS_REQUIRED OFF) set(IS_REQUIRED OFF)
foreach(SCRIPT_MODULE ${SCRIPT_MODULE_LIST}) foreach(SCRIPT_MODULE ${SCRIPT_MODULE_LIST})
ScriptModuleNameToVariable(${SCRIPT_MODULE} SCRIPT_MODULE_VARIABLE) ScriptModuleNameToVariable(${SCRIPT_MODULE} SCRIPT_MODULE_VARIABLE)
if ((${SCRIPT_MODULE_VARIABLE} STREQUAL "dynamic") OR if((${SCRIPT_MODULE_VARIABLE} STREQUAL "dynamic") OR
(${SCRIPT_MODULE_VARIABLE} STREQUAL "default" AND IS_DEFAULT_VALUE_DYNAMIC)) (${SCRIPT_MODULE_VARIABLE} STREQUAL "default" AND IS_DEFAULT_VALUE_DYNAMIC))
set(IS_REQUIRED ON) set(IS_REQUIRED ON)
break() break()

View File

@@ -11,10 +11,10 @@
# ENSURE_VERSION # ENSURE_VERSION
# This macro compares version numbers of the form "x.y.z" or "x.y" # This macro compares version numbers of the form "x.y.z" or "x.y"
# ENSURE_VERSION( FOO_MIN_VERSION FOO_VERSION_FOUND FOO_VERSION_OK) # ENSURE_VERSION(FOO_MIN_VERSION FOO_VERSION_FOUND FOO_VERSION_OK)
# will set FOO_VERSION_OK to true if FOO_VERSION_FOUND >= FOO_MIN_VERSION # will set FOO_VERSION_OK to true if FOO_VERSION_FOUND >= FOO_MIN_VERSION
# Leading and trailing text is ok, e.g. # Leading and trailing text is ok, e.g.
# ENSURE_VERSION( "2.5.31" "flex 2.5.4a" VERSION_OK) # ENSURE_VERSION("2.5.31" "flex 2.5.4a" VERSION_OK)
# which means 2.5.31 is required and "flex 2.5.4a" is what was found on the system # which means 2.5.31 is required and "flex 2.5.4a" is what was found on the system
# Copyright (c) 2006, David Faure, <faure@kde.org> # Copyright (c) 2006, David Faure, <faure@kde.org>
@@ -29,7 +29,7 @@
# min_version <= found_version < max_version. # min_version <= found_version < max_version.
# If this expression holds, FOO_VERSION_OK will be set TRUE # If this expression holds, FOO_VERSION_OK will be set TRUE
# #
# Example: ENSURE_VERSION_RANGE3( "0.1.0" ${FOOCODE_VERSION} "0.7.0" FOO_VERSION_OK ) # Example: ENSURE_VERSION_RANGE3("0.1.0" ${FOOCODE_VERSION} "0.7.0" FOO_VERSION_OK)
# #
# This macro will break silently if any of x,y,z are greater than 100. # This macro will break silently if any of x,y,z are greater than 100.
# #
@@ -61,55 +61,55 @@
MACRO(NORMALIZE_VERSION _requested_version _normalized_version) MACRO(NORMALIZE_VERSION _requested_version _normalized_version)
STRING(REGEX MATCH "[^0-9]*[0-9]+\\.[0-9]+\\.[0-9]+.*" _threePartMatch "${_requested_version}") STRING(REGEX MATCH "[^0-9]*[0-9]+\\.[0-9]+\\.[0-9]+.*" _threePartMatch "${_requested_version}")
if (_threePartMatch) if(_threePartMatch)
# parse the parts of the version string # parse the parts of the version string
STRING(REGEX REPLACE "[^0-9]*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" _major_vers "${_requested_version}") STRING(REGEX REPLACE "[^0-9]*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" _major_vers "${_requested_version}")
STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" _minor_vers "${_requested_version}") STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" _minor_vers "${_requested_version}")
STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" _patch_vers "${_requested_version}") STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" _patch_vers "${_requested_version}")
else (_threePartMatch) else(_threePartMatch)
STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+" "\\1" _major_vers "${_requested_version}") STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+" "\\1" _major_vers "${_requested_version}")
STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)" "\\1" _minor_vers "${_requested_version}") STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)" "\\1" _minor_vers "${_requested_version}")
set(_patch_vers "0") set(_patch_vers "0")
endif (_threePartMatch) endif(_threePartMatch)
# compute an overall version number which can be compared at once # compute an overall version number which can be compared at once
MATH(EXPR ${_normalized_version} "${_major_vers}*10000 + ${_minor_vers}*100 + ${_patch_vers}") MATH(EXPR ${_normalized_version} "${_major_vers}*10000 + ${_minor_vers}*100 + ${_patch_vers}")
ENDMACRO(NORMALIZE_VERSION) ENDMACRO(NORMALIZE_VERSION)
MACRO(CHECK_RANGE_INCLUSIVE_LOWER _lower_limit _value _upper_limit _ok) MACRO(CHECK_RANGE_INCLUSIVE_LOWER _lower_limit _value _upper_limit _ok)
if (${_value} LESS ${_lower_limit}) if(${_value} LESS ${_lower_limit})
set( ${_ok} FALSE ) set(${_ok} FALSE)
elseif (${_value} EQUAL ${_lower_limit}) elseif(${_value} EQUAL ${_lower_limit})
set( ${_ok} TRUE ) set(${_ok} TRUE)
elseif (${_value} EQUAL ${_upper_limit}) elseif(${_value} EQUAL ${_upper_limit})
set( ${_ok} FALSE ) set(${_ok} FALSE)
elseif (${_value} GREATER ${_upper_limit}) elseif(${_value} GREATER ${_upper_limit})
set( ${_ok} FALSE ) set(${_ok} FALSE)
else (${_value} LESS ${_lower_limit}) else(${_value} LESS ${_lower_limit})
set( ${_ok} TRUE ) set(${_ok} TRUE)
endif (${_value} LESS ${_lower_limit}) endif(${_value} LESS ${_lower_limit})
ENDMACRO(CHECK_RANGE_INCLUSIVE_LOWER) ENDMACRO(CHECK_RANGE_INCLUSIVE_LOWER)
MACRO(ENSURE_VERSION requested_version found_version var_too_old) MACRO(ENSURE_VERSION requested_version found_version var_too_old)
NORMALIZE_VERSION( ${requested_version} req_vers_num ) NORMALIZE_VERSION(${requested_version} req_vers_num)
NORMALIZE_VERSION( ${found_version} found_vers_num ) NORMALIZE_VERSION(${found_version} found_vers_num)
if (found_vers_num LESS req_vers_num) if(found_vers_num LESS req_vers_num)
set( ${var_too_old} FALSE ) set(${var_too_old} FALSE)
else (found_vers_num LESS req_vers_num) else(found_vers_num LESS req_vers_num)
set( ${var_too_old} TRUE ) set(${var_too_old} TRUE)
endif (found_vers_num LESS req_vers_num) endif(found_vers_num LESS req_vers_num)
ENDMACRO(ENSURE_VERSION) ENDMACRO(ENSURE_VERSION)
MACRO(ENSURE_VERSION2 requested_version2 found_version2 var_too_old2) MACRO(ENSURE_VERSION2 requested_version2 found_version2 var_too_old2)
ENSURE_VERSION( ${requested_version2} ${found_version2} ${var_too_old2}) ENSURE_VERSION(${requested_version2} ${found_version2} ${var_too_old2})
ENDMACRO(ENSURE_VERSION2) ENDMACRO(ENSURE_VERSION2)
MACRO(ENSURE_VERSION_RANGE min_version found_version max_version var_ok) MACRO(ENSURE_VERSION_RANGE min_version found_version max_version var_ok)
NORMALIZE_VERSION( ${min_version} req_vers_num ) NORMALIZE_VERSION(${min_version} req_vers_num)
NORMALIZE_VERSION( ${found_version} found_vers_num ) NORMALIZE_VERSION(${found_version} found_vers_num)
NORMALIZE_VERSION( ${max_version} max_vers_num ) NORMALIZE_VERSION(${max_version} max_vers_num)
CHECK_RANGE_INCLUSIVE_LOWER( ${req_vers_num} ${found_vers_num} ${max_vers_num} ${var_ok}) CHECK_RANGE_INCLUSIVE_LOWER(${req_vers_num} ${found_vers_num} ${max_vers_num} ${var_ok})
ENDMACRO(ENSURE_VERSION_RANGE) ENDMACRO(ENSURE_VERSION_RANGE)

View File

@@ -11,9 +11,9 @@
# also defined, but not for general use are # also defined, but not for general use are
# MYSQL_LIBRARY, where to find the MySQL library. # MYSQL_LIBRARY, where to find the MySQL library.
set( MYSQL_FOUND 0 ) set(MYSQL_FOUND 0)
if( UNIX ) if(UNIX)
set(MYSQL_CONFIG_PREFER_PATH "$ENV{MYSQL_HOME}/bin" CACHE FILEPATH set(MYSQL_CONFIG_PREFER_PATH "$ENV{MYSQL_HOME}/bin" CACHE FILEPATH
"preferred path to MySQL (mysql_config)" "preferred path to MySQL (mysql_config)"
) )
@@ -25,7 +25,7 @@ if( UNIX )
/usr/bin/ /usr/bin/
) )
if( MYSQL_CONFIG ) if(MYSQL_CONFIG)
message(STATUS "Using mysql-config: ${MYSQL_CONFIG}") message(STATUS "Using mysql-config: ${MYSQL_CONFIG}")
# set INCLUDE_DIR # set INCLUDE_DIR
exec_program(${MYSQL_CONFIG} exec_program(${MYSQL_CONFIG}
@@ -57,24 +57,24 @@ if( UNIX )
#message("[DEBUG] MYSQL ADD_LIBRARIES_PATH : ${MYSQL_ADD_LIBRARIES_PATH}") #message("[DEBUG] MYSQL ADD_LIBRARIES_PATH : ${MYSQL_ADD_LIBRARIES_PATH}")
endforeach(LIB ${MYSQL_LIBS}) endforeach(LIB ${MYSQL_LIBS})
else( MYSQL_CONFIG ) else(MYSQL_CONFIG)
set(MYSQL_ADD_LIBRARIES "") set(MYSQL_ADD_LIBRARIES "")
list(APPEND MYSQL_ADD_LIBRARIES "mysqlclient_r") list(APPEND MYSQL_ADD_LIBRARIES "mysqlclient_r")
endif( MYSQL_CONFIG ) endif(MYSQL_CONFIG)
endif( UNIX ) endif(UNIX)
if( WIN32 ) if(WIN32)
# read environment variables and change \ to / # read environment variables and change \ to /
SET(PROGRAM_FILES_32 $ENV{ProgramFiles}) SET(PROGRAM_FILES_32 $ENV{ProgramFiles})
if (${PROGRAM_FILES_32}) if(${PROGRAM_FILES_32})
STRING(REPLACE "\\\\" "/" PROGRAM_FILES_32 ${PROGRAM_FILES_32}) STRING(REPLACE "\\\\" "/" PROGRAM_FILES_32 ${PROGRAM_FILES_32})
endif(${PROGRAM_FILES_32}) endif(${PROGRAM_FILES_32})
SET(PROGRAM_FILES_64 $ENV{ProgramW6432}) SET(PROGRAM_FILES_64 $ENV{ProgramW6432})
if (${PROGRAM_FILES_64}) if(${PROGRAM_FILES_64})
STRING(REPLACE "\\\\" "/" PROGRAM_FILES_64 ${PROGRAM_FILES_64}) STRING(REPLACE "\\\\" "/" PROGRAM_FILES_64 ${PROGRAM_FILES_64})
endif(${PROGRAM_FILES_64}) endif(${PROGRAM_FILES_64})
endif ( WIN32 ) endif(WIN32)
find_path(MYSQL_INCLUDE_DIR find_path(MYSQL_INCLUDE_DIR
NAMES NAMES
@@ -109,9 +109,9 @@ find_path(MYSQL_INCLUDE_DIR
"Specify the directory containing mysql.h." "Specify the directory containing mysql.h."
) )
if( UNIX ) if(UNIX)
foreach(LIB ${MYSQL_ADD_LIBRARIES}) foreach(LIB ${MYSQL_ADD_LIBRARIES})
find_library( MYSQL_LIBRARY find_library(MYSQL_LIBRARY
NAMES NAMES
mysql libmysql ${LIB} mysql libmysql ${LIB}
PATHS PATHS
@@ -124,10 +124,10 @@ if( UNIX )
DOC "Specify the location of the mysql library here." DOC "Specify the location of the mysql library here."
) )
endforeach(LIB ${MYSQL_ADD_LIBRARY}) endforeach(LIB ${MYSQL_ADD_LIBRARY})
endif( UNIX ) endif(UNIX)
if( WIN32 ) if(WIN32)
find_library( MYSQL_LIBRARY find_library(MYSQL_LIBRARY
NAMES NAMES
libmysql libmariadb libmysql libmariadb
PATHS PATHS
@@ -161,13 +161,13 @@ if( WIN32 )
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MariaDB 10.4 (x64);INSTALLDIR]/lib" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MariaDB 10.4 (x64);INSTALLDIR]/lib"
DOC "Specify the location of the mysql library here." DOC "Specify the location of the mysql library here."
) )
endif( WIN32 ) endif(WIN32)
# On Windows you typically don't need to include any extra libraries # On Windows you typically don't need to include any extra libraries
# to build MYSQL stuff. # to build MYSQL stuff.
if( NOT WIN32 ) if(NOT WIN32)
find_library( MYSQL_EXTRA_LIBRARIES find_library(MYSQL_EXTRA_LIBRARIES
NAMES NAMES
z zlib z zlib
PATHS PATHS
@@ -176,11 +176,11 @@ if( NOT WIN32 )
DOC DOC
"if more libraries are necessary to link in a MySQL client (typically zlib), specify them here." "if more libraries are necessary to link in a MySQL client (typically zlib), specify them here."
) )
else( NOT WIN32 ) else(NOT WIN32)
set( MYSQL_EXTRA_LIBRARIES "" ) set(MYSQL_EXTRA_LIBRARIES "")
endif( NOT WIN32 ) endif(NOT WIN32)
if( UNIX ) if(UNIX)
find_program(MYSQL_EXECUTABLE mysql find_program(MYSQL_EXECUTABLE mysql
PATHS PATHS
${MYSQL_CONFIG_PREFER_PATH} ${MYSQL_CONFIG_PREFER_PATH}
@@ -190,9 +190,9 @@ if( UNIX )
DOC DOC
"path to your mysql binary." "path to your mysql binary."
) )
endif( UNIX ) endif(UNIX)
if( WIN32 ) if(WIN32)
find_program(MYSQL_EXECUTABLE mysql find_program(MYSQL_EXECUTABLE mysql
PATHS PATHS
"${PROGRAM_FILES_64}/MySQL/MySQL Server 8.0/bin" "${PROGRAM_FILES_64}/MySQL/MySQL Server 8.0/bin"
@@ -225,20 +225,20 @@ if( WIN32 )
DOC DOC
"path to your mysql binary." "path to your mysql binary."
) )
endif( WIN32 ) endif(WIN32)
if( MYSQL_LIBRARY ) if(MYSQL_LIBRARY)
if( MYSQL_INCLUDE_DIR ) if(MYSQL_INCLUDE_DIR)
set( MYSQL_FOUND 1 ) set(MYSQL_FOUND 1)
message(STATUS "Found MySQL library: ${MYSQL_LIBRARY}") message(STATUS "Found MySQL library: ${MYSQL_LIBRARY}")
message(STATUS "Found MySQL headers: ${MYSQL_INCLUDE_DIR}") message(STATUS "Found MySQL headers: ${MYSQL_INCLUDE_DIR}")
else( MYSQL_INCLUDE_DIR ) else(MYSQL_INCLUDE_DIR)
message(FATAL_ERROR "Could not find MySQL headers! Please install the development libraries and headers") message(FATAL_ERROR "Could not find MySQL headers! Please install the development libraries and headers")
endif( MYSQL_INCLUDE_DIR ) endif(MYSQL_INCLUDE_DIR)
if( MYSQL_EXECUTABLE ) if(MYSQL_EXECUTABLE)
message(STATUS "Found MySQL executable: ${MYSQL_EXECUTABLE}") message(STATUS "Found MySQL executable: ${MYSQL_EXECUTABLE}")
endif( MYSQL_EXECUTABLE ) endif(MYSQL_EXECUTABLE)
mark_as_advanced( MYSQL_FOUND MYSQL_LIBRARY MYSQL_EXTRA_LIBRARIES MYSQL_INCLUDE_DIR MYSQL_EXECUTABLE) mark_as_advanced(MYSQL_FOUND MYSQL_LIBRARY MYSQL_EXTRA_LIBRARIES MYSQL_INCLUDE_DIR MYSQL_EXECUTABLE)
else( MYSQL_LIBRARY ) else(MYSQL_LIBRARY)
message(FATAL_ERROR "Could not find the MySQL libraries! Please install the development libraries and headers") message(FATAL_ERROR "Could not find the MySQL libraries! Please install the development libraries and headers")
endif( MYSQL_LIBRARY ) endif(MYSQL_LIBRARY)

View File

@@ -210,7 +210,7 @@ if(WIN32 AND NOT CYGWIN)
endif () endif ()
# Since OpenSSL 1.1, lib names are like libcrypto32MTd.lib and libssl32MTd.lib # Since OpenSSL 1.1, lib names are like libcrypto32MTd.lib and libssl32MTd.lib
if( "${CMAKE_SIZEOF_VOID_P}" STREQUAL "8" ) if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
set(_OPENSSL_MSVC_ARCH_SUFFIX "64") set(_OPENSSL_MSVC_ARCH_SUFFIX "64")
else() else()
set(_OPENSSL_MSVC_ARCH_SUFFIX "32") set(_OPENSSL_MSVC_ARCH_SUFFIX "32")
@@ -502,7 +502,7 @@ if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX) from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX)
list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH) list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
if (NOT OPENSSL_VERSION_PATCH STREQUAL "00") if(NOT OPENSSL_VERSION_PATCH STREQUAL "00")
from_hex("${OPENSSL_VERSION_PATCH}" _tmp) from_hex("${OPENSSL_VERSION_PATCH}" _tmp)
# 96 is the ASCII code of 'a' minus 1 # 96 is the ASCII code of 'a' minus 1
math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96") math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96")

View File

@@ -1,5 +1,5 @@
if (CMAKE_VERSION VERSION_LESS "3.16.0") if(CMAKE_VERSION VERSION_LESS "3.16.0")
if (MSVC) if(MSVC)
# Specify the maximum PreCompiled Header memory allocation limit # Specify the maximum PreCompiled Header memory allocation limit
# Fixes a compiler-problem when using PCH - the /Ym flag is adjusted by the compiler in MSVC2012, # Fixes a compiler-problem when using PCH - the /Ym flag is adjusted by the compiler in MSVC2012,
# hence we need to set an upper limit with /Zm to avoid discrepancies) # hence we need to set an upper limit with /Zm to avoid discrepancies)
@@ -7,13 +7,13 @@ if (CMAKE_VERSION VERSION_LESS "3.16.0")
# #
# Note: This workaround was verified to be required on MSVC 2017 as well # Note: This workaround was verified to be required on MSVC 2017 as well
set(COTIRE_PCH_MEMORY_SCALING_FACTOR 500) set(COTIRE_PCH_MEMORY_SCALING_FACTOR 500)
endif () endif()
include(cotire) include(cotire)
function(ADD_CXX_PCH TARGET_NAME_LIST PCH_HEADER) function(ADD_CXX_PCH TARGET_NAME_LIST PCH_HEADER)
# Use the header for every target # Use the header for every target
foreach (TARGET_NAME ${TARGET_NAME_LIST}) foreach(TARGET_NAME ${TARGET_NAME_LIST})
# Disable unity builds # Disable unity builds
set_target_properties(${TARGET_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD OFF) set_target_properties(${TARGET_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD OFF)
@@ -22,7 +22,7 @@ if (CMAKE_VERSION VERSION_LESS "3.16.0")
# Workaround for cotire bug: https://github.com/sakra/cotire/issues/138 # Workaround for cotire bug: https://github.com/sakra/cotire/issues/138
set_property(TARGET ${TARGET_NAME} PROPERTY CXX_STANDARD 17) set_property(TARGET ${TARGET_NAME} PROPERTY CXX_STANDARD 17)
endforeach () endforeach()
cotire(${TARGET_NAME_LIST}) cotire(${TARGET_NAME_LIST})
endfunction(ADD_CXX_PCH) endfunction(ADD_CXX_PCH)

View File

@@ -10,7 +10,7 @@
macro(GroupSources dir) macro(GroupSources dir)
# Skip this if WITH_SOURCE_TREE is not set (empty string). # Skip this if WITH_SOURCE_TREE is not set (empty string).
if (NOT ${WITH_SOURCE_TREE} STREQUAL "") if(NOT ${WITH_SOURCE_TREE} STREQUAL "")
# Include all header and c files # Include all header and c files
file(GLOB_RECURSE elements RELATIVE ${dir} *.h *.hpp *.c *.cpp *.cc) file(GLOB_RECURSE elements RELATIVE ${dir} *.h *.hpp *.c *.cpp *.cc)
@@ -19,12 +19,12 @@ macro(GroupSources dir)
get_filename_component(element_name ${element} NAME) get_filename_component(element_name ${element} NAME)
get_filename_component(element_dir ${element} DIRECTORY) get_filename_component(element_dir ${element} DIRECTORY)
if (NOT ${element_dir} STREQUAL "") if(NOT ${element_dir} STREQUAL "")
# If the file is in a subdirectory use it as source group. # If the file is in a subdirectory use it as source group.
if (${WITH_SOURCE_TREE} STREQUAL "flat") if(${WITH_SOURCE_TREE} STREQUAL "flat")
# Build flat structure by using only the first subdirectory. # Build flat structure by using only the first subdirectory.
string(FIND ${element_dir} "/" delemiter_pos) string(FIND ${element_dir} "/" delemiter_pos)
if (NOT ${delemiter_pos} EQUAL -1) if(NOT ${delemiter_pos} EQUAL -1)
string(SUBSTRING ${element_dir} 0 ${delemiter_pos} group_name) string(SUBSTRING ${element_dir} 0 ${delemiter_pos} group_name)
source_group("${group_name}" FILES ${dir}/${element}) source_group("${group_name}" FILES ${dir}/${element})
else() else()
@@ -45,7 +45,7 @@ macro(GroupSources dir)
endif() endif()
endmacro() endmacro()
if (WITH_SOURCE_TREE STREQUAL "hierarchical-folders") if(WITH_SOURCE_TREE STREQUAL "hierarchical-folders")
# Use folders # Use folders
set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif() endif()

View File

@@ -13,9 +13,9 @@ option(SERVERS "Build worldserver and bnetserver"
set(SCRIPTS_AVAILABLE_OPTIONS none static dynamic minimal-static minimal-dynamic) set(SCRIPTS_AVAILABLE_OPTIONS none static dynamic minimal-static minimal-dynamic)
# Log a fatal error when the value of the SCRIPTS variable isn't a valid option. # Log a fatal error when the value of the SCRIPTS variable isn't a valid option.
if (SCRIPTS) if(SCRIPTS)
list (FIND SCRIPTS_AVAILABLE_OPTIONS "${SCRIPTS}" SCRIPTS_INDEX) list(FIND SCRIPTS_AVAILABLE_OPTIONS "${SCRIPTS}" SCRIPTS_INDEX)
if (${SCRIPTS_INDEX} EQUAL -1) if(${SCRIPTS_INDEX} EQUAL -1)
message(FATAL_ERROR "The value (${SCRIPTS}) of your SCRIPTS variable is invalid! " message(FATAL_ERROR "The value (${SCRIPTS}) of your SCRIPTS variable is invalid! "
"Allowed values are: ${SCRIPTS_AVAILABLE_OPTIONS} if you still " "Allowed values are: ${SCRIPTS_AVAILABLE_OPTIONS} if you still "
"have problems search on forum for TCE00019.") "have problems search on forum for TCE00019.")
@@ -38,10 +38,10 @@ option(USE_SCRIPTPCH "Use precompiled headers when compiling scripts"
option(USE_COREPCH "Use precompiled headers when compiling servers" 1) option(USE_COREPCH "Use precompiled headers when compiling servers" 1)
option(WITH_DYNAMIC_LINKING "Enable dynamic library linking." 0) option(WITH_DYNAMIC_LINKING "Enable dynamic library linking." 0)
IsDynamicLinkingRequired(WITH_DYNAMIC_LINKING_FORCED) IsDynamicLinkingRequired(WITH_DYNAMIC_LINKING_FORCED)
if (WITH_DYNAMIC_LINKING AND WITH_DYNAMIC_LINKING_FORCED) if(WITH_DYNAMIC_LINKING AND WITH_DYNAMIC_LINKING_FORCED)
set(WITH_DYNAMIC_LINKING_FORCED OFF) set(WITH_DYNAMIC_LINKING_FORCED OFF)
endif() endif()
if (WITH_DYNAMIC_LINKING OR WITH_DYNAMIC_LINKING_FORCED) if(WITH_DYNAMIC_LINKING OR WITH_DYNAMIC_LINKING_FORCED)
set(BUILD_SHARED_LIBS ON) set(BUILD_SHARED_LIBS ON)
else() else()
set(BUILD_SHARED_LIBS OFF) set(BUILD_SHARED_LIBS OFF)

View File

@@ -1,5 +1,5 @@
# set default configuration directory # set default configuration directory
if( NOT CONF_DIR ) if(NOT CONF_DIR)
set(CONF_DIR ${CMAKE_INSTALL_PREFIX}/etc) set(CONF_DIR ${CMAKE_INSTALL_PREFIX}/etc)
message(STATUS "UNIX: Using default configuration directory") message(STATUS "UNIX: Using default configuration directory")
endif() endif()

View File

@@ -2,10 +2,10 @@ add_definitions(-D_WIN32_WINNT=0x0601)
add_definitions(-DWIN32_LEAN_AND_MEAN) add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-DNOMINMAX) add_definitions(-DNOMINMAX)
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
include(${CMAKE_SOURCE_DIR}/cmake/compiler/msvc/settings.cmake) include(${CMAKE_SOURCE_DIR}/cmake/compiler/msvc/settings.cmake)
elseif (CMAKE_CXX_PLATFORM_ID MATCHES "MinGW") elseif(CMAKE_CXX_PLATFORM_ID MATCHES "MinGW")
include(${CMAKE_SOURCE_DIR}/cmake/compiler/mingw/settings.cmake) include(${CMAKE_SOURCE_DIR}/cmake/compiler/mingw/settings.cmake)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
include(${CMAKE_SOURCE_DIR}/cmake/compiler/clang/settings.cmake) include(${CMAKE_SOURCE_DIR}/cmake/compiler/clang/settings.cmake)
endif() endif()

View File

@@ -1,7 +1,7 @@
# output generic information about the core and buildtype chosen # output generic information about the core and buildtype chosen
message("") message("")
message("* TrinityCore revision : ${rev_hash} ${rev_date} (${rev_branch} branch)") message("* TrinityCore revision : ${rev_hash} ${rev_date} (${rev_branch} branch)")
if( UNIX ) if(UNIX)
message("* TrinityCore buildtype : ${CMAKE_BUILD_TYPE}") message("* TrinityCore buildtype : ${CMAKE_BUILD_TYPE}")
endif() endif()
message("") message("")
@@ -9,12 +9,12 @@ message("")
# output information about installation-directories and locations # output information about installation-directories and locations
message("* Install core to : ${CMAKE_INSTALL_PREFIX}") message("* Install core to : ${CMAKE_INSTALL_PREFIX}")
if( UNIX ) if(UNIX)
message("* Install configs to : ${CONF_DIR}") message("* Install configs to : ${CONF_DIR}")
endif() endif()
if( COPY_CONF ) if(COPY_CONF)
if( UNIX ) if(UNIX)
message("* Install configs to : ${CONF_DIR}") message("* Install configs to : ${CONF_DIR}")
else() else()
message("* Install configs to : ${CMAKE_INSTALL_PREFIX}") message("* Install configs to : ${CMAKE_INSTALL_PREFIX}")
@@ -25,7 +25,7 @@ message("")
# Show infomation about the options selected during configuration # Show infomation about the options selected during configuration
if( SERVERS ) if(SERVERS)
message("* Build world/auth : Yes (default)") message("* Build world/auth : Yes (default)")
else() else()
message("* Build world/bnetserver : No") message("* Build world/bnetserver : No")
@@ -37,31 +37,31 @@ else()
message("* Build with scripts : No") message("* Build with scripts : No")
endif() endif()
if( TOOLS ) if(TOOLS)
message("* Build map/vmap tools : Yes (default)") message("* Build map/vmap tools : Yes (default)")
else() else()
message("* Build map/vmap tools : No") message("* Build map/vmap tools : No")
endif() endif()
if( USE_COREPCH ) if(USE_COREPCH)
message("* Build core w/PCH : Yes (default)") message("* Build core w/PCH : Yes (default)")
else() else()
message("* Build core w/PCH : No") message("* Build core w/PCH : No")
endif() endif()
if( USE_SCRIPTPCH ) if(USE_SCRIPTPCH)
message("* Build scripts w/PCH : Yes (default)") message("* Build scripts w/PCH : Yes (default)")
else() else()
message("* Build scripts w/PCH : No") message("* Build scripts w/PCH : No")
endif() endif()
if( WITH_WARNINGS ) if(WITH_WARNINGS)
message("* Show all warnings : Yes") message("* Show all warnings : Yes")
else() else()
message("* Show compile-warnings : No (default)") message("* Show compile-warnings : No (default)")
endif() endif()
if( WITH_COREDEBUG ) if(WITH_COREDEBUG)
message("") message("")
message(" *** WITH_COREDEBUG - WARNING!") message(" *** WITH_COREDEBUG - WARNING!")
message(" *** additional core debug logs have been enabled!") message(" *** additional core debug logs have been enabled!")
@@ -75,13 +75,13 @@ else()
message("* Use coreside debug : No (default)") message("* Use coreside debug : No (default)")
endif() endif()
if( NOT WITH_SOURCE_TREE STREQUAL "no" ) if(NOT WITH_SOURCE_TREE STREQUAL "no")
message("* Show source tree : Yes (${WITH_SOURCE_TREE})") message("* Show source tree : Yes (${WITH_SOURCE_TREE})")
else() else()
message("* Show source tree : No") message("* Show source tree : No")
endif() endif()
if ( WITHOUT_GIT ) if(WITHOUT_GIT)
message("* Use GIT revision hash : No") message("* Use GIT revision hash : No")
message("") message("")
message(" *** WITHOUT_GIT - WARNING!") message(" *** WITHOUT_GIT - WARNING!")
@@ -96,7 +96,7 @@ else()
message("* Use GIT revision hash : Yes (default)") message("* Use GIT revision hash : Yes (default)")
endif() endif()
if ( NOJEM ) if(NOJEM)
message("") message("")
message(" *** NOJEM - WARNING!") message(" *** NOJEM - WARNING!")
message(" *** jemalloc linking has been disabled!") message(" *** jemalloc linking has been disabled!")
@@ -104,7 +104,7 @@ if ( NOJEM )
message(" *** DO NOT DISABLE IT UNLESS YOU KNOW WHAT YOU'RE DOING!") message(" *** DO NOT DISABLE IT UNLESS YOU KNOW WHAT YOU'RE DOING!")
endif() endif()
if ( HELGRIND ) if(HELGRIND)
message("") message("")
message(" *** HELGRIND - WARNING!") message(" *** HELGRIND - WARNING!")
message(" *** Please specify the valgrind include directory in VALGRIND_INCLUDE_DIR option if you get build errors") message(" *** Please specify the valgrind include directory in VALGRIND_INCLUDE_DIR option if you get build errors")
@@ -112,7 +112,7 @@ if ( HELGRIND )
add_definitions(-DHELGRIND) add_definitions(-DHELGRIND)
endif() endif()
if ( ASAN ) if(ASAN)
message("") message("")
message(" *** ASAN - WARNING!") message(" *** ASAN - WARNING!")
message(" *** Please note that this is for DEBUGGING WITH ADDRESS SANITIZER only!") message(" *** Please note that this is for DEBUGGING WITH ADDRESS SANITIZER only!")
@@ -147,7 +147,7 @@ if(PERFORMANCE_PROFILING)
add_definitions(-DPERFORMANCE_PROFILING) add_definitions(-DPERFORMANCE_PROFILING)
endif() endif()
if( WITH_STRICT_DATABASE_TYPE_CHECKS ) if(WITH_STRICT_DATABASE_TYPE_CHECKS)
message("") message("")
message(" *** WITH_STRICT_DATABASE_TYPE_CHECKS - WARNING!") message(" *** WITH_STRICT_DATABASE_TYPE_CHECKS - WARNING!")
message(" *** Validates uses of database Get***() functions from Field class") message(" *** Validates uses of database Get***() functions from Field class")
@@ -156,12 +156,12 @@ if( WITH_STRICT_DATABASE_TYPE_CHECKS )
add_definitions(-DTRINITY_STRICT_DATABASE_TYPE_CHECKS) add_definitions(-DTRINITY_STRICT_DATABASE_TYPE_CHECKS)
endif() endif()
if (BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
message("") message("")
message(" *** WITH_DYNAMIC_LINKING - INFO!") message(" *** WITH_DYNAMIC_LINKING - INFO!")
message(" *** Will link against shared libraries!") message(" *** Will link against shared libraries!")
message(" *** Please note that this is an experimental feature!") message(" *** Please note that this is an experimental feature!")
if (WITH_DYNAMIC_LINKING_FORCED) if(WITH_DYNAMIC_LINKING_FORCED)
message("") message("")
message(" *** Dynamic linking was enforced through a dynamic script module!") message(" *** Dynamic linking was enforced through a dynamic script module!")
endif() endif()

View File

@@ -10,7 +10,7 @@
add_subdirectory(threads) add_subdirectory(threads)
if (SERVERS OR TOOLS) if(SERVERS OR TOOLS)
add_subdirectory(boost) add_subdirectory(boost)
add_subdirectory(process) add_subdirectory(process)
add_subdirectory(zlib) add_subdirectory(zlib)
@@ -25,7 +25,7 @@ if (SERVERS OR TOOLS)
add_subdirectory(argon2) add_subdirectory(argon2)
endif() endif()
if (SERVERS) if(SERVERS)
add_subdirectory(mysql) add_subdirectory(mysql)
add_subdirectory(readline) add_subdirectory(readline)
add_subdirectory(gsoap) add_subdirectory(gsoap)
@@ -34,6 +34,6 @@ if (SERVERS)
add_subdirectory(protobuf) add_subdirectory(protobuf)
endif() endif()
if (TOOLS) if(TOOLS)
add_subdirectory(CascLib) add_subdirectory(CascLib)
endif() endif()

View File

@@ -23,9 +23,9 @@ list(APPEND PRIVATE_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/Debugging/Errors.cpp ${CMAKE_CURRENT_SOURCE_DIR}/Debugging/Errors.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Debugging/Errors.h) ${CMAKE_CURRENT_SOURCE_DIR}/Debugging/Errors.h)
if (USE_COREPCH) if(USE_COREPCH)
set(PRIVATE_PCH_HEADER PrecompiledHeaders/commonPCH.h) set(PRIVATE_PCH_HEADER PrecompiledHeaders/commonPCH.h)
endif (USE_COREPCH) endif(USE_COREPCH)
GroupSources(${CMAKE_CURRENT_SOURCE_DIR}) GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
@@ -82,12 +82,12 @@ set_target_properties(common
FOLDER FOLDER
"server") "server")
if( BUILD_SHARED_LIBS ) if(BUILD_SHARED_LIBS)
if( UNIX ) if(UNIX)
install(TARGETS common install(TARGETS common
LIBRARY LIBRARY
DESTINATION lib) DESTINATION lib)
elseif( WIN32 ) elseif(WIN32)
install(TARGETS common install(TARGETS common
RUNTIME RUNTIME
DESTINATION "${CMAKE_INSTALL_PREFIX}") DESTINATION "${CMAKE_INSTALL_PREFIX}")
@@ -95,6 +95,6 @@ if( BUILD_SHARED_LIBS )
endif() endif()
# Generate precompiled header # Generate precompiled header
if (USE_COREPCH) if(USE_COREPCH)
add_cxx_pch(common ${PRIVATE_PCH_HEADER}) add_cxx_pch(common ${PRIVATE_PCH_HEADER})
endif () endif()

View File

@@ -14,7 +14,7 @@ CollectSourceFiles(
# Exclude # Exclude
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders) ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
if (USE_COREPCH) if(USE_COREPCH)
set(PRIVATE_PCH_HEADER PrecompiledHeaders/databasePCH.h) set(PRIVATE_PCH_HEADER PrecompiledHeaders/databasePCH.h)
endif() endif()
@@ -59,12 +59,12 @@ set_target_properties(database
FOLDER FOLDER
"server") "server")
if( BUILD_SHARED_LIBS ) if(BUILD_SHARED_LIBS)
if( UNIX ) if(UNIX)
install(TARGETS database install(TARGETS database
LIBRARY LIBRARY
DESTINATION lib) DESTINATION lib)
elseif( WIN32 ) elseif(WIN32)
install(TARGETS database install(TARGETS database
RUNTIME RUNTIME
DESTINATION "${CMAKE_INSTALL_PREFIX}") DESTINATION "${CMAKE_INSTALL_PREFIX}")
@@ -72,6 +72,6 @@ if( BUILD_SHARED_LIBS )
endif() endif()
# Generate precompiled header # Generate precompiled header
if (USE_COREPCH) if(USE_COREPCH)
add_cxx_pch(database ${PRIVATE_PCH_HEADER}) add_cxx_pch(database ${PRIVATE_PCH_HEADER})
endif () endif()

View File

@@ -14,9 +14,9 @@ CollectSourceFiles(
# Exclude # Exclude
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders) ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
if (USE_COREPCH) if(USE_COREPCH)
set(PRIVATE_PCH_HEADER PrecompiledHeaders/gamePCH.h) set(PRIVATE_PCH_HEADER PrecompiledHeaders/gamePCH.h)
endif () endif()
GroupSources(${CMAKE_CURRENT_SOURCE_DIR}) GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
@@ -60,12 +60,12 @@ set_target_properties(game
FOLDER FOLDER
"server") "server")
if( BUILD_SHARED_LIBS ) if(BUILD_SHARED_LIBS)
if( UNIX ) if(UNIX)
install(TARGETS game install(TARGETS game
LIBRARY LIBRARY
DESTINATION lib) DESTINATION lib)
elseif( WIN32 ) elseif(WIN32)
install(TARGETS game install(TARGETS game
RUNTIME RUNTIME
DESTINATION "${CMAKE_INSTALL_PREFIX}") DESTINATION "${CMAKE_INSTALL_PREFIX}")
@@ -73,6 +73,6 @@ if( BUILD_SHARED_LIBS )
endif() endif()
# Generate precompiled header # Generate precompiled header
if (USE_COREPCH) if(USE_COREPCH)
add_cxx_pch(game ${PRIVATE_PCH_HEADER}) add_cxx_pch(game ${PRIVATE_PCH_HEADER})
endif () endif()

View File

@@ -20,7 +20,7 @@ GetInstallOffset(INSTALL_OFFSET)
# when using predefined templates for script building # when using predefined templates for script building
# like dynamic, static, minimal-static... # like dynamic, static, minimal-static...
# Sets SCRIPTS_DEFAULT_LINKAGE # Sets SCRIPTS_DEFAULT_LINKAGE
if (SCRIPTS MATCHES "dynamic") if(SCRIPTS MATCHES "dynamic")
set(SCRIPTS_DEFAULT_LINKAGE "dynamic") set(SCRIPTS_DEFAULT_LINKAGE "dynamic")
elseif(SCRIPTS MATCHES "static") elseif(SCRIPTS MATCHES "static")
set(SCRIPTS_DEFAULT_LINKAGE "static") set(SCRIPTS_DEFAULT_LINKAGE "static")
@@ -29,7 +29,7 @@ else()
endif() endif()
# Sets SCRIPTS_USE_WHITELIST # Sets SCRIPTS_USE_WHITELIST
# Sets SCRIPTS_WHITELIST # Sets SCRIPTS_WHITELIST
if (SCRIPTS MATCHES "minimal") if(SCRIPTS MATCHES "minimal")
set(SCRIPTS_USE_WHITELIST ON) set(SCRIPTS_USE_WHITELIST ON)
# Whitelist which is used when minimal is selected # Whitelist which is used when minimal is selected
list(APPEND SCRIPTS_WHITELIST Commands Spells) list(APPEND SCRIPTS_WHITELIST Commands Spells)
@@ -39,10 +39,10 @@ endif()
# variables set above # variables set above
foreach(SCRIPT_MODULE ${SCRIPT_MODULE_LIST}) foreach(SCRIPT_MODULE ${SCRIPT_MODULE_LIST})
ScriptModuleNameToVariable(${SCRIPT_MODULE} SCRIPT_MODULE_VARIABLE) ScriptModuleNameToVariable(${SCRIPT_MODULE} SCRIPT_MODULE_VARIABLE)
if (${SCRIPT_MODULE_VARIABLE} STREQUAL "default") if(${SCRIPT_MODULE_VARIABLE} STREQUAL "default")
if(SCRIPTS_USE_WHITELIST) if(SCRIPTS_USE_WHITELIST)
list(FIND SCRIPTS_WHITELIST "${SCRIPT_MODULE}" INDEX) list(FIND SCRIPTS_WHITELIST "${SCRIPT_MODULE}" INDEX)
if (${INDEX} GREATER -1) if(${INDEX} GREATER -1)
set(${SCRIPT_MODULE_VARIABLE} ${SCRIPTS_DEFAULT_LINKAGE}) set(${SCRIPT_MODULE_VARIABLE} ${SCRIPTS_DEFAULT_LINKAGE})
else() else()
set(${SCRIPT_MODULE_VARIABLE} "disabled") set(${SCRIPT_MODULE_VARIABLE} "disabled")
@@ -52,7 +52,7 @@ foreach(SCRIPT_MODULE ${SCRIPT_MODULE_LIST})
endif() endif()
endif() endif()
# Build the Graph values # Build the Graph values
if (${SCRIPT_MODULE_VARIABLE} MATCHES "dynamic") if(${SCRIPT_MODULE_VARIABLE} MATCHES "dynamic")
GetProjectNameOfScriptModule(${SCRIPT_MODULE} SCRIPT_MODULE_PROJECT_NAME) GetProjectNameOfScriptModule(${SCRIPT_MODULE} SCRIPT_MODULE_PROJECT_NAME)
GetNativeSharedLibraryName(${SCRIPT_MODULE_PROJECT_NAME} SCRIPT_PROJECT_LIBRARY) GetNativeSharedLibraryName(${SCRIPT_MODULE_PROJECT_NAME} SCRIPT_PROJECT_LIBRARY)
list(APPEND GRAPH_KEYS ${SCRIPT_MODULE_PROJECT_NAME}) list(APPEND GRAPH_KEYS ${SCRIPT_MODULE_PROJECT_NAME})
@@ -77,7 +77,7 @@ message("* Script configuration (${SCRIPTS}):
|") |")
foreach(GRAPH_KEY ${GRAPH_KEYS}) foreach(GRAPH_KEY ${GRAPH_KEYS})
if (NOT GRAPH_KEY STREQUAL "disabled") if(NOT GRAPH_KEY STREQUAL "disabled")
message(" +- ${GRAPH_VALUE_DISPLAY_${GRAPH_KEY}}") message(" +- ${GRAPH_VALUE_DISPLAY_${GRAPH_KEY}}")
else() else()
message(" | ${GRAPH_VALUE_DISPLAY_${GRAPH_KEY}}") message(" | ${GRAPH_VALUE_DISPLAY_${GRAPH_KEY}}")
@@ -89,9 +89,9 @@ foreach(GRAPH_KEY ${GRAPH_KEYS})
endforeach() endforeach()
# Base sources which are used by every script project # Base sources which are used by every script project
if (USE_SCRIPTPCH) if(USE_SCRIPTPCH)
set(PRIVATE_PCH_HEADER ScriptPCH.h) set(PRIVATE_PCH_HEADER ScriptPCH.h)
endif () endif()
GroupSources(${CMAKE_CURRENT_SOURCE_DIR}) GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
@@ -135,13 +135,13 @@ foreach(SCRIPT_MODULE ${SCRIPT_MODULE_LIST})
GetPathToScriptModule(${SCRIPT_MODULE} SCRIPT_MODULE_PATH) GetPathToScriptModule(${SCRIPT_MODULE} SCRIPT_MODULE_PATH)
ScriptModuleNameToVariable(${SCRIPT_MODULE} SCRIPT_MODULE_VARIABLE) ScriptModuleNameToVariable(${SCRIPT_MODULE} SCRIPT_MODULE_VARIABLE)
if ((${SCRIPT_MODULE_VARIABLE} STREQUAL "disabled") OR if((${SCRIPT_MODULE_VARIABLE} STREQUAL "disabled") OR
(${SCRIPT_MODULE_VARIABLE} STREQUAL "static")) (${SCRIPT_MODULE_VARIABLE} STREQUAL "static"))
# Uninstall disabled modules # Uninstall disabled modules
GetProjectNameOfScriptModule(${SCRIPT_MODULE} SCRIPT_MODULE_PROJECT_NAME) GetProjectNameOfScriptModule(${SCRIPT_MODULE} SCRIPT_MODULE_PROJECT_NAME)
GetNativeSharedLibraryName(${SCRIPT_MODULE_PROJECT_NAME} SCRIPT_MODULE_OUTPUT_NAME) GetNativeSharedLibraryName(${SCRIPT_MODULE_PROJECT_NAME} SCRIPT_MODULE_OUTPUT_NAME)
list(APPEND DISABLED_SCRIPT_MODULE_PROJECTS ${INSTALL_OFFSET}/${SCRIPT_MODULE_OUTPUT_NAME}) list(APPEND DISABLED_SCRIPT_MODULE_PROJECTS ${INSTALL_OFFSET}/${SCRIPT_MODULE_OUTPUT_NAME})
if (${SCRIPT_MODULE_VARIABLE} STREQUAL "static") if(${SCRIPT_MODULE_VARIABLE} STREQUAL "static")
# Add the module name to STATIC_SCRIPT_MODULES # Add the module name to STATIC_SCRIPT_MODULES
list(APPEND STATIC_SCRIPT_MODULES ${SCRIPT_MODULE}) list(APPEND STATIC_SCRIPT_MODULES ${SCRIPT_MODULE})
# Add the module content to the whole static module # Add the module content to the whole static module
@@ -224,17 +224,17 @@ set_target_properties(scripts
"scripts") "scripts")
# Generate precompiled header # Generate precompiled header
if (USE_SCRIPTPCH) if(USE_SCRIPTPCH)
list(APPEND ALL_SCRIPT_PROJECTS scripts ${DYNAMIC_SCRIPT_MODULE_PROJECTS}) list(APPEND ALL_SCRIPT_PROJECTS scripts ${DYNAMIC_SCRIPT_MODULE_PROJECTS})
add_cxx_pch("${ALL_SCRIPT_PROJECTS}" ${PRIVATE_PCH_HEADER}) add_cxx_pch("${ALL_SCRIPT_PROJECTS}" ${PRIVATE_PCH_HEADER})
endif() endif()
# Remove all shared libraries in the installl directory which # Remove all shared libraries in the installl directory which
# are contained in the static library already. # are contained in the static library already.
if (DISABLED_SCRIPT_MODULE_PROJECTS) if(DISABLED_SCRIPT_MODULE_PROJECTS)
install(CODE " install(CODE "
foreach(SCRIPT_TO_UNINSTALL ${DISABLED_SCRIPT_MODULE_PROJECTS}) foreach(SCRIPT_TO_UNINSTALL ${DISABLED_SCRIPT_MODULE_PROJECTS})
if (EXISTS \"\${SCRIPT_TO_UNINSTALL}\") if(EXISTS \"\${SCRIPT_TO_UNINSTALL}\")
message(STATUS \"Uninstalling: \${SCRIPT_TO_UNINSTALL}\") message(STATUS \"Uninstalling: \${SCRIPT_TO_UNINSTALL}\")
file(REMOVE \"\${SCRIPT_TO_UNINSTALL}\") file(REMOVE \"\${SCRIPT_TO_UNINSTALL}\")
endif() endif()

View File

@@ -14,7 +14,7 @@ CollectSourceFiles(
# Exclude # Exclude
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders) ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
if (USE_COREPCH) if(USE_COREPCH)
set(PRIVATE_PCH_HEADER PrecompiledHeaders/sharedPCH.h) set(PRIVATE_PCH_HEADER PrecompiledHeaders/sharedPCH.h)
endif() endif()
@@ -54,12 +54,12 @@ set_target_properties(shared
FOLDER FOLDER
"server") "server")
if( BUILD_SHARED_LIBS ) if(BUILD_SHARED_LIBS)
if( UNIX ) if(UNIX)
install(TARGETS shared install(TARGETS shared
LIBRARY LIBRARY
DESTINATION lib) DESTINATION lib)
elseif( WIN32 ) elseif(WIN32)
install(TARGETS shared install(TARGETS shared
RUNTIME RUNTIME
DESTINATION "${CMAKE_INSTALL_PREFIX}") DESTINATION "${CMAKE_INSTALL_PREFIX}")
@@ -67,6 +67,6 @@ if( BUILD_SHARED_LIBS )
endif() endif()
# Generate precompiled header # Generate precompiled header
if (USE_COREPCH) if(USE_COREPCH)
add_cxx_pch(shared ${PRIVATE_PCH_HEADER}) add_cxx_pch(shared ${PRIVATE_PCH_HEADER})
endif () endif()

View File

@@ -14,14 +14,14 @@ CollectSourceFiles(
# Exclude # Exclude
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders) ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
if( WIN32 ) if(WIN32)
list(APPEND PRIVATE_SOURCES ${sources_windows}) list(APPEND PRIVATE_SOURCES ${sources_windows})
if ( MSVC ) if(MSVC)
list(APPEND PRIVATE_SOURCES worldserver.rc) list(APPEND PRIVATE_SOURCES worldserver.rc)
endif() endif()
endif() endif()
if (USE_COREPCH) if(USE_COREPCH)
set(PRIVATE_PCH_HEADER PrecompiledHeaders/worldPCH.h) set(PRIVATE_PCH_HEADER PrecompiledHeaders/worldPCH.h)
endif() endif()
@@ -31,13 +31,13 @@ add_executable(worldserver
${PRIVATE_SOURCES} ${PRIVATE_SOURCES}
) )
if( NOT WIN32 ) if(NOT WIN32)
set_target_properties(worldserver PROPERTIES set_target_properties(worldserver PROPERTIES
COMPILE_DEFINITIONS _TRINITY_CORE_CONFIG="${CONF_DIR}/worldserver.conf" COMPILE_DEFINITIONS _TRINITY_CORE_CONFIG="${CONF_DIR}/worldserver.conf"
) )
endif() endif()
if( UNIX AND NOT NOJEM AND NOT APPLE ) if(UNIX AND NOT NOJEM AND NOT APPLE)
set(worldserver_LINK_FLAGS "-pthread -lncurses ${worldserver_LINK_FLAGS}") set(worldserver_LINK_FLAGS "-pthread -lncurses ${worldserver_LINK_FLAGS}")
endif() endif()
@@ -69,17 +69,17 @@ set_target_properties(worldserver
"server") "server")
# Add all dynamic projects as dependency to the worldserver # Add all dynamic projects as dependency to the worldserver
if (WORLDSERVER_DYNAMIC_SCRIPT_MODULES_DEPENDENCIES) if(WORLDSERVER_DYNAMIC_SCRIPT_MODULES_DEPENDENCIES)
add_dependencies(worldserver ${WORLDSERVER_DYNAMIC_SCRIPT_MODULES_DEPENDENCIES}) add_dependencies(worldserver ${WORLDSERVER_DYNAMIC_SCRIPT_MODULES_DEPENDENCIES})
endif() endif()
if( COPY_CONF AND WIN32 ) if(COPY_CONF AND WIN32)
if ( "${CMAKE_MAKE_PROGRAM}" MATCHES "MSBuild" ) if("${CMAKE_MAKE_PROGRAM}" MATCHES "MSBuild")
add_custom_command(TARGET worldserver add_custom_command(TARGET worldserver
POST_BUILD POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/worldserver.conf.dist ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/worldserver.conf.dist ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/
) )
elseif ( MINGW ) elseif(MINGW)
add_custom_command(TARGET worldserver add_custom_command(TARGET worldserver
POST_BUILD POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/worldserver.conf.dist ${CMAKE_BINARY_DIR}/bin/ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/worldserver.conf.dist ${CMAKE_BINARY_DIR}/bin/
@@ -87,19 +87,19 @@ if( COPY_CONF AND WIN32 )
endif() endif()
endif() endif()
if( UNIX ) if(UNIX)
install(TARGETS worldserver DESTINATION bin) install(TARGETS worldserver DESTINATION bin)
if( COPY_CONF ) if(COPY_CONF)
install(FILES worldserver.conf.dist DESTINATION ${CONF_DIR}) install(FILES worldserver.conf.dist DESTINATION ${CONF_DIR})
endif() endif()
elseif( WIN32 ) elseif(WIN32)
install(TARGETS worldserver DESTINATION "${CMAKE_INSTALL_PREFIX}") install(TARGETS worldserver DESTINATION "${CMAKE_INSTALL_PREFIX}")
if( COPY_CONF ) if(COPY_CONF)
install(FILES worldserver.conf.dist DESTINATION "${CMAKE_INSTALL_PREFIX}") install(FILES worldserver.conf.dist DESTINATION "${CMAKE_INSTALL_PREFIX}")
endif() endif()
endif() endif()
# Generate precompiled header # Generate precompiled header
if( USE_COREPCH ) if(USE_COREPCH)
add_cxx_pch(worldserver ${PRIVATE_PCH_HEADER}) add_cxx_pch(worldserver ${PRIVATE_PCH_HEADER})
endif() endif()

View File

@@ -12,7 +12,7 @@ CollectSourceFiles(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE_SOURCES) PRIVATE_SOURCES)
if (WIN32) if(WIN32)
list(APPEND PRIVATE_SOURCES ${sources_windows}) list(APPEND PRIVATE_SOURCES ${sources_windows})
endif() endif()
@@ -46,8 +46,8 @@ set_target_properties(mapextractor
FOLDER FOLDER
"tools") "tools")
if( UNIX ) if(UNIX)
install(TARGETS mapextractor DESTINATION bin) install(TARGETS mapextractor DESTINATION bin)
elseif( WIN32 ) elseif(WIN32)
install(TARGETS mapextractor DESTINATION "${CMAKE_INSTALL_PREFIX}") install(TARGETS mapextractor DESTINATION "${CMAKE_INSTALL_PREFIX}")
endif() endif()

View File

@@ -12,7 +12,7 @@ CollectSourceFiles(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE_SOURCES) PRIVATE_SOURCES)
if (WIN32) if(WIN32)
list(APPEND PRIVATE_SOURCES ${sources_windows}) list(APPEND PRIVATE_SOURCES ${sources_windows})
endif() endif()
@@ -43,8 +43,8 @@ set_target_properties(mmaps_generator
FOLDER FOLDER
"tools") "tools")
if( UNIX ) if(UNIX)
install(TARGETS mmaps_generator DESTINATION bin) install(TARGETS mmaps_generator DESTINATION bin)
elseif( WIN32 ) elseif(WIN32)
install(TARGETS mmaps_generator DESTINATION "${CMAKE_INSTALL_PREFIX}") install(TARGETS mmaps_generator DESTINATION "${CMAKE_INSTALL_PREFIX}")
endif() endif()

View File

@@ -13,7 +13,7 @@ set(PRIVATE_SOURCES
TileAssembler.h TileAssembler.h
VMapAssembler.cpp) VMapAssembler.cpp)
if (WIN32) if(WIN32)
list(APPEND PRIVATE_SOURCES ${sources_windows}) list(APPEND PRIVATE_SOURCES ${sources_windows})
endif() endif()
@@ -32,8 +32,8 @@ set_target_properties(vmap4assembler
FOLDER FOLDER
"tools") "tools")
if( UNIX ) if(UNIX)
install(TARGETS vmap4assembler DESTINATION bin) install(TARGETS vmap4assembler DESTINATION bin)
elseif( WIN32 ) elseif(WIN32)
install(TARGETS vmap4assembler DESTINATION "${CMAKE_INSTALL_PREFIX}") install(TARGETS vmap4assembler DESTINATION "${CMAKE_INSTALL_PREFIX}")
endif() endif()

View File

@@ -12,7 +12,7 @@ CollectSourceFiles(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE_SOURCES) PRIVATE_SOURCES)
if (WIN32) if(WIN32)
list(APPEND PRIVATE_SOURCES ${sources_windows}) list(APPEND PRIVATE_SOURCES ${sources_windows})
endif() endif()
@@ -39,8 +39,8 @@ set_target_properties(vmap4extractor
FOLDER FOLDER
"tools") "tools")
if( UNIX ) if(UNIX)
install(TARGETS vmap4extractor DESTINATION bin) install(TARGETS vmap4extractor DESTINATION bin)
elseif( WIN32 ) elseif(WIN32)
install(TARGETS vmap4extractor DESTINATION "${CMAKE_INSTALL_PREFIX}") install(TARGETS vmap4extractor DESTINATION "${CMAKE_INSTALL_PREFIX}")
endif() endif()