Permalink
Browse files

[mr2715] Squashed commit of the following:

commit 443c245831da071dc2cccf39b0782ae30baa20e1
Author: rsa <kris13@bk.ru>
Date:   Sun Mar 3 11:42:36 2013 +0400

    fix after 12390/12391

commit a1a51dfc2fe22fe1a7ae6a2ca0ea804015c773b8
Author: DasBlub <DasBlub@gmail.com>
Date:   Sun Mar 3 00:23:16 2013 +0100

    [12391] Remove the PREFIX parameter from the CMake files and use the standard CMAKE_INSTALL_PREFIX parameter instead

    This also fixes the behaviour with relative paths, until now, it
    calculated the absolute path from the location of the top level
    CMakeLists.txt instead of your current directory where you called cmake.

    You need to re-run CMake and define CMAKE_INSTALL_PREFIX and remove
    PREFIX! You can do so by either removing all files in your build directory
    and start from scratch or run 'cmake -DPREFIX= -DCMAKE_INSTALL_PREFIX=<install_path> <path_to_source>'.
    A check has been added to the CMake file to make sure that PREFIX is no
    longer used.

    + fix build chain for SD2 (/dev/rsa)

commit 82ef54ab6078d6db83074402718b5f7ac4afe941
Author: DasBlub <DasBlub@gmail.com>
Date:   Sat Mar 2 22:55:00 2013 +0100

    [12390] Do not use GLOB in CMake for source file lists

    From the CMake documentation of the FILE command:
    "We do not recommend using GLOB to collect a list of source files from your
    source tree. If no CMakeLists.txt file changes when a source is added or
    removed then the generated build system cannot know when to ask CMake to
    regenerate."
  • Loading branch information...
rsa committed Mar 3, 2013
1 parent d7226f5 commit c75db34eb99c19b5a825a2589b9f80b0848e28e6
View
@@ -12,7 +12,7 @@ script:
- test -d _build || mkdir _build
- test -d _install || mkdir _install
- cd _build
- - cmake -DPREFIX=../_install ..
+ - cmake -DCMAKE_INSTALL_PREFIX=../_install ..
- make -j4
notifications:
View
@@ -60,11 +60,11 @@ endif()
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
+ CMAKE_INSTALL_PREFIX: Path where the server should be installed to
PCH: Use precompiled headers
DEBUG: Debug mode
To set an option simply type -D<OPTION>=<VALUE> after 'cmake <srcs>'.
- For example: cmake .. -DDEBUG=1 -DPREFIX=/opt/mangos\n"
+ For example: cmake .. -DDEBUG=1 -DCMAKE_INSTALL_PREFIX=/opt/mangos\n"
) # TODO: PLATFORM: Sets the architecture for compile (X86,X64)
# Override configuration-types - we don't use anything else than debug and release
@@ -134,19 +134,9 @@ endif()
# option(SQL "Copy SQL files" 0)
# option(TOOLS "Build tools" 0)
-# Set up the install-prefix
-if(CMAKE_INSTALL_PREFIX STREQUAL "/usr/local")
- get_filename_component(PREFIX_ABSOLUTE "../mangos-server" ABSOLUTE)
- set(CMAKE_INSTALL_PREFIX ${PREFIX_ABSOLUTE} CACHE PATH "Install path prefix." FORCE)
-endif()
+# TODO: remove this in the future! it has only been added to make the switch easier for end users
if(PREFIX)
- if(!WIN32)
- string(REGEX REPLACE "^~" "$ENV{HOME}" PREFIX ${PREFIX})
- endif()
- get_filename_component(PREFIX_ABSOLUTE ${PREFIX} ABSOLUTE)
- set(CMAKE_INSTALL_PREFIX ${PREFIX_ABSOLUTE} CACHE PATH "Install path prefix." FORCE)
-else()
- set(PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Install path prefix.")
+ message(FATAL_ERROR "The parameter PREFIX has been removed. Please re-run CMake and use CMAKE_INSTALL_PREFIX instead to define your installation location!")
endif()
set(BIN_DIR ${CMAKE_INSTALL_PREFIX}/bin)
@@ -22,7 +22,7 @@ if [ ! -d ./build ]; then
cmake \
-DACE_USE_EXTERNAL=1 \
-DUSE_STD_MALLOC=1 \
- -DPREFIX=/home/mangos \
+ -DCMAKE_INSTALL_PREFIX=/home/mangos \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS_RELEASE:STRING="-march=native -O2 -ggdb -pipe -D_LARGEFILE_SOURCE -frename-registers -fno-strict-aliasing -fno-strength-reduce -fno-delete-null-pointer-checks -finput-charset=utf-8 -fexec-charset=utf-8" \
-DCMAKE_CXX_FLAGS_RELEASE:STRING="-march=native -O2 -ggdb -pipe -D_LARGEFILE_SOURCE -frename-registers -fno-strict-aliasing -fno-strength-reduce -fno-delete-null-pointer-checks -finput-charset=utf-8 -fexec-charset=utf-8" \
@@ -16,9 +16,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# file(GLOB g3dlite_SRCS *.cpp) # don't need all of them
+set(LIBRARY_NAME g3dlite)
-set(g3dlite_SRCS
+set(LIBRARY_SRCS
AABox.cpp
Any.cpp
#AnyVal.cpp
@@ -126,12 +126,12 @@ include_directories(
${CMAKE_SOURCE_DIR}/dep/include/zlib
)
-add_library(g3dlite STATIC
- ${g3dlite_SRCS}
+add_library(${LIBRARY_NAME} STATIC
+ ${LIBRARY_SRCS}
)
if(WIN32)
- target_link_libraries(g3dlite
+ target_link_libraries(${LIBRARY_NAME}
zlib
)
endif()
@@ -16,13 +16,17 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-file(GLOB gsoap_SRCS *.cpp)
+set(LIBRARY_NAME gsoap)
+
+set(LIBRARY_SRCS
+ stdsoap2.cpp
+ )
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/dep/include/gsoap
)
-add_library(gsoap STATIC
- ${gsoap_SRCS}
-)
+add_library(${LIBRARY_NAME} STATIC
+ ${LIBRARY_SRCS}
+)
View
@@ -16,7 +16,7 @@ mkdir build &&
cd build &&
cmake .. ${CONF_OPTS} \
- -DPREFIX="${PREFIX}" \
+ -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DCMAKE_C_FLAGS="${CFLAGS}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-DCMAKE_C_COMPILER="gcc" \
View
@@ -26,9 +26,9 @@ if(WIN32)
)
endif()
-add_subdirectory(bindings)
-add_subdirectory(framework)
add_subdirectory(shared)
+add_subdirectory(framework)
add_subdirectory(realmd)
add_subdirectory(game)
add_subdirectory(mangosd)
+add_subdirectory(bindings)
@@ -16,7 +16,17 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-file(GLOB_RECURSE mangosscript_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp *.h)
+set(LIBRARY_NAME mangosscript)
+
+set(LIBRARY_SRCS
+ config.h
+ ScriptMgr.cpp
+ ScriptMgr.h
+ system.cpp
+ Scripts/sc_default.cpp
+ Scripts/sc_defines.cpp
+ Scripts/sc_defines.h
+ )
include_directories(
${CMAKE_SOURCE_DIR}/src/shared
@@ -26,60 +36,59 @@ include_directories(
${MYSQL_INCLUDE_DIR}
)
-add_library(mangosscript SHARED
- ${mangosscript_SRCS}
+add_library(${LIBRARY_NAME} SHARED
+ ${LIBRARY_SRCS}
)
-add_dependencies(mangosscript revision.h)
+add_dependencies(${LIBRARY_NAME} revision.h)
if(NOT ACE_USE_EXTERNAL)
- add_dependencies(mangosscript ACE_Project)
-# add_dependencies(mangosscript ace)
+ add_dependencies(${LIBRARY_NAME} ACE_Project)
endif()
-target_link_libraries(mangosscript
+target_link_libraries(${LIBRARY_NAME}
${ZLIB_LIBRARIES}
${ACE_LIBRARIES}
)
if(WIN32)
- target_link_libraries(mangosscript
+ target_link_libraries(${LIBRARY_NAME}
mangosd # FIXME: could this be done for unix? because unix won't generate exe.libs
)
if(WIN32 AND PLATFORM MATCHES X86)
- target_link_libraries(mangosscript
+ target_link_libraries(${LIBRARY_NAME}
debug ${WIN_DEBUGLIBS}
)
endif()
endif()
if(UNIX)
- set(mangosscript_LINK_FLAGS "-pthread")
+ set(LIBRARY_LINK_FLAGS "-pthread")
if(APPLE)
- set(mangosscript_LINK_FLAGS "-framework Carbon ${mangosscript_LINK_FLAGS}")
+ set(LIBRARY_LINK_FLAGS "-framework Carbon ${LIBRARY_LINK_FLAGS}")
# Needed for the linking because of the missing symbols
- set(mangosscript_LINK_FLAGS "-Wl,-undefined -Wl,dynamic_lookup ${mangosscript_LINK_FLAGS}")
+ set(LIBRARY_LINK_FLAGS "-Wl,-undefined -Wl,dynamic_lookup ${LIBRARY_LINK_FLAGS}")
endif()
if(APPLE)
- set(mangosscript_PROPERTIES INSTALL_NAME_DIR "${LIBS_DIR}")
+ set(LIBRARY_PROPERTIES INSTALL_NAME_DIR "${LIBS_DIR}")
else()
- set(mangosscript_PROPERTIES INSTALL_RPATH ${LIBS_DIR})
+ set(LIBRARY_PROPERTIES INSTALL_RPATH ${LIBS_DIR})
endif()
# Run out of build tree
- set(mangosscript_PROPERTIES
- ${mangosscript_PROPERTIES}
+ set(LIBRARY_PROPERTIES
+ ${LIBRARY_PROPERTIES}
BUILD_WITH_INSTALL_RPATH OFF
)
- set_target_properties(mangosscript PROPERTIES
- LINK_FLAGS ${mangosscript_LINK_FLAGS}
- ${mangosscript_PROPERTIES}
+ set_target_properties(${LIBRARY_NAME} PROPERTIES
+ LINK_FLAGS ${LIBRARY_LINK_FLAGS}
+ ${LIBRARY_PROPERTIES}
)
endif()
# LIBRARY = dyld / so, RUNTIME = dll
-install(TARGETS mangosscript
+install(TARGETS ${LIBRARY_NAME}
LIBRARY DESTINATION ${LIBS_DIR}
RUNTIME DESTINATION ${LIBS_DIR}
)
@@ -16,9 +16,37 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# include(${CMAKE_SOURCE_DIR}/dep/tbb/tbbinclude.cmake)
+set(LIBRARY_NAME framework)
-file(GLOB_RECURSE framework_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp *.h)
+set(LIBRARY_SRCS
+ Dynamic/FactoryHolder.h
+ Dynamic/ObjectRegistry.h
+ GameSystem/Grid.h
+ GameSystem/GridLoader.h
+ GameSystem/GridReference.h
+ GameSystem/GridRefManager.h
+ GameSystem/NGrid.h
+ GameSystem/TypeContainer.h
+ GameSystem/TypeContainerFunctions.h
+ GameSystem/TypeContainerVisitor.h
+ Platform/CompilerDefs.h
+ Platform/Define.h
+ Policies/CreationPolicy.h
+ Policies/MemoryManagement.cpp
+ Policies/ObjectLifeTime.cpp
+ Policies/ObjectLifeTime.h
+ Policies/Singleton.h
+ Policies/ThreadingModel.h
+ Utilities/ByteConverter.h
+ Utilities/Callback.h
+ Utilities/EventProcessor.cpp
+ Utilities/EventProcessor.h
+ Utilities/LinkedList.h
+ Utilities/LinkedReference/Reference.h
+ Utilities/LinkedReference/RefManager.h
+ Utilities/TypeList.h
+ Utilities/UnorderedMapSet.h
+ )
source_group("Other"
REGULAR_EXPRESSION .*
@@ -53,20 +81,17 @@ include_directories(
${ACE_INCLUDE_DIR}
)
-add_library(framework STATIC
- ${framework_SRCS}
+add_library(${LIBRARY_NAME} STATIC
+ ${LIBRARY_SRCS}
)
if(NOT TBB_USE_EXTERNAL)
- add_dependencies(framework TBB_Project)
-# add_dependencies(framework tbb)
-# add_dependencies(framework tbbmalloc)
+ add_dependencies(${LIBRARY_NAME} TBB_Project)
endif()
if(NOT ACE_USE_EXTERNAL)
- add_dependencies(framework ACE_Project)
-# add_dependencies(framework ace)
+ add_dependencies(${LIBRARY_NAME} ACE_Project)
endif()
-target_link_libraries(framework
+target_link_libraries(${LIBRARY_NAME}
${TBB_LIBRARIES}
)
Oops, something went wrong.

0 comments on commit c75db34

Please sign in to comment.