diff --git a/.gitignore b/.gitignore index 375c0ba46..853e2948a 100644 --- a/.gitignore +++ b/.gitignore @@ -80,8 +80,31 @@ cmake_install.cmake # # Special exceptions # + +# cmake generated files in sources +dep/ACE_wrappers/ace/ACE_vc8.vcxproj* +dep/ACE_wrappers/ace/Backup* +dep/ACE_wrappers/ace/Debug* +dep/ACE_wrappers/ace/ETCL/ACE_ETCL_Parser_vc8.vcxproj* +dep/ACE_wrappers/ace/ETCL/ACE_ETCL_vc8.vcxproj* +dep/ACE_wrappers/ace/ETCL/Debug* +dep/ACE_wrappers/ace/ETCL/Release* +dep/ACE_wrappers/ace/Monitor_Control/Debug* +dep/ACE_wrappers/ace/Monitor_Control/Monitor_Control_vc8.vcxproj* +dep/ACE_wrappers/ace/Monitor_Control/Release* +dep/ACE_wrappers/ace/QoS/Debug* +dep/ACE_wrappers/ace/QoS/QoS_vc8.vcxproj* +dep/ACE_wrappers/ace/QoS/Release* +dep/ACE_wrappers/ace/UpgradeLog* +dep/ACE_wrappers/ace/Release* +dep/ACE_wrappers/ace/_UpgradeReport_Files* +dep/ACE_wrappers/lib/* +dep/ACE_wrappers/ace/config.h + +# ned files from excluded dirs !dep/ACE_wrappers/ace/ace_message_table.bin !dep/ACE_wrappers/bin/GNUmakefile.bin !dep/ACE_wrappers/configure.ac~ !dep/ACE_wrappers/lib/.empty !dep/tbb/src/Makefile + diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..b66a8c00f --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,423 @@ +# +# Copyright (C) 2005-2011 MaNGOS project +# +# 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; either version 2 of the License, or +# (at your option) any later version. +# +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +project(MaNGOS) +set(MANGOS_VERSION 0.17.0) + +# CMake policies +cmake_minimum_required(VERSION 2.8) + +set(CMAKE_MODULE_PATH + ${CMAKE_MODULE_PATH} + ${CMAKE_SOURCE_DIR}/cmake +) + +# 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 [options]' from there." + ) +endif() + +if(WIN32 AND NOT MSVC) + message(FATAL_ERROR + "Under Windows other compiler than Microsoft Visual Studio are not supported." + ) +endif() + +find_package(Platform REQUIRED) +find_package(Git) + +# VS100 uses MSBuild.exe instead of devenv.com, so force it to use devenv.com +if(WIN32 AND MSVC_VERSION MATCHES 1600) + find_package(VisualStudio2010) +endif() + +# if(NOT PLATFORM MATCHES X86 AND NOT PLATFORM MATCHES X64) +# message(FATAL_ERROR +# "An unknown Architecture was selected. Only the values X86 and X64 for PLATFORM are supported." +# ) +# endif() + +# Output description of this script +message( + "\nThis script builds the MaNGOS server. + Options that can be used in order to configure the process: + PREFIX: Path where the server should be installed to + PCH: Use precompiled headers + DEBUG: Debug mode + To set an option simply type -D