mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
Refactoring part 2 [W.I.P]
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
CU_RUN_HOOK("BEFORE_ACORE_LOAD")
|
||||
|
||||
add_subdirectory(deps)
|
||||
add_subdirectory(genrev)
|
||||
|
||||
if( SERVERS )
|
||||
add_subdirectory(framework)
|
||||
|
||||
17
modules/acore/cmake/compiler/clang/settings.cmake
Normal file
17
modules/acore/cmake/compiler/clang/settings.cmake
Normal file
@@ -0,0 +1,17 @@
|
||||
# Set build-directive (used in core to tell which buildtype we used)
|
||||
add_definitions(-D_BUILD_DIRECTIVE='"$(CONFIGURATION)"')
|
||||
|
||||
if(WITH_WARNINGS)
|
||||
set(WARNING_FLAGS "-W -Wall -Wextra -Winit-self -Wfatal-errors")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -Woverloaded-virtual")
|
||||
message(STATUS "Clang: All warnings enabled")
|
||||
endif()
|
||||
|
||||
if(WITH_COREDEBUG)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
|
||||
message(STATUS "Clang: Debug-flags set (-g3)")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-narrowing -Wno-deprecated-register")
|
||||
36
modules/acore/cmake/compiler/gcc/settings.cmake
Normal file
36
modules/acore/cmake/compiler/gcc/settings.cmake
Normal file
@@ -0,0 +1,36 @@
|
||||
# Set build-directive (used in core to tell which buildtype we used)
|
||||
add_definitions(-D_BUILD_DIRECTIVE='"${CMAKE_BUILD_TYPE}"')
|
||||
|
||||
set(GCC_EXPECTED_VERSION 4.8.2)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS GCC_EXPECTED_VERSION)
|
||||
message(FATAL_ERROR "GCC: AzerothCore requires version ${GCC_EXPECTED_VERSION} to build but found ${CMAKE_CXX_COMPILER_VERSION}")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
message(STATUS "GCC: Enabled c++11 support")
|
||||
|
||||
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
|
||||
#message(STATUS "GCC: Enabled C99 support")
|
||||
|
||||
if(PLATFORM EQUAL 32)
|
||||
# Required on 32-bit systems to enable SSE2 (standard on x64)
|
||||
set(SSE_FLAGS "-msse2 -mfpmath=sse")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SSE_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SSE_FLAGS}")
|
||||
endif()
|
||||
add_definitions(-DHAVE_SSE2 -D__SSE2__)
|
||||
message(STATUS "GCC: SFMT enabled, SSE2 flags forced")
|
||||
|
||||
if( WITH_WARNINGS )
|
||||
set(WARNING_FLAGS "-W -Wall -Wextra -Winit-self -Winvalid-pch -Wfatal-errors")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -Woverloaded-virtual")
|
||||
message(STATUS "GCC: All warnings enabled")
|
||||
endif()
|
||||
|
||||
if( WITH_COREDEBUG )
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
|
||||
message(STATUS "GCC: Debug-flags set (-g3)")
|
||||
endif()
|
||||
18
modules/acore/cmake/compiler/icc/settings.cmake
Normal file
18
modules/acore/cmake/compiler/icc/settings.cmake
Normal file
@@ -0,0 +1,18 @@
|
||||
# Set build-directive (used in core to tell which buildtype we used)
|
||||
add_definitions(-D_BUILD_DIRECTIVE="'${CMAKE_BUILD_TYPE}'")
|
||||
|
||||
if(PLATFORM EQUAL 32)
|
||||
add_definitions(-axSSE2)
|
||||
else()
|
||||
add_definitions(-xSSE2)
|
||||
endif()
|
||||
|
||||
if( WITH_WARNINGS )
|
||||
add_definitions(-w1)
|
||||
message(STATUS "ICC: All warnings enabled")
|
||||
endif()
|
||||
|
||||
if( WITH_COREDEBUG )
|
||||
add_definitions(-g)
|
||||
message(STATUS "ICC: Debug-flag set (-g)")
|
||||
endif()
|
||||
27
modules/acore/cmake/compiler/mingw/settings.cmake
Normal file
27
modules/acore/cmake/compiler/mingw/settings.cmake
Normal file
@@ -0,0 +1,27 @@
|
||||
# set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
# Set build-directive (used in core to tell which buildtype we used)
|
||||
add_definitions(-D_BUILD_DIRECTIVE=\\"${CMAKE_BUILD_TYPE}\\")
|
||||
|
||||
if(PLATFORM EQUAL 32)
|
||||
# Required on 32-bit systems to enable SSE2 (standard on x64)
|
||||
set(SSE_FLAGS "-msse2 -mfpmath=sse")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SSE_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SSE_FLAGS}")
|
||||
endif()
|
||||
add_definitions(-DHAVE_SSE2 -D__SSE2__)
|
||||
message(STATUS "GCC: SFMT enabled, SSE2 flags forced")
|
||||
|
||||
if( WITH_WARNINGS )
|
||||
set(WARNING_FLAGS "-W -Wall -Wextra -Winit-self -Winvalid-pch -Wfatal-errors")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -Woverloaded-virtual")
|
||||
message(STATUS "GCC: All warnings enabled")
|
||||
endif()
|
||||
|
||||
if( WITH_COREDEBUG )
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
|
||||
message(STATUS "GCC: Debug-flags set (-g3)")
|
||||
endif()
|
||||
63
modules/acore/cmake/compiler/msvc/settings.cmake
Normal file
63
modules/acore/cmake/compiler/msvc/settings.cmake
Normal file
@@ -0,0 +1,63 @@
|
||||
# set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
# set up output paths ofr static libraries etc (commented out - shown here as an example only)
|
||||
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
if(PLATFORM EQUAL 64)
|
||||
# This definition is necessary to work around a bug with Intellisense described
|
||||
# here: http://tinyurl.com/2cb428. Syntax highlighting is important for proper
|
||||
# debugger functionality.
|
||||
add_definitions("-D_WIN64")
|
||||
message(STATUS "MSVC: 64-bit platform, enforced -D_WIN64 parameter")
|
||||
|
||||
#Enable extended object support for debug compiles on X64 (not required on X86)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj")
|
||||
message(STATUS "MSVC: Enabled extended object-support for debug-compiles")
|
||||
else()
|
||||
# mark 32 bit executables large address aware so they can use > 2GB address space
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
|
||||
message(STATUS "MSVC: Enabled large address awareness")
|
||||
|
||||
add_definitions(/arch:SSE2)
|
||||
message(STATUS "MSVC: Enabled SSE2 support")
|
||||
endif()
|
||||
|
||||
# Set build-directive (used in core to tell which buildtype we used)
|
||||
add_definitions(-D_BUILD_DIRECTIVE=\\"$(ConfigurationName)\\")
|
||||
|
||||
# multithreaded compiling on VS
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
|
||||
# Define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES - eliminates the warning by changing the strcpy call to strcpy_s, which prevents buffer overruns
|
||||
add_definitions(-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES)
|
||||
message(STATUS "MSVC: Overloaded standard names")
|
||||
|
||||
# Ignore warnings about older, less secure functions
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
message(STATUS "MSVC: Disabled NON-SECURE warnings")
|
||||
|
||||
#Ignore warnings about POSIX deprecation
|
||||
add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
|
||||
message(STATUS "MSVC: Disabled POSIX warnings")
|
||||
|
||||
# disable warnings in Visual Studio 8 and above if not wanted
|
||||
if(NOT WITH_WARNINGS)
|
||||
if(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /wd4619")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996 /wd4355 /wd4244 /wd4985 /wd4267 /wd4619")
|
||||
message(STATUS "MSVC: Disabled generic compiletime warnings")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# 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, hence we need to set an upper limit with /Zm to avoid discrepancies)
|
||||
# (And yes, this is a verified , unresolved bug with MSVC... *sigh*)
|
||||
string(REGEX REPLACE "/Zm[0-9]+ *" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm500" CACHE STRING "" FORCE)
|
||||
|
||||
# Enable and treat as errors the following warnings to easily detect virtual function signature failures:
|
||||
# 'function' : member function does not override any base class virtual member function
|
||||
# 'virtual_function' : no override available for virtual member function from base 'class'; function is hidden
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /we4263 /we4264")
|
||||
83
modules/acore/cmake/genrev.cmake
Normal file
83
modules/acore/cmake/genrev.cmake
Normal file
@@ -0,0 +1,83 @@
|
||||
# Copyright (C) TrinityCore, AzerothCore
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
# User has manually chosen to ignore the git-tests, so throw them a warning.
|
||||
# This is done EACH compile so they can be alerted about the consequences.
|
||||
|
||||
if(NOT BUILDDIR)
|
||||
# Workaround for funny MSVC behaviour - this segment is only used when using cmake gui
|
||||
set(BUILDDIR ${CMAKE_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
if(WITHOUT_GIT)
|
||||
set(rev_date "1970-01-01 00:00:00 +0000")
|
||||
set(rev_hash "unknown")
|
||||
set(rev_branch "Archived")
|
||||
else()
|
||||
# Workaround for not correctly detecting git
|
||||
if (NOT GIT_EXECUTABLE)
|
||||
set(GIT_EXECUTABLE "git")
|
||||
endif()
|
||||
|
||||
if(GIT_EXECUTABLE)
|
||||
# Create a revision-string that we can use
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" describe --long --match 0.1 --dirty=+ --abbrev=12
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE rev_info
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
|
||||
)
|
||||
|
||||
# And grab the commits timestamp
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" show -s --format=%ci
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE rev_date
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
|
||||
# Also retrieve branch name
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" rev-parse --abbrev-ref HEAD
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE rev_branch
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
endif()
|
||||
|
||||
# Last minute check - ensure that we have a proper revision
|
||||
# If everything above fails (means the user has erased the git revision control directory or removed the origin/HEAD tag)
|
||||
if(NOT rev_info)
|
||||
# No valid ways available to find/set the revision/hash, so let's force some defaults
|
||||
message(STATUS "
|
||||
Could not find a proper repository signature (hash) - you may need to pull tags with git fetch -t
|
||||
Continuing anyway - note that the versionstring will be set to \"unknown 1970-01-01 00:00:00 (Archived)\"")
|
||||
set(rev_date "1970-01-01 00:00:00 +0000")
|
||||
set(rev_hash "unknown")
|
||||
set(rev_branch "Archived")
|
||||
else()
|
||||
# Extract information required to build a proper versionstring
|
||||
string(REGEX REPLACE 0.1-|[0-9]+-g "" rev_hash ${rev_info})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Create the actual revision.h file from the above params
|
||||
if(NOT "${rev_hash_cached}" MATCHES "${rev_hash}" OR NOT "${rev_branch_cached}" MATCHES "${rev_branch}" OR NOT EXISTS "${BUILDDIR}/revision_data.h")
|
||||
configure_file(
|
||||
"${CMAKE_SOURCE_DIR}/revision.h.in.cmake"
|
||||
"${BUILDDIR}/revision.h"
|
||||
@ONLY
|
||||
)
|
||||
set(rev_hash_cached "${rev_hash}" CACHE INTERNAL "Cached commit-hash")
|
||||
set(rev_branch_cached "${rev_branch}" CACHE INTERNAL "Cached branch name")
|
||||
endif()
|
||||
23
modules/acore/cmake/macros/CheckBuildDir.cmake
Normal file
23
modules/acore/cmake/macros/CheckBuildDir.cmake
Normal file
@@ -0,0 +1,23 @@
|
||||
# Copyright (C)
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
#
|
||||
# Force out-of-source build
|
||||
#
|
||||
|
||||
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" 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
|
||||
and run 'cmake path_to_project [options]' from there.
|
||||
")
|
||||
endif()
|
||||
18
modules/acore/cmake/macros/CheckPlatform.cmake
Normal file
18
modules/acore/cmake/macros/CheckPlatform.cmake
Normal file
@@ -0,0 +1,18 @@
|
||||
# check what platform we're on (64-bit or 32-bit), and create a simpler test than CMAKE_SIZEOF_VOID_P
|
||||
if(CMAKE_SIZEOF_VOID_P MATCHES 8)
|
||||
set(PLATFORM 64)
|
||||
MESSAGE(STATUS "Detected 64-bit platform")
|
||||
else()
|
||||
set(PLATFORM 32)
|
||||
MESSAGE(STATUS "Detected 32-bit platform")
|
||||
endif()
|
||||
|
||||
include("${CMAKE_SOURCE_DIR}/src/cmake/platform/settings.cmake")
|
||||
|
||||
if(WIN32)
|
||||
include("${CMAKE_SOURCE_DIR}/src/cmake/platform/win/settings.cmake")
|
||||
elseif(UNIX)
|
||||
include("${CMAKE_SOURCE_DIR}/src/cmake/platform/unix/settings.cmake")
|
||||
endif()
|
||||
|
||||
include("${CMAKE_SOURCE_DIR}/src/cmake/platform/after_platform.cmake")
|
||||
115
modules/acore/cmake/macros/EnsureVersion.cmake
Normal file
115
modules/acore/cmake/macros/EnsureVersion.cmake
Normal file
@@ -0,0 +1,115 @@
|
||||
# This file defines the following macros for developers to use in ensuring
|
||||
# that installed software is of the right version:
|
||||
#
|
||||
# ENSURE_VERSION - test that a version number is greater than
|
||||
# or equal to some minimum
|
||||
# ENSURE_VERSION_RANGE - test that a version number is greater than
|
||||
# or equal to some minimum and less than some
|
||||
# maximum
|
||||
# ENSURE_VERSION2 - deprecated, do not use in new code
|
||||
#
|
||||
|
||||
# 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)
|
||||
# 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)
|
||||
# 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) 2007, Will Stephenson <wstephenson@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
# ENSURE_VERSION_RANGE
|
||||
# This macro ensures that a version number of the form
|
||||
# "x.y.z" or "x.y" falls within a range defined by
|
||||
# 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 )
|
||||
#
|
||||
# This macro will break silently if any of x,y,z are greater than 100.
|
||||
#
|
||||
# Copyright (c) 2007, Will Stephenson <wstephenson@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
# NORMALIZE_VERSION
|
||||
# Helper macro to convert version numbers of the form "x.y.z"
|
||||
# to an integer equal to 10^4 * x + 10^2 * y + z
|
||||
#
|
||||
# This macro will break silently if any of x,y,z are greater than 100.
|
||||
#
|
||||
# Copyright (c) 2006, David Faure, <faure@kde.org>
|
||||
# Copyright (c) 2007, Will Stephenson <wstephenson@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
# CHECK_RANGE_INCLUSIVE_LOWER
|
||||
# Helper macro to check whether x <= y < z
|
||||
#
|
||||
# Copyright (c) 2007, Will Stephenson <wstephenson@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
|
||||
MACRO(NORMALIZE_VERSION _requested_version _normalized_version)
|
||||
STRING(REGEX MATCH "[^0-9]*[0-9]+\\.[0-9]+\\.[0-9]+.*" _threePartMatch "${_requested_version}")
|
||||
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)
|
||||
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)
|
||||
|
||||
# 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})
|
||||
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 )
|
||||
|
||||
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})
|
||||
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 )
|
||||
|
||||
CHECK_RANGE_INCLUSIVE_LOWER( ${req_vers_num} ${found_vers_num} ${max_vers_num} ${var_ok})
|
||||
ENDMACRO(ENSURE_VERSION_RANGE)
|
||||
84
modules/acore/cmake/macros/FindACE.cmake
Normal file
84
modules/acore/cmake/macros/FindACE.cmake
Normal file
@@ -0,0 +1,84 @@
|
||||
#
|
||||
# Find the ACE client includes and library
|
||||
#
|
||||
|
||||
# This module defines
|
||||
# ACE_INCLUDE_DIR, where to find ace.h
|
||||
# ACE_LIBRARIES, the libraries to link against
|
||||
# ACE_FOUND, if false, you cannot build anything that requires ACE
|
||||
|
||||
# also defined, but not for general use are
|
||||
# ACE_LIBRARY, where to find the ACE library.
|
||||
|
||||
set( ACE_FOUND 0 )
|
||||
|
||||
if ( UNIX )
|
||||
if (NOT ACE_INCLUDE_DIR)
|
||||
FIND_PATH( ACE_INCLUDE_DIR
|
||||
NAMES
|
||||
ace/ACE.h
|
||||
PATHS
|
||||
/usr/include
|
||||
/usr/include/ace
|
||||
/usr/local/include
|
||||
/usr/local/include/ace
|
||||
$ENV{ACE_ROOT}
|
||||
$ENV{ACE_ROOT}/ace
|
||||
$ENV{ACE_ROOT}/include
|
||||
${CMAKE_SOURCE_DIR}/externals/ace
|
||||
DOC
|
||||
"Specify include-directories that might contain ace.h here."
|
||||
)
|
||||
endif()
|
||||
|
||||
if (NOT ACE_LIBRARY)
|
||||
FIND_LIBRARY( ACE_LIBRARY
|
||||
NAMES
|
||||
ace ACE
|
||||
PATHS
|
||||
/usr/lib
|
||||
/usr/lib/ace
|
||||
/usr/local/lib
|
||||
/usr/local/lib/ace
|
||||
/usr/local/ace/lib
|
||||
$ENV{ACE_ROOT}/lib
|
||||
$ENV{ACE_ROOT}
|
||||
DOC "Specify library-locations that might contain the ACE library here."
|
||||
)
|
||||
|
||||
# FIND_LIBRARY( ACE_EXTRA_LIBRARIES
|
||||
# NAMES
|
||||
# z zlib
|
||||
# PATHS
|
||||
# /usr/lib
|
||||
# /usr/local/lib
|
||||
# DOC
|
||||
# "if more libraries are necessary to link into ACE, specify them here."
|
||||
# )
|
||||
endif()
|
||||
|
||||
if ( ACE_LIBRARY )
|
||||
if ( ACE_INCLUDE_DIR )
|
||||
if (_ACE_VERSION)
|
||||
set(ACE_VERSION "${_ACE_VERSION}")
|
||||
else (_ACE_VERSION)
|
||||
file(STRINGS "${ACE_INCLUDE_DIR}/ace/Version.h" ACE_VERSION_STR REGEX "^#define ACE_VERSION \".*\"")
|
||||
string(REGEX REPLACE "^.*ACE_VERSION \"([0-9].[0-9].[0-9a-z]).*$"
|
||||
"\\1" ACE_VERSION "${ACE_VERSION_STR}")
|
||||
endif (_ACE_VERSION)
|
||||
|
||||
include(EnsureVersion)
|
||||
ENSURE_VERSION( "${ACE_EXPECTED_VERSION}" "${ACE_VERSION}" ACE_FOUND)
|
||||
if (NOT ACE_FOUND)
|
||||
message(FATAL_ERROR "AzerothCore needs ACE version ${ACE_EXPECTED_VERSION} but found version ${ACE_VERSION}")
|
||||
endif()
|
||||
|
||||
message( STATUS "Found ACE library: ${ACE_LIBRARY}")
|
||||
message( STATUS "Found ACE headers: ${ACE_INCLUDE_DIR}")
|
||||
else ( ACE_INCLUDE_DIR )
|
||||
message(FATAL_ERROR "Could not find ACE headers! Please install ACE libraries and headers")
|
||||
endif ( ACE_INCLUDE_DIR )
|
||||
endif ( ACE_LIBRARY )
|
||||
|
||||
mark_as_advanced( ACE_FOUND ACE_LIBRARY ACE_EXTRA_LIBRARIES ACE_INCLUDE_DIR )
|
||||
endif (UNIX)
|
||||
46
modules/acore/cmake/macros/FindGit.cmake
Normal file
46
modules/acore/cmake/macros/FindGit.cmake
Normal file
@@ -0,0 +1,46 @@
|
||||
# Copyright (C)
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
include(${CMAKE_SOURCE_DIR}/src/cmake/macros/EnsureVersion.cmake)
|
||||
|
||||
set(_REQUIRED_GIT_VERSION "1.7")
|
||||
|
||||
find_program(GIT_EXECUTABLE
|
||||
NAMES
|
||||
git git.cmd
|
||||
HINTS
|
||||
ENV PATH
|
||||
DOC "Full path to git commandline client"
|
||||
)
|
||||
MARK_AS_ADVANCED(GIT_EXECUTABLE)
|
||||
|
||||
if(NOT GIT_EXECUTABLE)
|
||||
message(FATAL_ERROR "
|
||||
Git was NOT FOUND on your system - did you forget to install a recent version, or setting the path to it?
|
||||
Observe that for revision hash/date to work you need at least version ${_REQUIRED_GIT_VERSION}")
|
||||
else()
|
||||
message(STATUS "Found git binary : ${GIT_EXECUTABLE}")
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" --version
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE _GIT_VERSION
|
||||
ERROR_QUIET
|
||||
)
|
||||
|
||||
# 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)
|
||||
|
||||
# throw an error if we don't have a recent enough version of git...
|
||||
if(NOT _GIT_VERSION_OK)
|
||||
message(STATUS "Git version too old : ${_GIT_VERSION}")
|
||||
message(FATAL_ERROR "
|
||||
Git was found but is OUTDATED - did you forget to install a recent version, or setting the path to it?
|
||||
Observe that for revision hash/date to work you need at least version ${_REQUIRED_GIT_VERSION}")
|
||||
endif()
|
||||
endif()
|
||||
176
modules/acore/cmake/macros/FindMySQL.cmake
Normal file
176
modules/acore/cmake/macros/FindMySQL.cmake
Normal file
@@ -0,0 +1,176 @@
|
||||
#
|
||||
# Find the MySQL client includes and library
|
||||
#
|
||||
|
||||
# This module defines
|
||||
# MYSQL_INCLUDE_DIR, where to find mysql.h
|
||||
# MYSQL_LIBRARIES, the libraries to link against to connect to MySQL
|
||||
# MYSQL_FOUND, if false, you cannot build anything that requires MySQL.
|
||||
|
||||
# also defined, but not for general use are
|
||||
# MYSQL_LIBRARY, where to find the MySQL library.
|
||||
|
||||
set( MYSQL_FOUND 0 )
|
||||
|
||||
if( UNIX )
|
||||
set(MYSQL_CONFIG_PREFER_PATH "$ENV{MYSQL_HOME}/bin" CACHE FILEPATH
|
||||
"preferred path to MySQL (mysql_config)"
|
||||
)
|
||||
|
||||
find_program(MYSQL_CONFIG mysql_config
|
||||
${MYSQL_CONFIG_PREFER_PATH}
|
||||
/usr/local/mysql/bin/
|
||||
/usr/local/bin/
|
||||
/usr/bin/
|
||||
)
|
||||
|
||||
if( MYSQL_CONFIG )
|
||||
message(STATUS "Using mysql-config: ${MYSQL_CONFIG}")
|
||||
# set INCLUDE_DIR
|
||||
exec_program(${MYSQL_CONFIG}
|
||||
ARGS --include
|
||||
OUTPUT_VARIABLE MY_TMP
|
||||
)
|
||||
|
||||
string(REGEX REPLACE "-I([^ ]*)( .*)?" "\\1" MY_TMP "${MY_TMP}")
|
||||
set(MYSQL_ADD_INCLUDE_PATH ${MY_TMP} CACHE FILEPATH INTERNAL)
|
||||
#message("[DEBUG] MYSQL ADD_INCLUDE_PATH : ${MYSQL_ADD_INCLUDE_PATH}")
|
||||
# set LIBRARY_DIR
|
||||
exec_program(${MYSQL_CONFIG}
|
||||
ARGS --libs_r
|
||||
OUTPUT_VARIABLE MY_TMP
|
||||
)
|
||||
set(MYSQL_ADD_LIBRARIES "")
|
||||
string(REGEX MATCHALL "-l[^ ]*" MYSQL_LIB_LIST "${MY_TMP}")
|
||||
foreach(LIB ${MYSQL_LIB_LIST})
|
||||
string(REGEX REPLACE "[ ]*-l([^ ]*)" "\\1" LIB "${LIB}")
|
||||
list(APPEND MYSQL_ADD_LIBRARIES "${LIB}")
|
||||
#message("[DEBUG] MYSQL ADD_LIBRARIES : ${MYSQL_ADD_LIBRARIES}")
|
||||
endforeach(LIB ${MYSQL_LIB_LIST})
|
||||
|
||||
set(MYSQL_ADD_LIBRARIES_PATH "")
|
||||
string(REGEX MATCHALL "-L[^ ]*" MYSQL_LIBDIR_LIST "${MY_TMP}")
|
||||
foreach(LIB ${MYSQL_LIBDIR_LIST})
|
||||
string(REGEX REPLACE "[ ]*-L([^ ]*)" "\\1" LIB "${LIB}")
|
||||
list(APPEND MYSQL_ADD_LIBRARIES_PATH "${LIB}")
|
||||
#message("[DEBUG] MYSQL ADD_LIBRARIES_PATH : ${MYSQL_ADD_LIBRARIES_PATH}")
|
||||
endforeach(LIB ${MYSQL_LIBS})
|
||||
|
||||
else( MYSQL_CONFIG )
|
||||
set(MYSQL_ADD_LIBRARIES "")
|
||||
list(APPEND MYSQL_ADD_LIBRARIES "mysqlclient_r")
|
||||
endif( MYSQL_CONFIG )
|
||||
endif( UNIX )
|
||||
|
||||
find_path(MYSQL_INCLUDE_DIR
|
||||
NAMES
|
||||
mysql.h
|
||||
PATHS
|
||||
${MYSQL_ADD_INCLUDE_PATH}
|
||||
/usr/include
|
||||
/usr/include/mysql
|
||||
/usr/local/include
|
||||
/usr/local/include/mysql
|
||||
/usr/local/mysql/include
|
||||
"C:/Program Files/MySQL/MySQL Server 5.6/include"
|
||||
"C:/Program Files/MySQL/MySQL Server 5.5/include"
|
||||
"C:/Program Files/MySQL/MySQL Server 5.1/include"
|
||||
"C:/Program Files/MySQL/MySQL Server 5.0/include"
|
||||
"C:/Program Files/MySQL/include"
|
||||
"C:/MySQL/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.6;Location]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.5;Location]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.1;Location]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.6;Location]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.5;Location]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.1;Location]/include"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/include"
|
||||
"$ENV{ProgramFiles}/MySQL/*/include"
|
||||
"$ENV{SystemDrive}/MySQL/*/include"
|
||||
"c:/msys/local/include"
|
||||
DOC
|
||||
"Specify the directory containing mysql.h."
|
||||
)
|
||||
|
||||
if( UNIX )
|
||||
foreach(LIB ${MYSQL_ADD_LIBRARIES})
|
||||
find_library( MYSQL_LIBRARY
|
||||
NAMES
|
||||
mysql libmysql ${LIB}
|
||||
PATHS
|
||||
${MYSQL_ADD_LIBRARIES_PATH}
|
||||
/usr/lib
|
||||
/usr/lib/mysql
|
||||
/usr/local/lib
|
||||
/usr/local/lib/mysql
|
||||
/usr/local/mysql/lib
|
||||
DOC "Specify the location of the mysql library here."
|
||||
)
|
||||
endforeach(LIB ${MYSQL_ADD_LIBRARY})
|
||||
endif( UNIX )
|
||||
|
||||
if( WIN32 )
|
||||
find_library( MYSQL_LIBRARY
|
||||
NAMES
|
||||
libmysql
|
||||
PATHS
|
||||
${MYSQL_ADD_LIBRARIES_PATH}
|
||||
"C:/Program Files/MySQL/MySQL Server 5.6/lib/opt"
|
||||
"C:/Program Files/MySQL/MySQL Server 5.5/lib/opt"
|
||||
"C:/Program Files/MySQL/MySQL Server 5.1/lib/opt"
|
||||
"C:/Program Files/MySQL/MySQL Server 5.0/lib/opt"
|
||||
"C:/Program Files/MySQL/lib"
|
||||
"C:/MySQL/lib/debug"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.6;Location]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.6;Location]/lib/opt"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.5;Location]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.5;Location]/lib/opt"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.1;Location]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.1;Location]/lib/opt"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/lib/opt"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.6;Location]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.6;Location]/lib/opt"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.5;Location]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.5;Location]/lib/opt"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.1;Location]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.1;Location]/lib/opt"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/lib"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/lib/opt"
|
||||
"$ENV{ProgramFiles}/MySQL/*/lib/opt"
|
||||
"$ENV{SystemDrive}/MySQL/*/lib/opt"
|
||||
"c:/msys/local/include"
|
||||
DOC "Specify the location of the mysql library here."
|
||||
)
|
||||
endif( WIN32 )
|
||||
|
||||
# On Windows you typically don't need to include any extra libraries
|
||||
# to build MYSQL stuff.
|
||||
|
||||
if( NOT WIN32 )
|
||||
find_library( MYSQL_EXTRA_LIBRARIES
|
||||
NAMES
|
||||
z zlib
|
||||
PATHS
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
DOC
|
||||
"if more libraries are necessary to link in a MySQL client (typically zlib), specify them here."
|
||||
)
|
||||
else( NOT WIN32 )
|
||||
set( MYSQL_EXTRA_LIBRARIES "" )
|
||||
endif( NOT WIN32 )
|
||||
|
||||
if( MYSQL_LIBRARY )
|
||||
if( MYSQL_INCLUDE_DIR )
|
||||
set( MYSQL_FOUND 1 )
|
||||
message(STATUS "Found MySQL library: ${MYSQL_LIBRARY}")
|
||||
message(STATUS "Found MySQL headers: ${MYSQL_INCLUDE_DIR}")
|
||||
else( MYSQL_INCLUDE_DIR )
|
||||
message(FATAL_ERROR "Could not find MySQL headers! Please install the development libraries and headers")
|
||||
endif( MYSQL_INCLUDE_DIR )
|
||||
mark_as_advanced( MYSQL_FOUND MYSQL_LIBRARY MYSQL_EXTRA_LIBRARIES MYSQL_INCLUDE_DIR )
|
||||
else( MYSQL_LIBRARY )
|
||||
message(FATAL_ERROR "Could not find the MySQL libraries! Please install the development libraries and headers")
|
||||
endif( MYSQL_LIBRARY )
|
||||
180
modules/acore/cmake/macros/FindOpenSSL.cmake
Normal file
180
modules/acore/cmake/macros/FindOpenSSL.cmake
Normal file
@@ -0,0 +1,180 @@
|
||||
# - Try to find the OpenSSL encryption library
|
||||
# Once done this will define
|
||||
#
|
||||
# OPENSSL_ROOT_DIR - Set this variable to the root installation of OpenSSL
|
||||
#
|
||||
# Read-Only variables:
|
||||
# OPENSSL_FOUND - system has the OpenSSL library
|
||||
# OPENSSL_INCLUDE_DIR - the OpenSSL include directory
|
||||
# OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2006-2009 Kitware, Inc.
|
||||
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
|
||||
# Copyright 2009-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com>
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distributed this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# http://www.slproweb.com/products/Win32OpenSSL.html
|
||||
|
||||
SET(_OPENSSL_ROOT_HINTS
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
|
||||
)
|
||||
|
||||
IF(PLATFORM EQUAL 64)
|
||||
SET(_OPENSSL_ROOT_PATHS
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;InstallLocation]"
|
||||
"C:/OpenSSL-Win64/"
|
||||
"C:/OpenSSL/"
|
||||
)
|
||||
ELSE()
|
||||
SET(_OPENSSL_ROOT_PATHS
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]"
|
||||
"C:/OpenSSL/"
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
FIND_PATH(OPENSSL_ROOT_DIR
|
||||
NAMES
|
||||
include/openssl/ssl.h
|
||||
HINTS
|
||||
${_OPENSSL_ROOT_HINTS}
|
||||
PATHS
|
||||
${_OPENSSL_ROOT_PATHS}
|
||||
)
|
||||
MARK_AS_ADVANCED(OPENSSL_ROOT_DIR)
|
||||
|
||||
# Re-use the previous path:
|
||||
FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h
|
||||
${OPENSSL_ROOT_DIR}/include
|
||||
)
|
||||
|
||||
IF(WIN32 AND NOT CYGWIN)
|
||||
# MINGW should go here too
|
||||
IF(MSVC)
|
||||
# /MD and /MDd are the standard values - if someone wants to use
|
||||
# others, the libnames have to change here too
|
||||
# use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
|
||||
# TODO: handle /MT and static lib
|
||||
# In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix:
|
||||
# * MD for dynamic-release
|
||||
# * MDd for dynamic-debug
|
||||
# * MT for static-release
|
||||
# * MTd for static-debug
|
||||
|
||||
# Implementation details:
|
||||
# We are using the libraries located in the VC subdir instead of the parent directory eventhough :
|
||||
# libeay32MD.lib is identical to ../libeay32.lib, and
|
||||
# ssleay32MD.lib is identical to ../ssleay32.lib
|
||||
|
||||
FIND_LIBRARY(LIB_EAY_DEBUG
|
||||
NAMES
|
||||
libeay32MDd libeay32
|
||||
PATHS
|
||||
${OPENSSL_ROOT_DIR}/lib/VC
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LIB_EAY_RELEASE
|
||||
NAMES
|
||||
libeay32MD libeay32
|
||||
PATHS
|
||||
${OPENSSL_ROOT_DIR}/lib/VC
|
||||
)
|
||||
|
||||
FIND_LIBRARY(SSL_EAY_DEBUG
|
||||
NAMES
|
||||
ssleay32MDd ssleay32 ssl
|
||||
PATHS
|
||||
${OPENSSL_ROOT_DIR}/lib/VC
|
||||
)
|
||||
|
||||
FIND_LIBRARY(SSL_EAY_RELEASE
|
||||
NAMES
|
||||
ssleay32MD ssleay32 ssl
|
||||
PATHS
|
||||
${OPENSSL_ROOT_DIR}/lib/VC
|
||||
)
|
||||
|
||||
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
|
||||
set( OPENSSL_LIBRARIES
|
||||
optimized ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE}
|
||||
debug ${SSL_EAY_DEBUG} ${LIB_EAY_DEBUG}
|
||||
)
|
||||
else()
|
||||
set( OPENSSL_LIBRARIES
|
||||
${SSL_EAY_RELEASE}
|
||||
${LIB_EAY_RELEASE}
|
||||
)
|
||||
endif()
|
||||
|
||||
MARK_AS_ADVANCED(SSL_EAY_DEBUG SSL_EAY_RELEASE LIB_EAY_DEBUG LIB_EAY_RELEASE)
|
||||
ELSEIF(MINGW)
|
||||
|
||||
# same player, for MingW
|
||||
FIND_LIBRARY(LIB_EAY
|
||||
NAMES
|
||||
libeay32
|
||||
PATHS
|
||||
${OPENSSL_ROOT_DIR}/lib/MinGW
|
||||
)
|
||||
|
||||
FIND_LIBRARY(SSL_EAY NAMES
|
||||
NAMES
|
||||
ssleay32
|
||||
PATHS
|
||||
${OPENSSL_ROOT_DIR}/lib/MinGW
|
||||
)
|
||||
|
||||
MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
|
||||
|
||||
set( OPENSSL_LIBRARIES
|
||||
${SSL_EAY}
|
||||
${LIB_EAY}
|
||||
)
|
||||
ELSE(MSVC)
|
||||
# Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
|
||||
FIND_LIBRARY(LIB_EAY
|
||||
NAMES
|
||||
libeay32
|
||||
PATHS
|
||||
${OPENSSL_ROOT_DIR}/lib
|
||||
${OPENSSL_ROOT_DIR}/lib/VC
|
||||
)
|
||||
|
||||
FIND_LIBRARY(SSL_EAY
|
||||
NAMES
|
||||
ssleay32
|
||||
PATHS
|
||||
${OPENSSL_ROOT_DIR}/lib
|
||||
${OPENSSL_ROOT_DIR}/lib/VC
|
||||
)
|
||||
MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
|
||||
|
||||
SET( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
|
||||
ENDIF(MSVC)
|
||||
ELSE(WIN32 AND NOT CYGWIN)
|
||||
FIND_LIBRARY(OPENSSL_SSL_LIBRARIES NAMES ssl ssleay32 ssleay32MD)
|
||||
FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARIES NAMES crypto)
|
||||
MARK_AS_ADVANCED(OPENSSL_CRYPTO_LIBRARIES OPENSSL_SSL_LIBRARIES)
|
||||
|
||||
SET(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARIES})
|
||||
|
||||
ENDIF(WIN32 AND NOT CYGWIN)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(OpenSSL DEFAULT_MSG
|
||||
OPENSSL_LIBRARIES
|
||||
OPENSSL_INCLUDE_DIR
|
||||
)
|
||||
|
||||
MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
|
||||
104
modules/acore/cmake/macros/FindPCHSupport.cmake
Normal file
104
modules/acore/cmake/macros/FindPCHSupport.cmake
Normal file
@@ -0,0 +1,104 @@
|
||||
FUNCTION(GET_COMMON_PCH_PARAMS PCH_HEADER PCH_FE INCLUDE_PREFIX)
|
||||
GET_FILENAME_COMPONENT(PCH_HEADER_N ${PCH_HEADER} NAME)
|
||||
GET_DIRECTORY_PROPERTY(TARGET_INCLUDES INCLUDE_DIRECTORIES)
|
||||
|
||||
FOREACH(ITEM ${TARGET_INCLUDES})
|
||||
LIST(APPEND INCLUDE_FLAGS_LIST "${INCLUDE_PREFIX}\"${ITEM}\" ")
|
||||
ENDFOREACH(ITEM)
|
||||
|
||||
SET(PCH_HEADER_NAME ${PCH_HEADER_N} PARENT_SCOPE)
|
||||
SET(PCH_HEADER_OUT ${CMAKE_CURRENT_BINARY_DIR}/${PCH_HEADER_N}.${PCH_FE} PARENT_SCOPE)
|
||||
SET(INCLUDE_FLAGS ${INCLUDE_FLAGS_LIST} PARENT_SCOPE)
|
||||
ENDFUNCTION(GET_COMMON_PCH_PARAMS)
|
||||
|
||||
FUNCTION(GENERATE_CXX_PCH_COMMAND TARGET_NAME INCLUDE_FLAGS IN PCH_SRC OUT)
|
||||
IF (CMAKE_BUILD_TYPE)
|
||||
STRING(TOUPPER _${CMAKE_BUILD_TYPE} CURRENT_BUILD_TYPE)
|
||||
ENDIF ()
|
||||
|
||||
SET(COMPILE_FLAGS ${CMAKE_CXX_FLAGS${CURRENT_BUILD_TYPE}})
|
||||
LIST(APPEND COMPILE_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
|
||||
IF ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
|
||||
IF (NOT "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
|
||||
LIST(APPEND COMPILE_FLAGS "-arch ${CMAKE_OSX_ARCHITECTURES}")
|
||||
ENDIF ()
|
||||
IF (NOT "${CMAKE_OSX_SYSROOT}" STREQUAL "")
|
||||
LIST(APPEND COMPILE_FLAGS "-isysroot ${CMAKE_OSX_SYSROOT}")
|
||||
ENDIF ()
|
||||
IF (NOT "${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "")
|
||||
LIST(APPEND COMPILE_FLAGS "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
|
||||
GET_DIRECTORY_PROPERTY(TARGET_DEFINITIONS COMPILE_DEFINITIONS)
|
||||
FOREACH(ITEM ${TARGET_DEFINITIONS})
|
||||
LIST(APPEND DEFINITION_FLAGS "-D${ITEM} ")
|
||||
ENDFOREACH(ITEM)
|
||||
|
||||
SEPARATE_ARGUMENTS(COMPILE_FLAGS)
|
||||
SEPARATE_ARGUMENTS(INCLUDE_FLAGS)
|
||||
SEPARATE_ARGUMENTS(DEFINITION_FLAGS)
|
||||
|
||||
GET_FILENAME_COMPONENT(PCH_SRC_N ${PCH_SRC} NAME)
|
||||
ADD_LIBRARY(${PCH_SRC_N}_dephelp MODULE ${PCH_SRC})
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${OUT}
|
||||
COMMAND ${CMAKE_CXX_COMPILER}
|
||||
ARGS ${DEFINITION_FLAGS} ${COMPILE_FLAGS} ${INCLUDE_FLAGS} -x c++-header ${IN} -o ${OUT}
|
||||
DEPENDS ${IN} ${PCH_SRC_N}_dephelp
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
ADD_CUSTOM_TARGET(generate_${PCH_SRC_N}
|
||||
DEPENDS ${OUT}
|
||||
)
|
||||
|
||||
ADD_DEPENDENCIES(${TARGET_NAME} generate_${PCH_SRC_N})
|
||||
ENDFUNCTION(GENERATE_CXX_PCH_COMMAND)
|
||||
|
||||
FUNCTION(ADD_CXX_PCH_GCC TARGET_NAME PCH_HEADER PCH_SOURCE)
|
||||
GET_COMMON_PCH_PARAMS(${PCH_HEADER} "gch" "-I")
|
||||
GENERATE_CXX_PCH_COMMAND(${TARGET_NAME} "${INCLUDE_FLAGS}" ${PCH_HEADER} ${PCH_SOURCE} ${PCH_HEADER_OUT})
|
||||
SET_TARGET_PROPERTIES(
|
||||
${TARGET_NAME} PROPERTIES
|
||||
COMPILE_FLAGS "-include ${CMAKE_CURRENT_BINARY_DIR}/${PCH_HEADER_NAME}"
|
||||
)
|
||||
ENDFUNCTION(ADD_CXX_PCH_GCC)
|
||||
|
||||
FUNCTION(ADD_CXX_PCH_CLANG TARGET_NAME PCH_HEADER PCH_SOURCE)
|
||||
GET_COMMON_PCH_PARAMS(${PCH_HEADER} "pch" "-I")
|
||||
GENERATE_CXX_PCH_COMMAND(${TARGET_NAME} "${INCLUDE_FLAGS}" ${PCH_HEADER} ${PCH_SOURCE} ${PCH_HEADER_OUT})
|
||||
SET_TARGET_PROPERTIES(
|
||||
${TARGET_NAME} PROPERTIES
|
||||
COMPILE_FLAGS "-include-pch ${PCH_HEADER_OUT}"
|
||||
)
|
||||
ENDFUNCTION(ADD_CXX_PCH_CLANG)
|
||||
|
||||
FUNCTION(ADD_CXX_PCH_MSVC TARGET_NAME PCH_HEADER PCH_SOURCE)
|
||||
GET_COMMON_PCH_PARAMS(${PCH_HEADER} "pch" "/I")
|
||||
SET_TARGET_PROPERTIES(
|
||||
${TARGET_NAME} PROPERTIES
|
||||
COMPILE_FLAGS "/FI${PCH_HEADER_NAME} /Yu${PCH_HEADER_NAME}"
|
||||
)
|
||||
SET_SOURCE_FILES_PROPERTIES(
|
||||
${PCH_SOURCE} PROPERTIES
|
||||
COMPILE_FLAGS "/Yc${PCH_HEADER_NAME}"
|
||||
)
|
||||
ENDFUNCTION(ADD_CXX_PCH_MSVC)
|
||||
|
||||
FUNCTION(ADD_CXX_PCH TARGET_NAME PCH_HEADER PCH_SOURCE)
|
||||
IF (MSVC)
|
||||
ADD_CXX_PCH_MSVC(${TARGET_NAME} ${PCH_HEADER} ${PCH_SOURCE})
|
||||
ELSEIF ("${CMAKE_GENERATOR}" MATCHES "Xcode")
|
||||
SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
|
||||
XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER YES
|
||||
XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/${PCH_HEADER}"
|
||||
)
|
||||
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
ADD_CXX_PCH_CLANG(${TARGET_NAME} ${PCH_HEADER} ${PCH_SOURCE})
|
||||
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
||||
ADD_CXX_PCH_GCC(${TARGET_NAME} ${PCH_HEADER} ${PCH_SOURCE})
|
||||
ENDIF ()
|
||||
ENDFUNCTION(ADD_CXX_PCH)
|
||||
18
modules/acore/cmake/macros/FindReadline.cmake
Normal file
18
modules/acore/cmake/macros/FindReadline.cmake
Normal file
@@ -0,0 +1,18 @@
|
||||
# find Readline (terminal input library) includes and library
|
||||
#
|
||||
# READLINE_INCLUDE_DIR - where the directory containing the READLINE headers can be found
|
||||
# READLINE_LIBRARY - full path to the READLINE library
|
||||
# READLINE_FOUND - TRUE if READLINE was found
|
||||
|
||||
FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h)
|
||||
FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
|
||||
|
||||
IF (READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
|
||||
SET(READLINE_FOUND TRUE)
|
||||
MESSAGE(STATUS "Found Readline library: ${READLINE_LIBRARY}")
|
||||
MESSAGE(STATUS "Include dir is: ${READLINE_INCLUDE_DIR}")
|
||||
INCLUDE_DIRECTORIES(${READLINE_INCLUDE_DIR})
|
||||
ELSE (READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
|
||||
SET(READLINE_FOUND FALSE)
|
||||
MESSAGE(FATAL_ERROR "** Readline library not found!\n** Your distro may provide a binary for Readline e.g. for ubuntu try apt-get install libreadline5-dev")
|
||||
ENDIF (READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
|
||||
21
modules/acore/cmake/macros/ScriptsMacro.cmake
Normal file
21
modules/acore/cmake/macros/ScriptsMacro.cmake
Normal file
@@ -0,0 +1,21 @@
|
||||
#
|
||||
# AC_ADD_SCRIPT
|
||||
#
|
||||
MACRO(AC_ADD_SCRIPT path)
|
||||
CU_ADD_GLOBAL("AC_SCRIPTS_SOURCES" "${path}")
|
||||
ENDMACRO()
|
||||
|
||||
#
|
||||
# AC_ADD_SCRIPT_LOADER
|
||||
#
|
||||
MACRO(AC_ADD_SCRIPT_LOADER script_dec include)
|
||||
CU_ADD_GLOBAL("AC_ADD_SCRIPTS_LIST" "Add${script_dec}Scripts()\;")
|
||||
|
||||
|
||||
if (NOT ${include} STREQUAL "")
|
||||
CU_GET_GLOBAL("AC_ADD_SCRIPTS_INCLUDE")
|
||||
if (NOT ";${AC_ADD_SCRIPTS_INCLUDE};" MATCHES ";${include};")
|
||||
CU_ADD_GLOBAL("AC_ADD_SCRIPTS_INCLUDE" "${include}\;")
|
||||
endif()
|
||||
endif()
|
||||
ENDMACRO()
|
||||
4
modules/acore/cmake/platform/after_platform.cmake
Normal file
4
modules/acore/cmake/platform/after_platform.cmake
Normal file
@@ -0,0 +1,4 @@
|
||||
if( NOT CONF_DIR )
|
||||
set(CONF_DIR ${CMAKE_INSTALL_PREFIX})
|
||||
message(STATUS "Using installation path for configuration files")
|
||||
endif()
|
||||
23
modules/acore/cmake/platform/cmake_uninstall.in.cmake
Normal file
23
modules/acore/cmake/platform/cmake_uninstall.in.cmake
Normal file
@@ -0,0 +1,23 @@
|
||||
# from cmake wiki
|
||||
IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
|
||||
ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
|
||||
FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||
STRING(REGEX REPLACE "\n" ";" files "${files}")
|
||||
FOREACH(file ${files})
|
||||
MESSAGE(STATUS "Uninstalling \"${file}\"")
|
||||
IF(EXISTS "${file}")
|
||||
EXEC_PROGRAM(
|
||||
"@CMAKE_COMMAND@" ARGS "-E remove \"${file}\""
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval
|
||||
)
|
||||
IF("${rm_retval}" STREQUAL 0)
|
||||
ELSE("${rm_retval}" STREQUAL 0)
|
||||
MESSAGE(FATAL_ERROR "Problem when removing \"${file}\"")
|
||||
ENDIF("${rm_retval}" STREQUAL 0)
|
||||
ELSE(EXISTS "${file}")
|
||||
MESSAGE(STATUS "File \"${file}\" does not exist.")
|
||||
ENDIF(EXISTS "${file}")
|
||||
ENDFOREACH(file)
|
||||
5
modules/acore/cmake/platform/settings.cmake
Normal file
5
modules/acore/cmake/platform/settings.cmake
Normal file
@@ -0,0 +1,5 @@
|
||||
# set installation prefix
|
||||
if( PREFIX )
|
||||
set(CMAKE_INSTALL_PREFIX "${PREFIX}")
|
||||
endif()
|
||||
|
||||
44
modules/acore/cmake/platform/unix/settings.cmake
Normal file
44
modules/acore/cmake/platform/unix/settings.cmake
Normal file
@@ -0,0 +1,44 @@
|
||||
# Package overloads - Linux
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
if (NOT NOJEM)
|
||||
set(JEMALLOC_LIBRARY "jemalloc")
|
||||
message(STATUS "UNIX: Using jemalloc")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# set default configuration directory
|
||||
if( NOT CONF_DIR )
|
||||
set(CONF_DIR ${CMAKE_INSTALL_PREFIX}/etc)
|
||||
message(STATUS "UNIX: Using default configuration directory")
|
||||
endif()
|
||||
|
||||
# set default library directory
|
||||
if( NOT LIBSDIR )
|
||||
set(LIBSDIR ${CMAKE_INSTALL_PREFIX}/lib)
|
||||
message(STATUS "UNIX: Using default library directory")
|
||||
endif()
|
||||
|
||||
# configure uninstaller
|
||||
configure_file(
|
||||
"${CMAKE_SOURCE_DIR}/src/cmake/platform/cmake_uninstall.in.cmake"
|
||||
"${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
@ONLY
|
||||
)
|
||||
message(STATUS "UNIX: Configuring uninstall target")
|
||||
|
||||
# create uninstaller target (allows for using "make uninstall")
|
||||
add_custom_target(uninstall
|
||||
"${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
)
|
||||
message(STATUS "UNIX: Created uninstall target")
|
||||
|
||||
message(STATUS "UNIX: Detected compiler: ${CMAKE_C_COMPILER}")
|
||||
if(CMAKE_C_COMPILER MATCHES "gcc" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
include(${CMAKE_SOURCE_DIR}/src/cmake/compiler/gcc/settings.cmake)
|
||||
elseif(CMAKE_C_COMPILER MATCHES "icc")
|
||||
include(${CMAKE_SOURCE_DIR}/src/cmake/compiler/icc/settings.cmake)
|
||||
elseif(CMAKE_C_COMPILER MATCHES "clang")
|
||||
include(${CMAKE_SOURCE_DIR}/src/cmake/compiler/clang/settings.cmake)
|
||||
else()
|
||||
add_definitions(-D_BUILD_DIRECTIVE='"${CMAKE_BUILD_TYPE}"')
|
||||
endif()
|
||||
32
modules/acore/cmake/platform/win/settings.cmake
Normal file
32
modules/acore/cmake/platform/win/settings.cmake
Normal file
@@ -0,0 +1,32 @@
|
||||
# Platform-specfic options
|
||||
option(USE_MYSQL_SOURCES "Use included MySQL-sources to build libraries" 1)
|
||||
|
||||
# Package overloads
|
||||
set(ACE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/modules/acore/deps/acelite)
|
||||
set(ACE_LIBRARY "ace")
|
||||
set(BZIP2_LIBRARIES "bzip2")
|
||||
set(ZLIB_LIBRARIES "zlib")
|
||||
|
||||
if( USE_MYSQL_SOURCES )
|
||||
set(MYSQL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/modules/acore/deps/mysqllite/include)
|
||||
set(MYSQL_LIBRARY "libmysql")
|
||||
set( MYSQL_FOUND 1 )
|
||||
message(STATUS "Using supplied MySQL sources")
|
||||
endif()
|
||||
|
||||
# check the CMake preload parameters (commented out by default)
|
||||
|
||||
# overload CMAKE_INSTALL_PREFIX if not being set properly
|
||||
#if( WIN32 )
|
||||
# if( NOT CYGWIN )
|
||||
# if( NOT CMAKE_INSTALL_PREFIX )
|
||||
# set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/bin")
|
||||
# endif()
|
||||
# endif()
|
||||
#endif()
|
||||
|
||||
if ( MSVC )
|
||||
include(${CMAKE_SOURCE_DIR}/src/cmake/compiler/msvc/settings.cmake)
|
||||
elseif ( MINGW )
|
||||
include(${CMAKE_SOURCE_DIR}/src/cmake/compiler/mingw/settings.cmake)
|
||||
endif()
|
||||
100
modules/acore/cmake/showoptions.cmake
Normal file
100
modules/acore/cmake/showoptions.cmake
Normal file
@@ -0,0 +1,100 @@
|
||||
# output generic information about the core and buildtype chosen
|
||||
message("")
|
||||
message("* AzerothCore revision : ${rev_hash} ${rev_date} (${rev_branch} branch)")
|
||||
if( UNIX )
|
||||
message("* AzerothCore buildtype : ${CMAKE_BUILD_TYPE}")
|
||||
endif()
|
||||
message("")
|
||||
|
||||
# output information about installation-directories and locations
|
||||
|
||||
message("* Install core to : ${CMAKE_INSTALL_PREFIX}")
|
||||
if( UNIX )
|
||||
message("* Install libraries to : ${LIBSDIR}")
|
||||
endif()
|
||||
|
||||
message("* Install configs to : ${CONF_DIR}")
|
||||
add_definitions(-D_CONF_DIR="\\"${CONF_DIR}\\"")
|
||||
|
||||
message("")
|
||||
|
||||
# Show infomation about the options selected during configuration
|
||||
|
||||
if( SERVERS )
|
||||
message("* Build world/auth : Yes (default)")
|
||||
else()
|
||||
message("* Build world/authserver : No")
|
||||
endif()
|
||||
|
||||
if( SCRIPTS )
|
||||
message("* Build with scripts : Yes (default)")
|
||||
add_definitions(-DSCRIPTS)
|
||||
else()
|
||||
message("* Build with scripts : No")
|
||||
endif()
|
||||
|
||||
if( TOOLS )
|
||||
message("* Build map/vmap tools : Yes")
|
||||
add_definitions(-DNO_CORE_FUNCS)
|
||||
else()
|
||||
message("* Build map/vmap tools : No (default)")
|
||||
endif()
|
||||
|
||||
if( USE_COREPCH )
|
||||
message("* Build core w/PCH : Yes (default)")
|
||||
else()
|
||||
message("* Build core w/PCH : No")
|
||||
endif()
|
||||
|
||||
if( USE_SCRIPTPCH )
|
||||
message("* Build scripts w/PCH : Yes (default)")
|
||||
else()
|
||||
message("* Build scripts w/PCH : No")
|
||||
endif()
|
||||
|
||||
if( WITH_WARNINGS )
|
||||
message("* Show all warnings : Yes")
|
||||
else()
|
||||
message("* Show compile-warnings : No (default)")
|
||||
endif()
|
||||
|
||||
if( WITH_COREDEBUG )
|
||||
message("* Use coreside debug : Yes")
|
||||
add_definitions(-DTRINITY_DEBUG)
|
||||
else()
|
||||
message("* Use coreside debug : No (default)")
|
||||
endif()
|
||||
|
||||
if( WIN32 )
|
||||
if( USE_MYSQL_SOURCES )
|
||||
message("* Use MySQL sourcetree : Yes (default)")
|
||||
else()
|
||||
message("* Use MySQL sourcetree : No")
|
||||
endif()
|
||||
endif( WIN32 )
|
||||
|
||||
if ( WITHOUT_GIT )
|
||||
message("* Use GIT revision hash : No")
|
||||
message("")
|
||||
message(" *** WITHOUT_GIT - WARNING!")
|
||||
message(" *** By choosing the WITHOUT_GIT option you have waived all rights for support,")
|
||||
message(" *** and accept that or all requests for support or assistance sent to the core")
|
||||
message(" *** developers will be rejected. This due to that we will be unable to detect")
|
||||
message(" *** what revision of the codebase you are using in a proper way.")
|
||||
message(" *** We remind you that you need to use the repository codebase and a supported")
|
||||
message(" *** version of git for the revision-hash to work, and be allowede to ask for")
|
||||
message(" *** support if needed.")
|
||||
else()
|
||||
message("* Use GIT revision hash : Yes")
|
||||
endif()
|
||||
|
||||
if ( NOJEM )
|
||||
message("")
|
||||
message(" *** NOJEM - WARNING!")
|
||||
message(" *** jemalloc linking has been disabled!")
|
||||
message(" *** Please note that this is for DEBUGGING WITH VALGRIND only!")
|
||||
message(" *** DO NOT DISABLE IT UNLESS YOU KNOW WHAT YOU'RE DOING!")
|
||||
endif()
|
||||
|
||||
message("")
|
||||
|
||||
31
modules/acore/cmake/stack_direction.c
Normal file
31
modules/acore/cmake/stack_direction.c
Normal file
@@ -0,0 +1,31 @@
|
||||
/* Copyright (C) 2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/* Check stack direction (0-down, 1-up) */
|
||||
int f(int *a)
|
||||
{
|
||||
int b;
|
||||
return(&b > a)?1:0;
|
||||
}
|
||||
/*
|
||||
Prevent compiler optimizations by calling function
|
||||
through pointer.
|
||||
*/
|
||||
volatile int (*ptr_f)(int *) = f;
|
||||
int main()
|
||||
{
|
||||
int a;
|
||||
return ptr_f(&a);
|
||||
}
|
||||
15
modules/acore/genrev/CMakeLists.txt
Normal file
15
modules/acore/genrev/CMakeLists.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
# Copyright (C)
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
# Need to pass old ${CMAKE_BINARY_DIR} as param because its different at build stage
|
||||
add_custom_target(revision.h ALL
|
||||
COMMAND ${CMAKE_COMMAND} -DBUILDDIR=${CMAKE_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/src/cmake/genrev.cmake
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
1
modules/skeleton-module
Submodule
1
modules/skeleton-module
Submodule
Submodule modules/skeleton-module added at 8c48569be1
Reference in New Issue
Block a user