From 7b96c2328fcfcec7e8657895b0a532b9478c3887 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 25 Sep 2010 22:53:33 +0200 Subject: [PATCH] Changed: Updated CMake projects --- code/nel/src/sound/driver/CMakeLists.txt | 4 +- .../3d/plugin_max/nel_export/CMakeLists.txt | 4 ++ code/nel/tools/3d/tile_edit_qt/CMakeLists.txt | 2 +- .../logic/logic_editor_dll/CMakeLists.txt | 2 +- .../tools/misc/words_dic_qt/CMakeLists.txt | 2 +- code/nelns/CMakeLists.txt | 19 ------- code/ryzom/CMakeLists.txt | 3 +- code/ryzom/client/CMakeLists.txt | 8 +-- code/snowballs2/CMakeLists.txt | 51 ++----------------- code/snowballs2/client/CMakeLists.txt | 2 +- 10 files changed, 21 insertions(+), 76 deletions(-) diff --git a/code/nel/src/sound/driver/CMakeLists.txt b/code/nel/src/sound/driver/CMakeLists.txt index f52332aa5..c2ae80606 100644 --- a/code/nel/src/sound/driver/CMakeLists.txt +++ b/code/nel/src/sound/driver/CMakeLists.txt @@ -3,15 +3,15 @@ FILE(GLOB HEADERS ../../../include/nel/sound/driver/*.h) NL_TARGET_LIB(nelsnd_lowlevel ${HEADERS} ${SRC}) -INCLUDE_DIRECTORIES(${OGG_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${VORBIS_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nelsnd_lowlevel nelmisc ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY}) + IF(WITH_STATIC) # Add libogg dependency only if target is static because to libvorbisfile TARGET_LINK_LIBRARIES(nelsnd_lowlevel ${OGG_LIBRARY}) ENDIF(WITH_STATIC) - SET_TARGET_PROPERTIES(nelsnd_lowlevel PROPERTIES LINK_INTERFACE_LIBRARIES "") NL_DEFAULT_PROPS(nelsnd_lowlevel "NeL, Library: Sound Lowlevel") NL_ADD_RUNTIME_FLAGS(nelsnd_lowlevel) diff --git a/code/nel/tools/3d/plugin_max/nel_export/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_export/CMakeLists.txt index 0c2a215dc..acdc62160 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_export/CMakeLists.txt @@ -27,4 +27,8 @@ SET_TARGET_PROPERTIES(nel_export PROPERTIES SUFFIX ".dlu") ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_PCH) + ADD_NATIVE_PRECOMPILED_HEADER(object_viewer_dll ${CMAKE_CURRENT_SOURCE_DIR}/std_afx.h ${CMAKE_CURRENT_SOURCE_DIR}/std_afx.cpp) +ENDIF(WITH_PCH) + INSTALL(TARGETS nel_export RUNTIME DESTINATION maxplugin/plugins LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/tools/3d/tile_edit_qt/CMakeLists.txt b/code/nel/tools/3d/tile_edit_qt/CMakeLists.txt index 087e948b1..b8ad70d6f 100644 --- a/code/nel/tools/3d/tile_edit_qt/CMakeLists.txt +++ b/code/nel/tools/3d/tile_edit_qt/CMakeLists.txt @@ -19,7 +19,7 @@ SOURCE_GROUP(PICLibrary FILES ${PIC_SRC}) ADD_EXECUTABLE(tile_edit_qt ${TILE_EDIT_SRC} ${PIC_SRC} ${TILE_EDIT_MOC_SRCS} ${TILE_EDIT_RC_SRCS} ${TILE_EDIT_UI_HDRS}) TARGET_LINK_LIBRARIES(tile_edit_qt ${QT_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d) -NL_DEFAULT_PROPS(tile_edit_qt "Tools, 3D: Qt Tile Editor") +NL_DEFAULT_PROPS(tile_edit_qt "NeL, Tools, 3D: Qt Tile Editor") NL_ADD_RUNTIME_FLAGS(tile_edit_qt) ADD_DEFINITIONS(${QT_DEFINITIONS}) diff --git a/code/nel/tools/logic/logic_editor_dll/CMakeLists.txt b/code/nel/tools/logic/logic_editor_dll/CMakeLists.txt index 14ad340d5..0b2595a65 100644 --- a/code/nel/tools/logic/logic_editor_dll/CMakeLists.txt +++ b/code/nel/tools/logic/logic_editor_dll/CMakeLists.txt @@ -2,7 +2,7 @@ FILE(GLOB SRC *.cpp *.h res/logic_editor.rc2) ENABLE_LANGUAGE(RC) -ADD_DEFINITIONS(-D_AFXDLL) +ADD_DEFINITIONS(${MFC_DEFINITIONS}) SET(CMAKE_MFC_FLAG 2) ADD_LIBRARY(logic_editor_dll SHARED ${SRC}) diff --git a/code/nel/tools/misc/words_dic_qt/CMakeLists.txt b/code/nel/tools/misc/words_dic_qt/CMakeLists.txt index 6c7e04156..f0b9ddb9a 100644 --- a/code/nel/tools/misc/words_dic_qt/CMakeLists.txt +++ b/code/nel/tools/misc/words_dic_qt/CMakeLists.txt @@ -22,7 +22,7 @@ QT4_WRAP_CPP( WORDS_DIC_MOC_SRCS ${WORDS_DIC_HDR}) ADD_EXECUTABLE(words_dic_qt ${WORDS_DIC_SRC} ${WORDS_DIC_MOC_SRCS} ${WORDS_DIC_RC_SRCS} ${WORDS_DIC_UI_HDRS} ${WORDS_DIC_RC}) TARGET_LINK_LIBRARIES(words_dic_qt ${QT_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) -NL_DEFAULT_PROPS(words_dic_qt "Tools, Misc: Qt Words Dic") +NL_DEFAULT_PROPS(words_dic_qt "NeL, Tools, Misc: Qt Words Dic") NL_ADD_RUNTIME_FLAGS(words_dic_qt) ADD_DEFINITIONS(${QT_DEFINITIONS}) diff --git a/code/nelns/CMakeLists.txt b/code/nelns/CMakeLists.txt index 5bd88cb51..9a8402fac 100644 --- a/code/nelns/CMakeLists.txt +++ b/code/nelns/CMakeLists.txt @@ -1,25 +1,6 @@ -#----------------------------------------------------------------------------- -# Override default options -OPTION(BUILD_SERVICES "Build NeLNS Services" ON ) -OPTION(BUILD_LOGIN_SYSTEM "Build NeLNS Login System Tools" ON ) -OPTION(BUILD_RYZOM_LAUNCHER "Build Ryzom Launcher" OFF) - -#----------------------------------------------------------------------------- -#Platform specifics - FIND_PACKAGE(MySQL) FIND_PACKAGE(CURL) -IF(WITH_QT) - FIND_PACKAGE(Qt4 REQUIRED) -ENDIF(WITH_QT) - -SET(ETCDIR "${NL_ETC_PREFIX}/nelns") -SET(PKGDIR "${NL_SHARE_PREFIX}/nelns") -SET(LOGDIR "${NL_LOG_PREFIX}/nelns") -ADD_DEFINITIONS(-DNELNS_CONFIG="\\"${ETCDIR}\\"" -DNELNS_STATE="\\"${PKGDIR}\\"" -DNELNS_LOGS="\\"${LOGDIR}\\"") -INSTALL(CODE "FILE(MAKE_DIRECTORY ${LOGDIR})") - IF(BUILD_SERVICES) ADD_SUBDIRECTORY(admin_executor_service) ADD_SUBDIRECTORY(admin_service) diff --git a/code/ryzom/CMakeLists.txt b/code/ryzom/CMakeLists.txt index 6c74161c3..bf0aa4c19 100644 --- a/code/ryzom/CMakeLists.txt +++ b/code/ryzom/CMakeLists.txt @@ -8,7 +8,7 @@ ELSE(WITH_LUA51) ENDIF(WITH_LUA51) FIND_PACKAGE(Luabind REQUIRED) FIND_PACKAGE(CURL REQUIRED) -FIND_PACKAGE(Libwww) +FIND_PACKAGE(Libwww REQUIRED) FIND_PACKAGE(ZLIB) IF(NOT WIN32 AND NOT APPLE) FIND_PACKAGE(X11) @@ -27,6 +27,7 @@ ENDIF(NOT WIN32) IF(WITH_STATIC) FIND_PACKAGE(OpenSSL QUIET) IF(OPENSSL_FOUND) + SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR}) SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES}) ENDIF(OPENSSL_FOUND) SET(CURL_DEFINITIONS -DCURL_STATICLIB) diff --git a/code/ryzom/client/CMakeLists.txt b/code/ryzom/client/CMakeLists.txt index 466291933..db2ffce2a 100644 --- a/code/ryzom/client/CMakeLists.txt +++ b/code/ryzom/client/CMakeLists.txt @@ -6,9 +6,9 @@ IF(UNIX AND NOT APPLE) ADD_SUBDIRECTORY(unix) ENDIF(UNIX AND NOT APPLE) -IF(RYZOM_SHARE_PREFIX) +IF(RYZOM_ETC_PREFIX) CONFIGURE_FILE(client_default.cfg.in "${CMAKE_CURRENT_BINARY_DIR}/client_default.cfg") - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/client_default.cfg" DESTINATION etc/ryzom) -ELSE(RYZOM_SHARE_PREFIX) + INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/client_default.cfg" DESTINATION ${RYZOM_ETC_PREFIX}) +ELSE(RYZOM_ETC_PREFIX) INSTALL(FILES client_default.cfg DESTINATION etc/ryzom) -ENDIF(RYZOM_SHARE_PREFIX) +ENDIF(RYZOM_ETC_PREFIX) diff --git a/code/snowballs2/CMakeLists.txt b/code/snowballs2/CMakeLists.txt index 8040f33ec..0f158fb88 100644 --- a/code/snowballs2/CMakeLists.txt +++ b/code/snowballs2/CMakeLists.txt @@ -1,49 +1,3 @@ -#----------------------------------------------------------------------------- -# -# Snowballs -# Author: Nevrax -# -# Notes: -# * Changing install location: add -DCMAKE_INSTALL_PREFIX:PATH=/my/new/path -# * Changing NeL prefix: add -DNEL_PREFIX_PATH:PATH=/my/nel/install -# -#----------------------------------------------------------------------------- - -#----------------------------------------------------------------------------- -# Load some macros. -SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}") -INCLUDE(CMakeModules/nel.cmake) - -#----------------------------------------------------------------------------- -# Force out of source builds. -CHECK_OUT_OF_SOURCE() - -IF(WIN32) - SET(CMAKE_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/../3rdParty/include;${CMAKE_INCLUDE_PATH}") - SET(CMAKE_LIBRARY_PATH "${CMAKE_SOURCE_DIR}/../3rdParty/lib;${CMAKE_LIBRARY_PATH}") - IF(NOT DEFINED ENV{QTDIR}) - SET(ENV{QTDIR} "c:/qt/4.5.0") - ENDIF(NOT DEFINED ENV{QTDIR}) -ENDIF(WIN32) - -IF(DEFINED NEL_PREFIX_PATH) - SET(CMAKE_INCLUDE_PATH "${NEL_PREFIX_PATH}/include;${CMAKE_INCLUDE_PATH}") - SET(CMAKE_LIBRARY_PATH "${NEL_PREFIX_PATH}/lib;${CMAKE_LIBRARY_PATH}") -ENDIF(DEFINED NEL_PREFIX_PATH) - -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) - -PROJECT(Snowballs CXX C) -SET(SB_VERSION_MAJOR 0) -SET(SB_VERSION_MINOR 4) -SET(SB_VERSION_PATCH 0) -SET(SB_VERSION "${SB_VERSION_MAJOR}.${SB_VERSION_MINOR}.${SB_VERSION_PATCH}") - -#----------------------------------------------------------------------------- -# Redirect output files -SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) -SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) - #-----------------------------------------------------------------------------^M # Set CMake 2.6 Policies. IF(COMMAND cmake_policy) @@ -92,6 +46,11 @@ IF(BUILD_CLIENT) ENDIF(ENABLE_SOUND) ENDIF(BUILD_CLIENT) +IF(WIN32) + INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake) + SET(WINSOCK2_LIB ws2_32.lib) +ENDIF(WIN32) + NL_SETUP_BUILD_FLAGS() ADD_DEFINITIONS(-DSNOWBALLS_CONFIG="${SNOWBALLS_CONFIG_FILE}/" -DSNOWBALLS_STATE="${SNOWBALLS_LOG_FILE}/" -DSNOWBALLS_LOGS="${SNOWBALLS_LOG_FILE}/") diff --git a/code/snowballs2/client/CMakeLists.txt b/code/snowballs2/client/CMakeLists.txt index f44026d8d..a4a257383 100644 --- a/code/snowballs2/client/CMakeLists.txt +++ b/code/snowballs2/client/CMakeLists.txt @@ -3,7 +3,7 @@ ADD_SUBDIRECTORY(src) SET(database "${SNOWBALLS_DATA_FILE}") CONFIGURE_FILE(client.cfg.in client.cfg) -INSTALL(FILES ${CMAKE_BINARY_DIR}/client.cfg DESTINATION etc/snowballs COMPONENT snowballsclient) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/client.cfg DESTINATION etc/snowballs COMPONENT snowballsclient) INSTALL(DIRECTORY data/ DESTINATION share/games/snowballs COMPONENT snowballsdata