From 7f944f5af98927f57484ef5273a25fd92180efb4 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Tue, 4 Jan 2011 20:33:23 +0100 Subject: Fixed paste under X11 The check for whether we're not compiling for Mac was evaluating to false, apparently since it used the wrong CMake syntax. Reviewed-by: Bernd Wachter --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index accf8cd1..1418e938 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,9 +37,9 @@ IF (WIN32) SET(LOCALEDIR ".") CONFIGURE_FILE(src/winver.h.in src/winver.h) ELSE (WIN32) - IF (!OSX) + IF (NOT OSX) OPTION(USE_X11 "Use X11 Clipboard functionality" ON) - ENDIF (!OSX) + ENDIF () SET(PKG_DATADIR ${CMAKE_INSTALL_PREFIX}/share/mana) SET(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale) SET(PKG_BINDIR ${CMAKE_INSTALL_PREFIX}/bin) -- cgit v1.2.3-70-g09d2 From 3f66a1934942adf3f4e81f49fe3c18476aed0177 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Wed, 26 Jan 2011 00:12:51 +0100 Subject: Prune the enet and manaserv files dependency of the 0.5 binary. Only using cmake conditions and an ifdef. This will greatly help packaging the mana 0.5 version on other distros. --- CMakeLists.txt | 7 ++++++- src/CMakeLists.txt | 21 ++++++++++++++++----- src/net/net.cpp | 3 ++- 3 files changed, 24 insertions(+), 7 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 1418e938..00139b55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,7 @@ FIND_PACKAGE(Gettext) OPTION(WITH_OPENGL "Enable OpenGL support" ON) OPTION(ENABLE_NLS "Enable building of tranlations" ON) +OPTION(ENABLE_MANASERV "Enable Manaserv support" OFF) IF (WIN32) SET(PKG_DATADIR ".") @@ -46,7 +47,11 @@ ELSE (WIN32) ENDIF (WIN32) ADD_SUBDIRECTORY(data) -ADD_SUBDIRECTORY(libs/enet) + +IF (ENABLE_MANASERV) + ADD_SUBDIRECTORY(libs/enet) +ENDIF() + ADD_SUBDIRECTORY(src) IF (GETTEXT_FOUND AND ENABLE_NLS) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c9f23cc1..0fd32f59 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -22,11 +22,14 @@ IF (CMAKE_COMPILER_IS_GNUCXX) ENDIF() IF (POLICY CMP0015) - CMAKE_POLICY(SET CMP0015 OLD) + CMAKE_POLICY(SET CMP0015 OLD) +ENDIF() + +IF (ENABLE_MANASERV) + INCLUDE_DIRECTORIES("../libs/enet/include") + LINK_DIRECTORIES("../libs/enet") + SET(INTERNAL_LIBRARIES enet) ENDIF() -INCLUDE_DIRECTORIES("../libs/enet/include") -LINK_DIRECTORIES("../libs/enet") -SET(INTERNAL_LIBRARIES enet) SET(FLAGS "-DPACKAGE_VERSION=\\\"${VERSION}\\\"") SET(FLAGS "${FLAGS} -DPKG_DATADIR=\\\"${PKG_DATADIR}/\\\"") @@ -36,6 +39,10 @@ IF (ENABLE_NLS) SET(FLAGS "${FLAGS} -DENABLE_NLS=1") ENDIF() +IF (ENABLE_MANASERV) + SET(FLAGS "${FLAGS} -DMANASERV_SUPPORT=1") +ENDIF() + IF (CMAKE_BUILD_TYPE) STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER) IF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug OR @@ -623,7 +630,11 @@ ENDIF () SET (PROGRAMS mana) -ADD_EXECUTABLE(mana WIN32 ${SRCS} ${SRCS_MANA} ${SRCS_TMWA}) +IF (ENABLE_MANASERV) + ADD_EXECUTABLE(mana WIN32 ${SRCS} ${SRCS_MANA} ${SRCS_TMWA}) +ELSE(ENABLE_MANASERV) + ADD_EXECUTABLE(mana WIN32 ${SRCS} ${SRCS_TMWA}) +ENDIF(ENABLE_MANASERV) TARGET_LINK_LIBRARIES(mana ${INTERNAL_LIBRARIES} diff --git a/src/net/net.cpp b/src/net/net.cpp index 25dcd981..1b4bbf36 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -159,10 +159,11 @@ void connectToServer(ServerInfo &server) switch (server.type) { +#ifdef MANASERV_SUPPORT case ServerInfo::MANASERV: new ManaServ::GeneralHandler; break; - +#endif case ServerInfo::TMWATHENA: new TmwAthena::GeneralHandler; break; -- cgit v1.2.3-70-g09d2