diff options
author | Yehonal <hw.2@hotmail.it> | 2016-07-08 23:58:11 +0200 |
---|---|---|
committer | Yehonal <hw.2@hotmail.it> | 2016-07-08 23:58:11 +0200 |
commit | 9fd22872c0e5f52ad47f8cd002111489738b7dda (patch) | |
tree | 4df701d097ff76cc566693979994b5befed3bc8d /src | |
parent | eda1171939b6d7d951aef2da5b4bbb4e926c1f4a (diff) |
restructured repository based on following standards:
https://github.com/HW-Core/directory-structure
Diffstat (limited to 'src')
33 files changed, 1254 insertions, 53 deletions
diff --git a/src/cmake/compiler/clang/settings.cmake b/src/cmake/compiler/clang/settings.cmake new file mode 100644 index 0000000000..ae07b1fc39 --- /dev/null +++ b/src/cmake/compiler/clang/settings.cmake @@ -0,0 +1,15 @@ +# 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() diff --git a/src/cmake/compiler/gcc/settings.cmake b/src/cmake/compiler/gcc/settings.cmake new file mode 100644 index 0000000000..25ee96c856 --- /dev/null +++ b/src/cmake/compiler/gcc/settings.cmake @@ -0,0 +1,24 @@ +# 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() diff --git a/src/cmake/compiler/icc/settings.cmake b/src/cmake/compiler/icc/settings.cmake new file mode 100644 index 0000000000..133bc15e59 --- /dev/null +++ b/src/cmake/compiler/icc/settings.cmake @@ -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() diff --git a/src/cmake/compiler/mingw/settings.cmake b/src/cmake/compiler/mingw/settings.cmake new file mode 100644 index 0000000000..68156bd0b6 --- /dev/null +++ b/src/cmake/compiler/mingw/settings.cmake @@ -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() diff --git a/src/cmake/compiler/msvc/settings.cmake b/src/cmake/compiler/msvc/settings.cmake new file mode 100644 index 0000000000..f303b6ed76 --- /dev/null +++ b/src/cmake/compiler/msvc/settings.cmake @@ -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") diff --git a/src/cmake/genrev.cmake b/src/cmake/genrev.cmake new file mode 100644 index 0000000000..23a72aa27b --- /dev/null +++ b/src/cmake/genrev.cmake @@ -0,0 +1,41 @@ +# 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") + +# Its not set during initial run +if(NOT BUILDDIR) + set(BUILDDIR ${CMAKE_BINARY_DIR}) +endif() + +FIND_PROGRAM(SVN_EXECUTABLE svn DOC "subversion command line client") + +# only do this if we have an svn client. +if (SVN_EXECUTABLE) + MACRO(Subversion_GET_REVISION dir variable) + EXECUTE_PROCESS(COMMAND ${SVN_EXECUTABLE} info ${dir} + OUTPUT_VARIABLE ${variable} + OUTPUT_STRIP_TRAILING_WHITESPACE) + STRING(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*" + "\\2" ${variable} "${${variable}}") + ENDMACRO(Subversion_GET_REVISION) + + Subversion_GET_REVISION(${CMAKE_SOURCE_DIR} REV2) +endif () + + set(rev_hash_str ${REV2}) + set(rev_hash ${REV2}) + set(rev_id_str ${REV2}) + set(rev_id ${REV2}) + + + configure_file ( ${CMAKE_SOURCE_DIR}/revision.h.in.cmake ${BUILDDIR}/revision.h ) diff --git a/src/cmake/macros/CheckBuildDir.cmake b/src/cmake/macros/CheckBuildDir.cmake new file mode 100644 index 0000000000..085ca32746 --- /dev/null +++ b/src/cmake/macros/CheckBuildDir.cmake @@ -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() diff --git a/src/cmake/macros/CheckPlatform.cmake b/src/cmake/macros/CheckPlatform.cmake new file mode 100644 index 0000000000..49bd1b9539 --- /dev/null +++ b/src/cmake/macros/CheckPlatform.cmake @@ -0,0 +1,16 @@ +# 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() diff --git a/src/cmake/macros/EnsureVersion.cmake b/src/cmake/macros/EnsureVersion.cmake new file mode 100644 index 0000000000..a85e12abb7 --- /dev/null +++ b/src/cmake/macros/EnsureVersion.cmake @@ -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) diff --git a/src/cmake/macros/FindACE.cmake b/src/cmake/macros/FindACE.cmake new file mode 100644 index 0000000000..340c7899e1 --- /dev/null +++ b/src/cmake/macros/FindACE.cmake @@ -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 "SunwellCore 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) diff --git a/src/cmake/macros/FindGit.cmake b/src/cmake/macros/FindGit.cmake new file mode 100644 index 0000000000..a37370c849 --- /dev/null +++ b/src/cmake/macros/FindGit.cmake @@ -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() diff --git a/src/cmake/macros/FindMySQL.cmake b/src/cmake/macros/FindMySQL.cmake new file mode 100644 index 0000000000..036b8302c7 --- /dev/null +++ b/src/cmake/macros/FindMySQL.cmake @@ -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 ) diff --git a/src/cmake/macros/FindOpenSSL.cmake b/src/cmake/macros/FindOpenSSL.cmake new file mode 100644 index 0000000000..245a91d419 --- /dev/null +++ b/src/cmake/macros/FindOpenSSL.cmake @@ -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) diff --git a/src/cmake/macros/FindPCHSupport.cmake b/src/cmake/macros/FindPCHSupport.cmake new file mode 100644 index 0000000000..b068b69c26 --- /dev/null +++ b/src/cmake/macros/FindPCHSupport.cmake @@ -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) diff --git a/src/cmake/macros/FindReadline.cmake b/src/cmake/macros/FindReadline.cmake new file mode 100644 index 0000000000..07c6b368df --- /dev/null +++ b/src/cmake/macros/FindReadline.cmake @@ -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) diff --git a/src/cmake/options.cmake b/src/cmake/options.cmake new file mode 100644 index 0000000000..f8db7e9081 --- /dev/null +++ b/src/cmake/options.cmake @@ -0,0 +1,19 @@ +# 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. + +option(SERVERS "Build worldserver and authserver" 1) +option(SCRIPTS "Build core with scripts included" 1) +option(TOOLS "Build map/vmap/mmap extraction/assembler tools" 0) +option(USE_SCRIPTPCH "Use precompiled headers when compiling scripts" 1) +option(USE_COREPCH "Use precompiled headers when compiling servers" 1) +option(WITH_WARNINGS "Show all warnings during compile" 0) +option(WITH_COREDEBUG "Include additional debug-code in core" 0) +option(WITH_MESHEXTRACTOR "Build meshextractor (alpha)" 0) +option(WITHOUT_GIT "Disable the GIT testing routines" 0) diff --git a/src/cmake/platform/cmake_uninstall.in.cmake b/src/cmake/platform/cmake_uninstall.in.cmake new file mode 100644 index 0000000000..06f9c8263a --- /dev/null +++ b/src/cmake/platform/cmake_uninstall.in.cmake @@ -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) diff --git a/src/cmake/platform/settings.cmake b/src/cmake/platform/settings.cmake new file mode 100644 index 0000000000..6df5bc2165 --- /dev/null +++ b/src/cmake/platform/settings.cmake @@ -0,0 +1,5 @@ +# set installation prefix +if( PREFIX ) + set(CMAKE_INSTALL_PREFIX "${PREFIX}") +endif() + diff --git a/src/cmake/platform/unix/settings.cmake b/src/cmake/platform/unix/settings.cmake new file mode 100644 index 0000000000..daa2653434 --- /dev/null +++ b/src/cmake/platform/unix/settings.cmake @@ -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() diff --git a/src/cmake/platform/win/settings.cmake b/src/cmake/platform/win/settings.cmake new file mode 100644 index 0000000000..6a75f37c60 --- /dev/null +++ b/src/cmake/platform/win/settings.cmake @@ -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/dep/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/dep/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() diff --git a/src/cmake/showoptions.cmake b/src/cmake/showoptions.cmake new file mode 100644 index 0000000000..ccddd0e1da --- /dev/null +++ b/src/cmake/showoptions.cmake @@ -0,0 +1,97 @@ +# output generic information about the core and buildtype chosen +message("") +message("* SunwellCore revision : ${rev_hash} ${rev_date} (${rev_branch} branch)") +if( UNIX ) + message("* SunwellCore 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}") + message("* Install configs to : ${CONF_DIR}") +endif() +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("") + diff --git a/src/cmake/stack_direction.c b/src/cmake/stack_direction.c new file mode 100644 index 0000000000..11bcf803bf --- /dev/null +++ b/src/cmake/stack_direction.c @@ -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); +}
\ No newline at end of file diff --git a/src/genrev/CMakeLists.txt b/src/genrev/CMakeLists.txt index a953fa5939..64b2abdf74 100644 --- a/src/genrev/CMakeLists.txt +++ b/src/genrev/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) +# 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 @@ -10,6 +10,6 @@ # 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}/cmake/genrev.cmake + COMMAND ${CMAKE_COMMAND} -DBUILDDIR=${CMAKE_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/src/cmake/genrev.cmake WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) diff --git a/src/server/collision/CMakeLists.txt b/src/server/collision/CMakeLists.txt index 887337a036..b65442d11f 100644 --- a/src/server/collision/CMakeLists.txt +++ b/src/server/collision/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) +# 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 @@ -32,8 +32,8 @@ set(collision_STAT_SRCS include_directories( ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/dep/g3dlite/include - ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour + ${CMAKE_SOURCE_DIR}/modules/dep/g3dlite/include + ${CMAKE_SOURCE_DIR}/modules/dep/recastnavigation/Detour ${CMAKE_SOURCE_DIR}/src/server/shared ${CMAKE_SOURCE_DIR}/src/server/shared/Configuration ${CMAKE_SOURCE_DIR}/src/server/shared/Debugging diff --git a/src/server/game/CMakeLists.txt b/src/server/game/CMakeLists.txt index b1014b4b65..38e8a1dc7f 100644 --- a/src/server/game/CMakeLists.txt +++ b/src/server/game/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) +# 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 @@ -108,11 +108,11 @@ set(game_STAT_SRCS include_directories( ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour - ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Recast - ${CMAKE_SOURCE_DIR}/dep/g3dlite/include - ${CMAKE_SOURCE_DIR}/dep/SFMT - ${CMAKE_SOURCE_DIR}/dep/zlib + ${CMAKE_SOURCE_DIR}/modules/dep/recastnavigation/Detour + ${CMAKE_SOURCE_DIR}/modules/dep/recastnavigation/Recast + ${CMAKE_SOURCE_DIR}/modules/dep/g3dlite/include + ${CMAKE_SOURCE_DIR}/modules/dep/SFMT + ${CMAKE_SOURCE_DIR}/modules/dep/zlib ${CMAKE_SOURCE_DIR}/src/server/collision ${CMAKE_SOURCE_DIR}/src/server/collision/Management ${CMAKE_SOURCE_DIR}/src/server/collision/Models diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt index 5ebac07877..44ceb35eb2 100644 --- a/src/server/scripts/CMakeLists.txt +++ b/src/server/scripts/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) +# 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 @@ -44,11 +44,11 @@ message("") include_directories( ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour - ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Recast - ${CMAKE_SOURCE_DIR}/dep/g3dlite/include - ${CMAKE_SOURCE_DIR}/dep/SFMT - ${CMAKE_SOURCE_DIR}/dep/zlib + ${CMAKE_SOURCE_DIR}/modules/dep/recastnavigation/Detour + ${CMAKE_SOURCE_DIR}/modules/dep/recastnavigation/Recast + ${CMAKE_SOURCE_DIR}/modules/dep/g3dlite/include + ${CMAKE_SOURCE_DIR}/modules/dep/SFMT + ${CMAKE_SOURCE_DIR}/modules/dep/zlib ${CMAKE_SOURCE_DIR}/src/server/shared ${CMAKE_SOURCE_DIR}/src/server/shared/Configuration ${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography diff --git a/src/server/shared/CMakeLists.txt b/src/server/shared/CMakeLists.txt index 553668a69c..4cfd4b2655 100644 --- a/src/server/shared/CMakeLists.txt +++ b/src/server/shared/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) +# 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 @@ -56,10 +56,10 @@ set(shared_STAT_SRCS include_directories( ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour - ${CMAKE_SOURCE_DIR}/dep/SFMT - ${CMAKE_SOURCE_DIR}/dep/sockets/include - ${CMAKE_SOURCE_DIR}/dep/utf8cpp + ${CMAKE_SOURCE_DIR}/modules/dep/recastnavigation/Detour + ${CMAKE_SOURCE_DIR}/modules/dep/SFMT + ${CMAKE_SOURCE_DIR}/modules/dep/sockets/include + ${CMAKE_SOURCE_DIR}/modules/dep/utf8cpp ${CMAKE_SOURCE_DIR}/src/server ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/Configuration diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt index aa97e8e3b1..5bd1dd2212 100644 --- a/src/server/worldserver/CMakeLists.txt +++ b/src/server/worldserver/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) +# 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 @@ -43,11 +43,11 @@ endif() include_directories( ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/dep/g3dlite/include - ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour - ${CMAKE_SOURCE_DIR}/dep/gsoap - ${CMAKE_SOURCE_DIR}/dep/sockets/include - ${CMAKE_SOURCE_DIR}/dep/SFMT + ${CMAKE_SOURCE_DIR}/modules/dep/g3dlite/include + ${CMAKE_SOURCE_DIR}/modules/dep/recastnavigation/Detour + ${CMAKE_SOURCE_DIR}/modules/dep/gsoap + ${CMAKE_SOURCE_DIR}/modules/dep/sockets/include + ${CMAKE_SOURCE_DIR}/modules/dep/SFMT ${CMAKE_SOURCE_DIR}/src/server/collision ${CMAKE_SOURCE_DIR}/src/server/collision/Management ${CMAKE_SOURCE_DIR}/src/server/collision/Models diff --git a/src/tools/map_extractor/CMakeLists.txt b/src/tools/map_extractor/CMakeLists.txt index 46b132614c..af3f79a910 100644 --- a/src/tools/map_extractor/CMakeLists.txt +++ b/src/tools/map_extractor/CMakeLists.txt @@ -1,5 +1,5 @@ -# Copyright (C) -# Copyright (C) +# Copyright (C) +# 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 @@ -13,7 +13,7 @@ file(GLOB_RECURSE sources *.cpp *.h) set(include_Dirs ${CMAKE_SOURCE_DIR}/src/server/shared - ${CMAKE_SOURCE_DIR}/dep/libmpq + ${CMAKE_SOURCE_DIR}/modules/dep/libmpq ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/loadlib ) @@ -21,7 +21,7 @@ set(include_Dirs if( WIN32 ) set(include_Dirs ${include_Dirs} - ${CMAKE_SOURCE_DIR}/dep/libmpq/win + ${CMAKE_SOURCE_DIR}/modules/dep/libmpq/win ) endif() diff --git a/src/tools/mesh_extractor/CMakeLists.txt b/src/tools/mesh_extractor/CMakeLists.txt index b76a99b765..922548319b 100644 --- a/src/tools/mesh_extractor/CMakeLists.txt +++ b/src/tools/mesh_extractor/CMakeLists.txt @@ -1,5 +1,5 @@ -# Copyright (C) -# Copyright (C) +# Copyright (C) +# 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 @@ -14,10 +14,10 @@ file(GLOB_RECURSE meshExtract_Sources *.cpp *.h) set(include_Base ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src/server/shared - ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Recast - ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour - ${CMAKE_SOURCE_DIR}/dep/libmpq - ${CMAKE_SOURCE_DIR}/dep/g3dlite/include + ${CMAKE_SOURCE_DIR}/modules/dep/recastnavigation/Recast + ${CMAKE_SOURCE_DIR}/modules/dep/recastnavigation/Detour + ${CMAKE_SOURCE_DIR}/modules/dep/libmpq + ${CMAKE_SOURCE_DIR}/modules/dep/g3dlite/include ${ACE_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ) @@ -25,7 +25,7 @@ set(include_Base if( WIN32 ) set(include_Base ${include_Base} - ${CMAKE_SOURCE_DIR}/dep/libmpq/win + ${CMAKE_SOURCE_DIR}/modules/dep/libmpq/win ) endif() diff --git a/src/tools/mmaps_generator/CMakeLists.txt b/src/tools/mmaps_generator/CMakeLists.txt index 8f58dccb56..3fa480f962 100644 --- a/src/tools/mmaps_generator/CMakeLists.txt +++ b/src/tools/mmaps_generator/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) +# 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 @@ -15,12 +15,12 @@ set(mmap_gen_Includes ${ACE_INCLUDE_DIR} ${MYSQL_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR} - ${CMAKE_SOURCE_DIR}/dep/libmpq - ${CMAKE_SOURCE_DIR}/dep/zlib - ${CMAKE_SOURCE_DIR}/dep/bzip2 - ${CMAKE_SOURCE_DIR}/dep/g3dlite/include - ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Recast - ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour + ${CMAKE_SOURCE_DIR}/modules/dep/libmpq + ${CMAKE_SOURCE_DIR}/modules/dep/zlib + ${CMAKE_SOURCE_DIR}/modules/dep/bzip2 + ${CMAKE_SOURCE_DIR}/modules/dep/g3dlite/include + ${CMAKE_SOURCE_DIR}/modules/dep/recastnavigation/Recast + ${CMAKE_SOURCE_DIR}/modules/dep/recastnavigation/Detour ${CMAKE_SOURCE_DIR}/src/server/collision ${CMAKE_SOURCE_DIR}/src/server/collision/Management ${CMAKE_SOURCE_DIR}/src/server/collision/Maps diff --git a/src/tools/vmap4_assembler/CMakeLists.txt b/src/tools/vmap4_assembler/CMakeLists.txt index 5d59faca7a..42895a15d9 100644 --- a/src/tools/vmap4_assembler/CMakeLists.txt +++ b/src/tools/vmap4_assembler/CMakeLists.txt @@ -1,5 +1,5 @@ -# Copyright (C) -# Copyright (C) +# Copyright (C) +# 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 @@ -10,7 +10,7 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. include_directories( - ${CMAKE_SOURCE_DIR}/dep/g3dlite/include + ${CMAKE_SOURCE_DIR}/modules/dep/g3dlite/include ${CMAKE_SOURCE_DIR}/src/server/shared ${CMAKE_SOURCE_DIR}/src/server/shared/Debugging ${CMAKE_SOURCE_DIR}/src/server/collision diff --git a/src/tools/vmap4_extractor/CMakeLists.txt b/src/tools/vmap4_extractor/CMakeLists.txt index 136fdac5e4..974505caaf 100644 --- a/src/tools/vmap4_extractor/CMakeLists.txt +++ b/src/tools/vmap4_extractor/CMakeLists.txt @@ -1,5 +1,5 @@ -# Copyright (C) -# Copyright (C) +# Copyright (C) +# 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 @@ -12,13 +12,13 @@ file(GLOB_RECURSE sources *.cpp *.h) set(include_Dirs - ${CMAKE_SOURCE_DIR}/dep/libmpq + ${CMAKE_SOURCE_DIR}/modules/dep/libmpq ) if( WIN32 ) set(include_Dirs ${include_Dirs} - ${CMAKE_SOURCE_DIR}/dep/libmpq/win + ${CMAKE_SOURCE_DIR}/modules/dep/libmpq/win ) endif() |