Permalink
Browse files

Revertin Bloody.Rabbit's last three commits since something in them b…

…roke the windows build. Sorry, Bloody.Rabbit :/
  • Loading branch information...
1 parent 6f63561 commit 237ae68928d3a9d3907b155e0b2c4609e5dca20d @aknorjaden aknorjaden committed Apr 10, 2012
View
@@ -7,139 +7,279 @@
###############
# CMake setup #
###############
-CMAKE_MINIMUM_REQUIRED( VERSION 2.8 FATAL_ERROR )
+CMAKE_MINIMUM_REQUIRED( VERSION 2.6 FATAL_ERROR )
PROJECT( "evemu" )
SET( PROJECT_DESCRIPTION_SUMMARY "A server emulator for EVE Online" )
SET( PROJECT_VENDOR "The EVEmu development team" )
+SET( PROJECT_VERSION "0.7-experimental" )
SET( CMAKE_MODULE_PATH
"${PROJECT_SOURCE_DIR}/cmake"
"${CMAKE_MODULE_PATH}" )
+INCLUDE( "CheckSymbolExists" )
+
+INCLUDE( "TargetBuildPCH" )
+INCLUDE( "TestX64" )
+
###########
# Options #
###########
+SET( EVEMU_COLLECTOR_ENABLE OFF
+ CACHE BOOL "Build eve-collector." )
+SET( EVEMU_DOC_ENABLE OFF
+ CACHE BOOL "Generate HTML documentation (requires Doxygen)." )
+SET( EVEMU_SOURCE_SCM ""
+ CACHE STRING "Source SCM in use; valid values: '', 'svn', 'git'" )
+SET( EVEMU_TOOL_ENABLE OFF
+ CACHE BOOL "Build eve-tool." )
+
SET( EVEMU_ROOT_DIR "..////"
CACHE PATH "The root of EVEmu workspace." )
MARK_AS_ADVANCED( EVEMU_ROOT_DIR )
+SET( TINYXML_USE_STL ON
+ CACHE BOOL "tinyxml will use native STL." )
+MARK_AS_ADVANCED( TINYXML_USE_STL )
+
+# Mark a bunch of stuff as advanced
+MARK_AS_ADVANCED(Boost_DIR Boost_LIB_DIAGNOSTIC_DEFINITIONS CMAKE_INSTALL_PREFIX Lua_DIR)
+
#########
# Tests #
#########
-INCLUDE( "CheckSymbolExists" )
-INCLUDE( "TargetBuildPCH" )
-INCLUDE( "TestX64" )
-
TEST_X64( X64 )
+
CHECK_SYMBOL_EXISTS( "__FreeBSD__" "" FREE_BSD )
+
SET( GNUC ${CMAKE_COMPILER_IS_GNUCXX} )
+################
+# Dependencies #
+################
+FIND_PACKAGE( "Threads" REQUIRED )
+
+IF (WIN32)
+ FIND_PACKAGE( "MySQL" 5.0 QUIET )
+ FIND_PACKAGE( "ZLIB" QUIET )
+ FIND_PACKAGE( "Boost" QUIET )
+ELSE()
+ FIND_PACKAGE( "MySQL" 5.0 REQUIRED )
+ FIND_PACKAGE( "ZLIB" REQUIRED )
+
+ FIND_PACKAGE( "Boost" REQUIRED )
+ LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
+ INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
+ENDIF (WIN32)
+
+
+IF ( NOT WIN32)
+ FIND_PACKAGE( "ICONV" REQUIRED )
+ENDIF ( NOT WIN32 )
+
+IF( EVEMU_DOC_ENABLE )
+ FIND_PACKAGE( "Doxygen" REQUIRED )
+ENDIF( EVEMU_DOC_ENABLE )
+
+IF( NOT EVEMU_SOURCE_REVISION )
+ IF( EVEMU_SOURCE_SCM STREQUAL "svn" )
+ FIND_PACKAGE( "Subversion" REQUIRED )
+ ELSEIF( EVEMU_SOURCE_SCM STREQUAL "git" )
+ FIND_PACKAGE( "Git" REQUIRED )
+ ENDIF( EVEMU_SOURCE_SCM STREQUAL "svn" )
+ENDIF( NOT EVEMU_SOURCE_REVISION )
+
+FIND_PACKAGE( "Gangsta" QUIET )
+FIND_PACKAGE( "Lua" QUIET )
+FIND_PACKAGE( "TinyXML" QUIET )
+FIND_PACKAGE( "UTF8CPP" QUIET )
+
#################
# Configuration #
#################
+IF( WIN32 )
+ SET( PROJECT_STANDARD_LIBRARIES "wsock32" ${CMAKE_THREAD_LIBS_INIT} )
+ELSE( WIN32 )
+ SET( PROJECT_STANDARD_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} )
+ENDIF( WIN32 )
+
IF( MSVC )
- #
- # This is here as we usually use pre-built MySQL binaries which are
- # compiled with /MT (use static libc); building with /MD (use DLL libc)
- # results in linker warning during the linking stage, however the resultant
- # binary works and is even a little bit smaller due to the dynamic linking.
- #
- # For now we supress the linker warning by forcing static libc.
- #
- #STRING( REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
- #STRING( REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}" )
- #STRING( REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}" )
- #STRING( REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" )
- #STRING( REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" )
-ELSEIF( GNUC )
- #
- # Setup some recommended compiler flags.
- #
- # Intentionally specify the CMAKE_CXX_FLAGS as last to allow user
- # override the setup.
- #
- SET( CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}" )
+ #
+ # This is here as we usually use pre-built MySQL binaries which are
+ # compiled with /MT (use static libc); building with /MD (use DLL libc)
+ # results in linker warning during the linking stage, however the resultant
+ # binary works and is even a little bit smaller due to the dynamic linking.
+ #
+ # For now we supress the linker warning by forcing static libc.
+ #
+ #STRING( REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
+ #STRING( REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}" )
+ #STRING( REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}" )
+ #STRING( REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" )
+ #STRING( REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" )
+
+ # to avoid linking any boost libs
+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D \"BOOST_DATE_TIME_NO_LIB\" /D \"BOOST_REGEX_NO_LIB\"" )
+
ENDIF( MSVC )
-SET( EVEMU_SOURCE_SCM ""
- CACHE STRING "Source SCM in use; valid values: '', 'svn', 'git'" )
+IF ( NOT MSVC )
+ # to avoid linking any boost libs
+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -DBOOST_DATE_TIME_NO_LIB -DBOOST_REGEX_NO_LIB" )
+ENDIF ( NOT MSVC )
+
+IF( NOT EVEMU_SOURCE_REVISION )
+ IF( EVEMU_SOURCE_SCM STREQUAL "svn" )
+ Subversion_WC_INFO( "${PROJECT_SOURCE_DIR}" "${PROJECT_NAME}" )
+
+ SET( EVEMU_SOURCE_REVISION "r${${PROJECT_NAME}_WC_LAST_CHANGED_REV}"
+ CACHE STRING "Revision of the source." )
+ MARK_AS_ADVANCED( EVEMU_SOURCE_REVISION )
+ ELSEIF( EVEMU_SOURCE_SCM STREQUAL "git" )
+ GIT_TREE_INFO( "${PROJECT_SOURCE_DIR}" "${PROJECT_NAME}" )
+
+ SET( EVEMU_SOURCE_REVISION "${${PROJECT_NAME}_HASH_SHORT}"
+ CACHE STRING "Revision of the source." )
+ MARK_AS_ADVANCED( EVEMU_SOURCE_REVISION )
+ ENDIF( EVEMU_SOURCE_SCM STREQUAL "svn" )
+ENDIF( NOT EVEMU_SOURCE_REVISION )
+
+IF( EVEMU_SOURCE_REVISION )
+ SET( PROJECT_VERSION "${PROJECT_VERSION}-${EVEMU_SOURCE_REVISION}" )
+ENDIF( EVEMU_SOURCE_REVISION )
+
+############
+# config.h #
+############
+CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/config.h.in"
+ "${PROJECT_BINARY_DIR}/config.h"
+ ESCAPE_QUOTES @ONLY )
-IF( EVEMU_SOURCE_SCM STREQUAL "svn" )
- FIND_PACKAGE( "Subversion" REQUIRED )
- Subversion_WC_INFO( "${PROJECT_SOURCE_DIR}" EVEMU_SVN )
- SET( PROJECT_VERSION "r${EVEMU_SVN_WC_LAST_CHANGED_REV}" )
-ELSEIF( EVEMU_SOURCE_SCM STREQUAL "git" )
- INCLUDE( "GitTreeInfo" )
- GIT_TREE_INFO( "${PROJECT_SOURCE_DIR}" EVEMU_GIT )
- SET( PROJECT_VERSION "${EVEMU_GIT_VERSION}" )
-ENDIF( EVEMU_SOURCE_SCM STREQUAL "svn" )
-
-######################
-# Advertise config.h #
-######################
ADD_DEFINITIONS( "-DHAVE_CONFIG_H" )
INCLUDE_DIRECTORIES( "${PROJECT_BINARY_DIR}" )
+############################
+# Distributed dependencies #
+############################
+ADD_SUBDIRECTORY( "dep/utils" )
+
+IF( NOT GANGSTA_FOUND )
+ ADD_SUBDIRECTORY( "dep/gangsta" )
+
+ SET( GANGSTA_FOUND TRUE )
+ SET( GANGSTA_INCLUDE_DIR "${gangsta_INCLUDE_DIR}" )
+ SET( GANGSTA_LIBRARIES "gangsta" )
+ENDIF( NOT GANGSTA_FOUND )
+
+IF( NOT LUA_FOUND )
+ ADD_SUBDIRECTORY( "dep/lua" )
+
+ SET( LUA_FOUND TRUE )
+ SET( LUA_INCLUDE_DIR "${lua_INCLUDE_DIR}" )
+ SET( LUA_LIBRARIES "lua" )
+ENDIF( NOT LUA_FOUND )
+
+IF( NOT TINYXML_FOUND )
+ ADD_SUBDIRECTORY( "dep/tinyxml" )
+
+ SET( TINYXML_FOUND TRUE )
+ SET( TINYXML_INCLUDE_DIR "${tinyxml_INCLUDE_DIR}" )
+ SET( TINYXML_LIBRARIES "tinyxml" )
+ENDIF( NOT TINYXML_FOUND )
+
+IF( NOT UTF8CPP_FOUND )
+ ADD_SUBDIRECTORY( "dep/utf8cpp" )
+
+ SET( UTF8CPP_FOUND TRUE )
+ SET( UTF8CPP_INCLUDE_DIR "${utf8cpp_INCLUDE_DIR}" )
+ SET( UTF8CPP_LIBRARIES "utf8cpp" )
+ENDIF( NOT UTF8CPP_FOUND )
+
+IF(NOT BOOST_FOUND)
+ ADD_SUBDIRECTORY("dep/boost")
+
+ SET(BOOST_FOUND TRUE)
+ SET(Boost_INCLUDE_DIR "${boost_INCLUDE_DIR}")
+ SET(Boost_DIR "${boost_INCLUDE_DIR}")
+ SET(BOOST_LIBRARIES "boost")
+
+ #LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
+ INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
+ENDIF(NOT BOOST_FOUND)
+
+IF(NOT MYSQL_FOUND)
+ ADD_SUBDIRECTORY("dep/mysql/include")
+
+ SET(MYSQL_FOUND TRUE)
+ SET(MYSQL_INCLUDE_DIR "${mysql_INCLUDE_DIR}")
+ SET(MYSQL_LIBRARIES "${mysql_INCLUDE_DIR}/../lib/opt/libmysql.lib")
+ENDIF(NOT MYSQL_FOUND)
+
+IF(NOT ZLIB_FOUND)
+ ADD_SUBDIRECTORY("dep/zlib")
+
+ SET(ZLIB_FOUND TRUE)
+ SET(ZLIB_INCLUDE_DIR "${zlib_INCLUDE_DIR}")
+ SET(ZLIB_LIBRARIES "zlib")
+ENDIF(NOT ZLIB_FOUND)
+
+ADD_SUBDIRECTORY( "dep/asio" )
+SET ( ASIO_INCLUDE_DIR "${asio_INCLUDE_DIR}" )
+
+###########################
+# Generated documentation #
+###########################
+IF( EVEMU_DOC_ENABLE )
+ ADD_SUBDIRECTORY( "doc" )
+ENDIF( EVEMU_DOC_ENABLE )
+
##################
# Targets import #
##################
IF( CMAKE_CROSSCOMPILING )
- SET( EVEMU_TARGETS_IMPORT ""
- CACHE FILEPATH "Path to an import script generated during a native build." )
- MARK_AS_ADVANCED( EVEMU_TARGETS_IMPORT )
+ SET( EVEMU_TARGETS_IMPORT ""
+ CACHE FILEPATH "Path to an import script generated during a native build." )
+ MARK_AS_ADVANCED( EVEMU_TARGETS_IMPORT )
- IF( EVEMU_TARGETS_IMPORT )
- INCLUDE( "${EVEMU_TARGETS_IMPORT}" )
- ENDIF( EVEMU_TARGETS_IMPORT )
+ IF( EVEMU_TARGETS_IMPORT )
+ INCLUDE( "${EVEMU_TARGETS_IMPORT}" )
+ ENDIF( EVEMU_TARGETS_IMPORT )
ENDIF( CMAKE_CROSSCOMPILING )
-#################
-# EVEmu targets #
-#################
-SET( EVEMU_COLLECTOR_ENABLE OFF
- CACHE BOOL "Build eve-collector." )
-SET( EVEMU_TOOL_ENABLE OFF
- CACHE BOOL "Build eve-tool." )
-
-ADD_SUBDIRECTORY( "doc" )
+################
+# EVEmu source #
+################
ADD_SUBDIRECTORY( "src/common" )
IF( NOT CMAKE_CROSSCOMPILING )
- ADD_SUBDIRECTORY( "src/xmlpktgen" )
+ ADD_SUBDIRECTORY( "src/xmlpktgen" )
ENDIF( NOT CMAKE_CROSSCOMPILING )
ADD_SUBDIRECTORY( "src/eve-common" )
ADD_SUBDIRECTORY( "src/eve-server" )
IF( EVEMU_COLLECTOR_ENABLE )
- ADD_SUBDIRECTORY( "src/eve-collector" )
+ ADD_SUBDIRECTORY( "src/eve-collector" )
ENDIF( EVEMU_COLLECTOR_ENABLE )
IF( EVEMU_TOOL_ENABLE )
- ADD_SUBDIRECTORY( "src/eve-tool" )
+ ADD_SUBDIRECTORY( "src/eve-tool" )
ENDIF( EVEMU_TOOL_ENABLE )
##################
# Targets export #
##################
IF( NOT CMAKE_CROSSCOMPILING )
- SET( EVEMU_TARGETS_EXPORT ""
- CACHE FILEPATH "Path to an import script to generate (for cross-compiling)." )
- MARK_AS_ADVANCED( EVEMU_TARGETS_EXPORT )
-
- IF( EVEMU_TARGETS_EXPORT )
- EXPORT( TARGETS "xmlpktgen"
- FILE "${EVEMU_TARGETS_EXPORT}" )
- ENDIF( EVEMU_TARGETS_EXPORT )
-ENDIF( NOT CMAKE_CROSSCOMPILING )
+ SET( EVEMU_TARGETS_EXPORT ""
+ CACHE FILEPATH "Path to an import script to generate (for cross-compiling)." )
+ MARK_AS_ADVANCED( EVEMU_TARGETS_EXPORT )
-#####################
-# Generate config.h #
-#####################
-CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/config.h.in"
- "${PROJECT_BINARY_DIR}/config.h"
- ESCAPE_QUOTES @ONLY )
+ IF( EVEMU_TARGETS_EXPORT )
+ EXPORT( TARGETS "xmlpktgen"
+ FILE "${EVEMU_TARGETS_EXPORT}" )
+ ENDIF( EVEMU_TARGETS_EXPORT )
+ENDIF( NOT CMAKE_CROSSCOMPILING )
###############
# CPack setup #
@@ -1,17 +1,17 @@
# - Find Gangsta
# Find the native Gangsta includes and library
#
-# GANGSTA_FOUND - True if Gangsta found.
-# GANGSTA_INCLUDE_DIRS - where to find GaTypes.h, etc.
-# GANGSTA_LIBRARIES - List of libraries when using Gangsta.
+# GANGSTA_FOUND - True if Gangsta found.
+# GANGSTA_INCLUDE_DIR - where to find GaTypes.h, etc.
+# GANGSTA_LIBRARIES - List of libraries when using Gangsta.
#
-IF( GANGSTA_INCLUDE_DIRS )
+IF( GANGSTA_INCLUDE_DIR )
# Already in cache, be silent
SET( Gangsta_FIND_QUIETLY TRUE )
-ENDIF( GANGSTA_INCLUDE_DIRS )
+ENDIF( GANGSTA_INCLUDE_DIR )
-FIND_PATH( GANGSTA_INCLUDE_DIRS "GaTypes.h"
+FIND_PATH( GANGSTA_INCLUDE_DIR "GaTypes.h"
PATH_SUFFIXES "gangsta" )
FIND_LIBRARY( GANGSTA_LIBRARIES
@@ -21,6 +21,6 @@ FIND_LIBRARY( GANGSTA_LIBRARIES
# handle the QUIETLY and REQUIRED arguments and set GANGSTA_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE( "FindPackageHandleStandardArgs" )
-FIND_PACKAGE_HANDLE_STANDARD_ARGS( "Gangsta" DEFAULT_MSG GANGSTA_INCLUDE_DIRS GANGSTA_LIBRARIES )
+FIND_PACKAGE_HANDLE_STANDARD_ARGS( "Gangsta" DEFAULT_MSG GANGSTA_INCLUDE_DIR GANGSTA_LIBRARIES )
-MARK_AS_ADVANCED( GANGSTA_INCLUDE_DIRS GANGSTA_LIBRARIES )
+MARK_AS_ADVANCED( GANGSTA_INCLUDE_DIR GANGSTA_LIBRARIES )
Oops, something went wrong. Retry.

0 comments on commit 237ae68

Please sign in to comment.