Skip to content

Commit

Permalink
fixed indentation for cmake files
Browse files Browse the repository at this point in the history
  • Loading branch information
ipriver authored and Carbenium committed Jun 24, 2020
1 parent b210bb3 commit a46d047
Show file tree
Hide file tree
Showing 32 changed files with 225 additions and 225 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ project(TrinityCore)

# CMake policies (can not be handled elsewhere)
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'
else()
cmake_policy(SET CMP0043 NEW) # Cotire isn't used so set to NEW
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)
cmake_policy(SET CMP0074 NEW) # find_package() uses <PackageName>_ROOT variables
Expand All @@ -40,9 +40,9 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH 1)
list(APPEND CMAKE_MODULE_PATH
"${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
"${CMAKE_SOURCE_DIR}/dep/cotire/CMake")
"${CMAKE_SOURCE_DIR}/dep/cotire/CMake")
endif()

# build in Release-mode by default if not explicitly set
Expand All @@ -61,7 +61,7 @@ include(ConfigureScripts)
include(cmake/options.cmake)

# turn off PCH totally if enabled (hidden setting, mainly for devs)
if( NOPCH )
if(NOPCH)
set(USE_COREPCH 0)
set(USE_SCRIPTPCH 0)
endif()
Expand Down
4 changes: 2 additions & 2 deletions PreLoad.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# destinations elsewhere in the CMake buildsystem (commented out on purpose)

# Override CMAKE_INSTALL_PREFIX on Windows platforms
#if( WIN32 )
# if( NOT CYGWIN )
#if(WIN32)
# if(NOT CYGWIN)
# set(CMAKE_INSTALL_PREFIX
# "" CACHE PATH "Default install path")
# endif()
Expand Down
4 changes: 2 additions & 2 deletions cmake/compiler/clang/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if(WITH_WARNINGS)
-Wfatal-errors
-Wno-mismatched-tags
-Woverloaded-virtual)

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
target_compile_options(trinity-warning-interface
INTERFACE
Expand Down Expand Up @@ -57,7 +57,7 @@ target_compile_options(trinity-compile-option-interface
-Wno-narrowing
-Wno-deprecated-register)

if (BUILD_SHARED_LIBS)
if(BUILD_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.
target_compile_options(trinity-compile-option-interface
Expand Down
6 changes: 3 additions & 3 deletions cmake/compiler/gcc/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
message(STATUS "GCC: SFMT enabled, SSE2 flags forced")
endif()

if( WITH_WARNINGS )
if(WITH_WARNINGS)
target_compile_options(trinity-warning-interface
INTERFACE
-W
Expand All @@ -42,7 +42,7 @@ if( WITH_WARNINGS )
message(STATUS "GCC: All warnings enabled")
endif()

if( WITH_COREDEBUG )
if(WITH_COREDEBUG)
target_compile_options(trinity-compile-option-interface
INTERFACE
-g3)
Expand All @@ -68,7 +68,7 @@ if(ASAN)
message(STATUS "GCC: Enabled Address Sanitizer")
endif()

if (BUILD_SHARED_LIBS)
if(BUILD_SHARED_LIBS)
target_compile_options(trinity-compile-option-interface
INTERFACE
-fPIC
Expand Down
4 changes: 2 additions & 2 deletions cmake/compiler/icc/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ else()
-xSSE2)
endif()

if( WITH_WARNINGS )
if(WITH_WARNINGS)
target_compile_options(trinity-warning-interface
INTERFACE
-w1)

message(STATUS "ICC: All warnings enabled")
endif()

if( WITH_COREDEBUG )
if(WITH_COREDEBUG)
target_compile_options(trinity-compile-option-interface
INTERFACE
-g)
Expand Down
4 changes: 2 additions & 2 deletions cmake/compiler/mingw/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ target_compile_definitions(trinity-compile-option-interface
-D__SSE2__)
message(STATUS "GCC: SFMT enabled, SSE2 flags forced")

if( WITH_WARNINGS )
if(WITH_WARNINGS)
target_compile_options(trinity-warning-interface
INTERFACE
-W
Expand All @@ -33,7 +33,7 @@ if( WITH_WARNINGS )
message(STATUS "GCC: All warnings enabled")
endif()

if( WITH_COREDEBUG )
if(WITH_COREDEBUG)
target_compile_options(trinity-compile-option-interface
INTERFACE
-g3)
Expand Down
2 changes: 1 addition & 1 deletion cmake/compiler/msvc/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ if(NOT WITH_WARNINGS)
message(STATUS "MSVC: Disabled generic compiletime warnings")
endif()

if (BUILD_SHARED_LIBS)
if(BUILD_SHARED_LIBS)
# 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 '...'
target_compile_options(trinity-compile-option-interface
Expand Down
4 changes: 2 additions & 2 deletions cmake/macros/AutoCollect.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function(CollectSourceFiles current_dir variable)

file(GLOB SUB_DIRECTORIES ${current_dir}/*)
foreach(SUB_DIRECTORY ${SUB_DIRECTORIES})
if (IS_DIRECTORY ${SUB_DIRECTORY})
if(IS_DIRECTORY ${SUB_DIRECTORY})
CollectSourceFiles("${SUB_DIRECTORY}" "${variable}" "${ARGN}")
endif()
endforeach()
Expand All @@ -62,7 +62,7 @@ function(CollectIncludeDirectories current_dir variable)
list(APPEND ${variable} ${current_dir})
file(GLOB SUB_DIRECTORIES ${current_dir}/*)
foreach(SUB_DIRECTORY ${SUB_DIRECTORIES})
if (IS_DIRECTORY ${SUB_DIRECTORY})
if(IS_DIRECTORY ${SUB_DIRECTORY})
CollectIncludeDirectories("${SUB_DIRECTORY}" "${variable}" "${ARGN}")
endif()
endforeach()
Expand Down
2 changes: 1 addition & 1 deletion cmake/macros/CheckBuildDir.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" BUILDING_IN_SOURCE)

if( BUILDING_IN_SOURCE )
if(BUILDING_IN_SOURCE)
message(FATAL_ERROR "
This project requires an out of source build. Remove the file 'CMakeCache.txt'
found in this directory before continuing, create a separate build directory
Expand Down
8 changes: 4 additions & 4 deletions cmake/macros/ConfigureScripts.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
# Returns the base path to the script directory in the source directory
function(WarnAboutSpacesInBuildPath)
# Only check win32 since unix doesn't allow spaces in paths
if (WIN32)
if(WIN32)
string(FIND "${CMAKE_BINARY_DIR}" " " SPACE_INDEX_POS)

if (SPACE_INDEX_POS GREATER -1)
if(SPACE_INDEX_POS GREATER -1)
message("")
message(WARNING " *** WARNING!\n"
" *** Your selected build directory contains spaces!\n"
Expand Down Expand Up @@ -51,7 +51,7 @@ function(GetScriptModuleList variable)
set(${variable})
foreach(SCRIPT_MODULE ${LOCALE_SCRIPT_MODULE_LIST})
GetPathToScriptModule(${SCRIPT_MODULE} SCRIPT_MODULE_PATH)
if (IS_DIRECTORY ${SCRIPT_MODULE_PATH})
if(IS_DIRECTORY ${SCRIPT_MODULE_PATH})
list(APPEND ${variable} ${SCRIPT_MODULE})
endif()
endforeach()
Expand All @@ -76,7 +76,7 @@ function(IsDynamicLinkingRequired variable)
set(IS_REQUIRED OFF)
foreach(SCRIPT_MODULE ${SCRIPT_MODULE_LIST})
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))
set(IS_REQUIRED ON)
break()
Expand Down
58 changes: 29 additions & 29 deletions cmake/macros/EnsureVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

# ENSURE_VERSION
# 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
# 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

# Copyright (c) 2006, David Faure, <[email protected]>
Expand All @@ -29,7 +29,7 @@
# min_version <= found_version < max_version.
# 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.
#
Expand Down Expand Up @@ -61,55 +61,55 @@

MACRO(NORMALIZE_VERSION _requested_version _normalized_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
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" _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" _minor_vers "${_requested_version}")
set(_patch_vers "0")
endif (_threePartMatch)
endif(_threePartMatch)

# compute an overall version number which can be compared at once
MATH(EXPR ${_normalized_version} "${_major_vers}*10000 + ${_minor_vers}*100 + ${_patch_vers}")
ENDMACRO(NORMALIZE_VERSION)

MACRO(CHECK_RANGE_INCLUSIVE_LOWER _lower_limit _value _upper_limit _ok)
if (${_value} LESS ${_lower_limit})
set( ${_ok} FALSE )
elseif (${_value} EQUAL ${_lower_limit})
set( ${_ok} TRUE )
elseif (${_value} EQUAL ${_upper_limit})
set( ${_ok} FALSE )
elseif (${_value} GREATER ${_upper_limit})
set( ${_ok} FALSE )
else (${_value} LESS ${_lower_limit})
set( ${_ok} TRUE )
endif (${_value} LESS ${_lower_limit})
if(${_value} LESS ${_lower_limit})
set(${_ok} FALSE)
elseif(${_value} EQUAL ${_lower_limit})
set(${_ok} TRUE)
elseif(${_value} EQUAL ${_upper_limit})
set(${_ok} FALSE)
elseif(${_value} GREATER ${_upper_limit})
set(${_ok} FALSE)
else(${_value} LESS ${_lower_limit})
set(${_ok} TRUE)
endif(${_value} LESS ${_lower_limit})
ENDMACRO(CHECK_RANGE_INCLUSIVE_LOWER)

MACRO(ENSURE_VERSION requested_version found_version var_too_old)
NORMALIZE_VERSION( ${requested_version} req_vers_num )
NORMALIZE_VERSION( ${found_version} found_vers_num )
NORMALIZE_VERSION(${requested_version} req_vers_num)
NORMALIZE_VERSION(${found_version} found_vers_num)

if (found_vers_num LESS req_vers_num)
set( ${var_too_old} FALSE )
else (found_vers_num LESS req_vers_num)
set( ${var_too_old} TRUE )
endif (found_vers_num LESS req_vers_num)
if(found_vers_num LESS req_vers_num)
set(${var_too_old} FALSE)
else(found_vers_num LESS req_vers_num)
set(${var_too_old} TRUE)
endif(found_vers_num LESS req_vers_num)

ENDMACRO(ENSURE_VERSION)

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)

MACRO(ENSURE_VERSION_RANGE min_version found_version max_version var_ok)
NORMALIZE_VERSION( ${min_version} req_vers_num )
NORMALIZE_VERSION( ${found_version} found_vers_num )
NORMALIZE_VERSION( ${max_version} max_vers_num )
NORMALIZE_VERSION(${min_version} req_vers_num)
NORMALIZE_VERSION(${found_version} found_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)
2 changes: 1 addition & 1 deletion cmake/macros/FindGit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ else()
)

# make sure we're using minimum the required version of git, so the "dirty-testing" will work properly
ensure_version( "${_REQUIRED_GIT_VERSION}" "${_GIT_VERSION}" _GIT_VERSION_OK)
ensure_version("${_REQUIRED_GIT_VERSION}" "${_GIT_VERSION}" _GIT_VERSION_OK)

# throw an error if we don't have a recent enough version of git...
if(NOT _GIT_VERSION_OK)
Expand Down
Loading

0 comments on commit a46d047

Please sign in to comment.