From 4f3ceccb18d10684aca2723d3f1c85e2ba87ea65 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 14 Jul 2010 17:46:30 +0200 Subject: [PATCH 1/2] Fixed: GCC error with templates (by Naush) --- code/nel/include/nel/3d/ps_color.h | 2 +- code/nel/include/nel/3d/ps_float.h | 2 +- code/nel/include/nel/3d/ps_int.h | 2 +- code/nel/include/nel/3d/ps_plane_basis_maker.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/nel/include/nel/3d/ps_color.h b/code/nel/include/nel/3d/ps_color.h index 1c52d68e4..a46e2122a 100644 --- a/code/nel/include/nel/3d/ps_color.h +++ b/code/nel/include/nel/3d/ps_color.h @@ -34,7 +34,7 @@ namespace NL3D { template <> -const char *CPSAttribMaker::getType() { return "CRGBA"; } +inline const char *CPSAttribMaker::getType() { return "CRGBA"; } // Depending on the driver, the format of colors in vertex buffer may change. We don't want to change the format for each data that is (dynamically) in vertex buffer, so diff --git a/code/nel/include/nel/3d/ps_float.h b/code/nel/include/nel/3d/ps_float.h index 20878de27..8dcc732aa 100644 --- a/code/nel/include/nel/3d/ps_float.h +++ b/code/nel/include/nel/3d/ps_float.h @@ -28,7 +28,7 @@ namespace NL3D { template <> -const char *CPSAttribMaker::getType() { return "float"; } +inline const char *CPSAttribMaker::getType() { return "float"; } /// these are some attribute makers for float /// This is a float blender class. It just blend between 2 values diff --git a/code/nel/include/nel/3d/ps_int.h b/code/nel/include/nel/3d/ps_int.h index 1985ec6d7..d821ad7b9 100644 --- a/code/nel/include/nel/3d/ps_int.h +++ b/code/nel/include/nel/3d/ps_int.h @@ -26,7 +26,7 @@ namespace NL3D { template <> -const char *CPSAttribMaker::getType() { return "int32"; } +inline const char *CPSAttribMaker::getType() { return "int32"; } /// these are some attribute makers for int diff --git a/code/nel/include/nel/3d/ps_plane_basis_maker.h b/code/nel/include/nel/3d/ps_plane_basis_maker.h index b7ae6de29..51714a368 100644 --- a/code/nel/include/nel/3d/ps_plane_basis_maker.h +++ b/code/nel/include/nel/3d/ps_plane_basis_maker.h @@ -28,7 +28,7 @@ namespace NL3D { template <> -const char *CPSAttribMaker::getType() { return "CPlaneBasis";} +inline const char *CPSAttribMaker::getType() { return "CPlaneBasis";} /** these are some attribute makers for plane_basis * This is a plane basis class. It just blend between 2 plane by linearly interpolating the normal From 9b391a24fad5b72c79f7ee7881a1f90588c54df4 Mon Sep 17 00:00:00 2001 From: Matt Raykowski Date: Wed, 14 Jul 2010 12:13:07 -0500 Subject: [PATCH 2/2] Changed: #842 Added helper macros to cleanup files, removed useless DECORATE_NEL_LIB macro and started adding WITH_STATIC/WITH_STATIC_DRIVER support for full static linking. --- code/nel/CMakeLists.txt | 8 ++ code/nel/CMakeModules/nel.cmake | 86 +++++++++++++++---- .../samples/3d/cluster_viewer/CMakeLists.txt | 12 +-- code/nel/samples/3d/font/CMakeLists.txt | 12 +-- .../samples/3d/shape_viewer/CMakeLists.txt | 6 +- code/nel/samples/georges/CMakeLists.txt | 9 +- code/nel/samples/misc/command/CMakeLists.txt | 9 +- .../samples/misc/configfile/CMakeLists.txt | 9 +- code/nel/samples/misc/debug/CMakeLists.txt | 12 +-- code/nel/samples/misc/i18n/CMakeLists.txt | 9 +- code/nel/samples/misc/log/CMakeLists.txt | 12 +-- code/nel/samples/misc/strings/CMakeLists.txt | 9 +- .../samples/misc/types_check/CMakeLists.txt | 15 +--- code/nel/samples/net/udp/CMakeLists.txt | 25 ++---- code/nel/src/3d/CMakeLists.txt | 20 ++--- .../nel/src/3d/driver/direct3d/CMakeLists.txt | 22 ++--- code/nel/src/3d/driver/opengl/CMakeLists.txt | 16 ++-- code/nel/src/georges/CMakeLists.txt | 20 +---- code/nel/src/ligo/CMakeLists.txt | 21 +---- code/nel/src/logic/CMakeLists.txt | 17 +--- code/nel/src/misc/CMakeLists.txt | 21 +---- code/nel/src/net/CMakeLists.txt | 31 ++----- code/nel/src/pacs/CMakeLists.txt | 18 +--- code/nel/src/sound/CMakeLists.txt | 20 +---- code/nel/src/sound/driver/CMakeLists.txt | 15 +--- .../src/sound/driver/openal/CMakeLists.txt | 15 +--- code/nel/tools/nel_unit_test/CMakeLists.txt | 16 +--- 27 files changed, 176 insertions(+), 309 deletions(-) diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 29af3e2b6..10b987724 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -75,6 +75,14 @@ FIND_PACKAGE(Jpeg) NL_SETUP_BUILD() +IF(WITH_STATIC_DRIVERS) + IF(WIN32) + ADD_DEFINITIONS(/DNL_STATIC) + ELSE(WIN32) + ADD_DEFINITIONS(-DNL_STATIC) + ENDIF(WIN32) +ENDIF(WITH_STATIC_DRIVERS) + # On Windows we need to find DirectInput for NLMISC. # This is how we get events. IF(WIN32) diff --git a/code/nel/CMakeModules/nel.cmake b/code/nel/CMakeModules/nel.cmake index f3e7162b7..9a03672be 100644 --- a/code/nel/CMakeModules/nel.cmake +++ b/code/nel/CMakeModules/nel.cmake @@ -1,27 +1,69 @@ ### -# Build Library Name +# Helper macro that generates .pc and installs it. +# Argument: name - the name of the .pc package, e.g. "nel-pacs.pc" +### +MACRO(NL_GEN_PC name) + IF(NOT WIN32) + CONFIGURE_FILE(${name}.in ${name}) + INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION lib/pkgconfig) + ENDIF(NOT WIN32) +ENDMACRO(NL_GEN_PC) + +### # -# Arguments: name - undecorated library name -# Sets: LIBNAME - decorated library name ### -MACRO(DECORATE_NEL_LIB name) +MACRO(NL_TARGET_LIB name) + IF(WITH_STATIC) + ADD_LIBRARY(${name} STATIC ${ARGN}) + ELSE(WITH_STATIC) + ADD_LIBRARY(${name} SHARED ${ARGN}) + ENDIF(WITH_STATIC) +ENDMACRO(NL_TARGET_LIB) +### +# +### +MACRO(NL_TARGET_DRIVER name) + IF(WITH_STATIC_DRIVERS) + ADD_LIBRARY(${name} STATIC ${ARGN}) + ELSE(WITH_STATIC_DRIVERS) + ADD_LIBRARY(${name} SHARED ${ARGN}) + ENDIF(WITH_STATIC_DRIVERS) +ENDMACRO(NL_TARGET_DRIVER) + +### +# Helper macro that sets the default library properties. +# Argument: name - the target name whose properties are being set +# Argument: +### +MACRO(NL_DEFAULT_PROPS name label) + SET_TARGET_PROPERTIES(${name} PROPERTIES + VERSION ${NL_VERSION} + SOVERSION ${NL_VERSION_MAJOR} + PROJECT_LABEL ${label}) +ENDMACRO(NL_DEFAULT_PROPS) + +### +# Adds the target suffix on Windows. +# Argument: name - the library's target name. +### +MACRO(NL_ADD_LIB_SUFFIX name) IF(WIN32) - IF(NL_BUILD_MODE MATCHES "NL_RELEASE_DEBUG") - SET(LIBNAME "${name}") - ELSE(NL_BUILD_MODE MATCHES "NL_RELEASE_DEBUG") - IF(NL_BUILD_MODE MATCHES "NL_DEBUG") - SET(LIBNAME "${name}") - ELSE(NL_BUILD_MODE MATCHES "NL_DEBUG") - SET(LIBNAME "${name}") - ENDIF(NL_BUILD_MODE MATCHES "NL_DEBUG") - ENDIF(NL_BUILD_MODE MATCHES "NL_RELEASE_DEBUG") - ELSE(WIN32) - SET(LIBNAME "${name}") + SET_TARGET_PROPERTIES(${name} PROPERTIES DEBUG_POSTFIX "_d" RELEASE_POSTFIX "_r") ENDIF(WIN32) +ENDMACRO(NL_ADD_LIB_SUFFIX) -ENDMACRO(DECORATE_NEL_LIB) - +### +# Adds the runtime link flags for Win32 binaries. +# Argument: name - the target to add the link flags to. +### +MACRO(NL_ADD_RUNTIME_FLAGS name) + IF(WIN32) + SET_TARGET_PROPERTIES(${name} PROPERTIES + LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" + LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}") + ENDIF(WIN32) +ENDMACRO(NL_ADD_RUNTIME_FLAGS) ### # Checks build vs. source location. Prevents In-Source builds. ### @@ -48,7 +90,15 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) OPTION(WITH_LOGGING "With Logging" ON ) OPTION(WITH_COVERAGE "With Code Coverage Support" OFF) OPTION(WITH_PCH "With Precompiled Headers" ON ) - + + # Default to static building on Windows. + IF(WIN32) + OPTION(WITH_STATIC "With static libraries." ON ) + ELSE(WIN32) + OPTION(WITH_STATIC "With static libraries." OFF) + ENDIF(WIN32) + OPTION(WITH_STATIC_DRIVERS "With static drivers." OFF) + ### # Core libraries ### diff --git a/code/nel/samples/3d/cluster_viewer/CMakeLists.txt b/code/nel/samples/3d/cluster_viewer/CMakeLists.txt index 22691e258..16208dd28 100644 --- a/code/nel/samples/3d/cluster_viewer/CMakeLists.txt +++ b/code/nel/samples/3d/cluster_viewer/CMakeLists.txt @@ -1,18 +1,14 @@ FILE(GLOB SRC *.cpp) -ADD_EXECUTABLE(nl_sample_clusterview ${SRC}) +ADD_EXECUTABLE(nl_sample_clusterview WIN32 ${SRC}) ADD_DEFINITIONS(-DCV_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_clusterview/\\"") INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_clusterview ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_clusterview PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" - PROJECT_LABEL "Samples, 3D: Cluster Viewer") -ENDIF(WIN32) +NL_ADD_RUNTIME_FLAGS(nl_sample_clusterview) +NL_DEFAULT_PROPS(nl_sample_clusterview "Samples, 3D: Cluster Viewer") + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_clusterview RUNTIME DESTINATION bin COMPONENT samples3d) diff --git a/code/nel/samples/3d/font/CMakeLists.txt b/code/nel/samples/3d/font/CMakeLists.txt index be5294180..503fa3e7a 100644 --- a/code/nel/samples/3d/font/CMakeLists.txt +++ b/code/nel/samples/3d/font/CMakeLists.txt @@ -1,18 +1,14 @@ FILE(GLOB SRC *.cpp) -ADD_EXECUTABLE(nl_sample_font ${SRC}) +ADD_EXECUTABLE(nl_sample_font WIN32 ${SRC}) ADD_DEFINITIONS(-DFONT_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_font/\\"") INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_font ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_font PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" - PROJECT_LABEL "Samples, 3D: Font") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_font "Samples, 3D: Font") +NL_ADD_RUNTIME_FLAGS(nl_sample_font) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_font RUNTIME DESTINATION bin COMPONENT samples3d) diff --git a/code/nel/samples/3d/shape_viewer/CMakeLists.txt b/code/nel/samples/3d/shape_viewer/CMakeLists.txt index 9f337e933..e0544ef1e 100644 --- a/code/nel/samples/3d/shape_viewer/CMakeLists.txt +++ b/code/nel/samples/3d/shape_viewer/CMakeLists.txt @@ -1,14 +1,16 @@ FILE(GLOB SRC *.cpp) -ADD_EXECUTABLE(nl_sample_shapeview ${SRC}) +ADD_EXECUTABLE(nl_sample_shapeview WIN32 ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_shapeview ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc nel3d) +NL_DEFAULT_PROPS(nl_sample_shapeview "Samples, 3D: Font") +NL_ADD_RUNTIME_FLAGS(nl_sample_shapeview) + IF(WIN32) SET_TARGET_PROPERTIES(nl_sample_shapeview PROPERTIES LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - LINK_FLAGS "/SUBSYSTEM:WINDOWS" PROJECT_LABEL "Samples, 3D: Shape Viewer") ENDIF(WIN32) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) diff --git a/code/nel/samples/georges/CMakeLists.txt b/code/nel/samples/georges/CMakeLists.txt index b7ebc962e..abbeb60af 100644 --- a/code/nel/samples/georges/CMakeLists.txt +++ b/code/nel/samples/georges/CMakeLists.txt @@ -6,12 +6,9 @@ ADD_DEFINITIONS(-DGF_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_georges/\\"") INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_georges ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelgeorges nelmisc) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_georges PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples: Georges") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_georges "Samples: Georges") +NL_ADD_RUNTIME_FLAGS(nl_sample_georges) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_georges RUNTIME DESTINATION bin COMPONENT samplesgeorges) diff --git a/code/nel/samples/misc/command/CMakeLists.txt b/code/nel/samples/misc/command/CMakeLists.txt index 9f471c4c0..b49cc0511 100644 --- a/code/nel/samples/misc/command/CMakeLists.txt +++ b/code/nel/samples/misc/command/CMakeLists.txt @@ -4,12 +4,9 @@ ADD_EXECUTABLE(nl_sample_command ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_command ${PLATFORM_LINKFLAGS} nelmisc) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_command PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, Misc: Commands") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_command "Samples, Misc: Commands") +NL_ADD_RUNTIME_FLAGS(nl_sample_command) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_command RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/configfile/CMakeLists.txt b/code/nel/samples/misc/configfile/CMakeLists.txt index bf71cf7fc..e0b16b701 100644 --- a/code/nel/samples/misc/configfile/CMakeLists.txt +++ b/code/nel/samples/misc/configfile/CMakeLists.txt @@ -6,12 +6,9 @@ ADD_DEFINITIONS(-DNL_SAMPLE_CFG="\\"${NL_SHARE_PREFIX}/nl_sample_configfile/\\"" INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_configfile ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_configfile PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, Misc: Config Files") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_configfile "Samples, Misc: Config Files") +NL_ADD_RUNTIME_FLAGS(nl_sample_configfile) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_configfile RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/debug/CMakeLists.txt b/code/nel/samples/misc/debug/CMakeLists.txt index 66a06a968..4b0569045 100644 --- a/code/nel/samples/misc/debug/CMakeLists.txt +++ b/code/nel/samples/misc/debug/CMakeLists.txt @@ -1,18 +1,12 @@ FILE(GLOB SRC *.cpp) -DECORATE_NEL_LIB("nelmisc") -SET(NLMISC_LIB ${LIBNAME}) - ADD_EXECUTABLE(nl_sample_debug ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_debug ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_debug PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, Misc: Debugging") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_debug "Samples, Misc: Debugging") +NL_ADD_RUNTIME_FLAGS(nl_sample_debug) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_debug RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/i18n/CMakeLists.txt b/code/nel/samples/misc/i18n/CMakeLists.txt index 9136a2503..9fc44db13 100644 --- a/code/nel/samples/misc/i18n/CMakeLists.txt +++ b/code/nel/samples/misc/i18n/CMakeLists.txt @@ -6,12 +6,9 @@ ADD_DEFINITIONS(-DNL_LANG_DATA="\\"${NL_SHARE_PREFIX}/nl_sample_i18n/\\"") INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_i18n ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_i18n PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, Misc: I18N") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_i18n "Samples, Misc: I18N") +NL_ADD_RUNTIME_FLAGS(nl_sample_i18n) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_i18n RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/log/CMakeLists.txt b/code/nel/samples/misc/log/CMakeLists.txt index 6ee6ad078..7f7085c83 100644 --- a/code/nel/samples/misc/log/CMakeLists.txt +++ b/code/nel/samples/misc/log/CMakeLists.txt @@ -1,18 +1,12 @@ FILE(GLOB SRC *.cpp) -DECORATE_NEL_LIB("nelmisc") -SET(NLMISC_LIB ${LIBNAME}) - ADD_EXECUTABLE(nl_sample_log ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_log ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_log PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, Misc: Logging") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_log "Samples, Misc: Logging") +NL_ADD_RUNTIME_FLAGS(nl_sample_log) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_log RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/strings/CMakeLists.txt b/code/nel/samples/misc/strings/CMakeLists.txt index 72b448b78..c0942fc2d 100644 --- a/code/nel/samples/misc/strings/CMakeLists.txt +++ b/code/nel/samples/misc/strings/CMakeLists.txt @@ -4,12 +4,9 @@ ADD_EXECUTABLE(nl_sample_strings ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_strings ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_strings PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, Misc: Strings") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_strings "Samples, Misc: Strings") +NL_ADD_RUNTIME_FLAGS(nl_sample_strings) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_strings RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/misc/types_check/CMakeLists.txt b/code/nel/samples/misc/types_check/CMakeLists.txt index d03fa394a..229a085f7 100644 --- a/code/nel/samples/misc/types_check/CMakeLists.txt +++ b/code/nel/samples/misc/types_check/CMakeLists.txt @@ -1,18 +1,11 @@ FILE(GLOB SRC *.cpp) -DECORATE_NEL_LIB("nelmisc") -SET(NLMISC_LIB ${LIBNAME}) - ADD_EXECUTABLE(nl_sample_types_check ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nl_sample_types_check ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} ${NLMISC_LIB}) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_types_check PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - ) -ENDIF(WIN32) +TARGET_LINK_LIBRARIES(nl_sample_types_check ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} nelmisc) +NL_ADD_RUNTIME_FLAGS(nl_sample_types_check) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -INSTALL(TARGETS nl_sample_types_check RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT samplesmisc) +INSTALL(TARGETS nl_sample_types_check RUNTIME DESTINATION bin COMPONENT samplesmisc) diff --git a/code/nel/samples/net/udp/CMakeLists.txt b/code/nel/samples/net/udp/CMakeLists.txt index 251211546..8b0511728 100644 --- a/code/nel/samples/net/udp/CMakeLists.txt +++ b/code/nel/samples/net/udp/CMakeLists.txt @@ -2,35 +2,22 @@ FILE(GLOB SRC *.cpp) ADD_EXECUTABLE(nl_sample_udpclient client.cpp graph.cpp graph.h simlag.cpp simlag.h) -IF(WIN32) - ADD_EXECUTABLE(nl_sample_udpserver WIN32 bench_service.cpp receive_task.cpp receive_task.h) -ELSE(WIN32) - ADD_EXECUTABLE(nl_sample_udpserver bench_service.cpp receive_task.cpp receive_task.h) -ENDIF(WIN32) +ADD_EXECUTABLE(nl_sample_udpserver WIN32 bench_service.cpp receive_task.cpp receive_task.h) ADD_DEFINITIONS(-DUDP_DIR="\\"${NL_SHARE_PREFIX}/nl_sample_udp/\\"") IF(WITH_3D) ADD_DEFINITIONS(-DUSE_3D) - DECORATE_NEL_LIB("nel3d") - SET(NL3D_LIB ${LIBNAME}) -ELSE(WITH_3D) - SET(NL3D_LIB "") ENDIF(WITH_3D) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nl_sample_udpclient ${PLATFORM_LINKFLAGS} nelmisc nelnet nel3d) TARGET_LINK_LIBRARIES(nl_sample_udpserver ${PLATFORM_LINKFLAGS} nelmisc nelnet) -IF(WIN32) - SET_TARGET_PROPERTIES(nl_sample_udpclient PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, Net, UDP: UDP Client") - SET_TARGET_PROPERTIES(nl_sample_udpserver PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Samples, Net, UDP: UDP Server") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nl_sample_udpclient "Samples, Net, UDP: UDP Client") +NL_DEFAULT_PROPS(nl_sample_udpserver "Samples, Net, UDP: UDP Server") +NL_ADD_RUNTIME_FLAGS(nl_sample_udpclient) +NL_ADD_RUNTIME_FLAGS(nl_sample_udpserver) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) INSTALL(TARGETS nl_sample_udpclient nl_sample_udpserver RUNTIME DESTINATION bin COMPONENT samplesnet) diff --git a/code/nel/src/3d/CMakeLists.txt b/code/nel/src/3d/CMakeLists.txt index d32a1a6a5..82acc0f91 100644 --- a/code/nel/src/3d/CMakeLists.txt +++ b/code/nel/src/3d/CMakeLists.txt @@ -662,26 +662,15 @@ SOURCE_GROUP(Shadows FILES shadow_poly_receiver.cpp ../../include/nel/3d/shadow_poly_receiver.h) -IF(NOT WIN32) - ADD_LIBRARY(nel3d SHARED ${SRC}) - CONFIGURE_FILE(nel-3d.pc.in nel-3d.pc) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-3d.pc" DESTINATION lib/pkgconfig) -ELSE(NOT WIN32) - ADD_LIBRARY(nel3d STATIC ${SRC}) -ENDIF(NOT WIN32) +NL_TARGET_LIB(nel3d ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS} ${JPEG_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel3d nelmisc ${FREETYPE_LIBRARY} ${JPEG_LIBRARY}) -SET_TARGET_PROPERTIES(nel3d PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL 3D") +NL_DEFAULT_PROPS(nel3d "Library: NeL 3D") + +NL_ADD_LIB_SUFFIX(nel3d) IF(WIN32) - SET_TARGET_PROPERTIES(nel3d PROPERTIES - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r") - IF(JPEG_FOUND) ADD_DEFINITIONS(/DUSE_JPEG) ENDIF(JPEG_FOUND) @@ -697,6 +686,7 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel3d ${CMAKE_CURRENT_SOURCE_DIR}/std3d.h ${CMAKE_CURRENT_SOURCE_DIR}/std3d.cpp) ENDIF(WITH_PCH) +NL_GEN_PC(nel-3d.pc) INSTALL(TARGETS nel3d LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) ADD_SUBDIRECTORY(driver) diff --git a/code/nel/src/3d/driver/direct3d/CMakeLists.txt b/code/nel/src/3d/driver/direct3d/CMakeLists.txt index f007893db..0bf8aa40f 100644 --- a/code/nel/src/3d/driver/direct3d/CMakeLists.txt +++ b/code/nel/src/3d/driver/direct3d/CMakeLists.txt @@ -1,23 +1,15 @@ FILE(GLOB SRC *.cpp *.h *.def) -DECORATE_NEL_LIB("nel_drv_direct3d_win") -SET(NLDRV_D3D_LIB ${LIBNAME}) -DECORATE_NEL_LIB("nel3d") -SET(NL3D_LIB ${LIBNAME}) - -ADD_LIBRARY(nel_drv_direct3d_win SHARED ${SRC}) +NL_TARGET_DRIVER(nel_drv_direct3d_win ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${FREETYPE_INC} ${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_drv_direct3d_win nel3d ${LIBXML2_LIBRARIES} ${FREETYPE_LIB} ${DXSDK_D3DX9_LIBRARY} ${DXSDK_D3D9_LIBRARY} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) -SET_TARGET_PROPERTIES(nel_drv_direct3d_win PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "Driver, Video: Direct3D") + +NL_DEFAULT_PROPS(nel_drv_direct3d_win "Driver, Video: Direct3D") +NL_ADD_RUNTIME_FLAGS(nel_drv_direct3d_win) +NL_ADD_LIB_SUFFIX(nel_drv_direct3d_win) + ADD_DEFINITIONS(/Ddriver_direct3d_EXPORTS) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) @@ -26,7 +18,7 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_direct3d_win ${CMAKE_CURRENT_SOURCE_DIR}/stddirect3d.h ${CMAKE_CURRENT_SOURCE_DIR}/stddirect3d.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_drv_direct3d_win LIBRARY DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) +INSTALL(TARGETS nel_drv_direct3d_win LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_direct3d_win RUNTIME DESTINATION maxplugin COMPONENT drivers3d) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/3d/driver/opengl/CMakeLists.txt b/code/nel/src/3d/driver/opengl/CMakeLists.txt index 6789bfaa0..84788891e 100644 --- a/code/nel/src/3d/driver/opengl/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengl/CMakeLists.txt @@ -10,23 +10,17 @@ ELSE(WIN32) SET(NLDRV_OGL_LIB "nel_drv_opengl") ENDIF(WIN32) -ADD_LIBRARY(${NLDRV_OGL_LIB} SHARED ${SRC}) +NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_LIBRARIES}) -SET_TARGET_PROPERTIES(${NLDRV_OGL_LIB} PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Driver, Video: OpenGL") +NL_DEFAULT_PROPS(${NLDRV_OGL_LIB} "Driver, Video: OpenGL") +NL_ADD_LIB_SUFFIX(${NLDRV_OGL_LIB}) +NL_ADD_RUNTIME_FLAGS(${NLDRV_OGL_LIB}) IF(WIN32) INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) - SET_TARGET_PROPERTIES(${NLDRV_OGL_LIB} PROPERTIES - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}") ADD_DEFINITIONS(/DDRIVER_OPENGL_EXPORTS) ELSE(WIN32) IF(APPLE) @@ -61,7 +55,7 @@ IF(NOT WITH_COCOA AND WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(${NLDRV_OGL_LIB} ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.h ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.cpp) ENDIF(NOT WITH_COCOA AND WITH_PCH) -INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) +INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS ${NLDRV_OGL_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/georges/CMakeLists.txt b/code/nel/src/georges/CMakeLists.txt index 7b46520eb..07bdeac61 100644 --- a/code/nel/src/georges/CMakeLists.txt +++ b/code/nel/src/georges/CMakeLists.txt @@ -4,26 +4,13 @@ FILE(GLOB PUB_H ../../include/nel/georges/*.h) SOURCE_GROUP(headers FILES ${PRIV_H} ${PUB_H}) -IF(NOT WIN32) - ADD_LIBRARY(nelgeorges SHARED ${SRC}) - CONFIGURE_FILE(nel-georges.pc.in nel-georges.pc) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-georges.pc" DESTINATION lib/pkgconfig) -ELSE(NOT WIN32) - ADD_LIBRARY(nelgeorges STATIC ${SRC}) -ENDIF(NOT WIN32) +NL_TARGET_LIB(nelgeorges ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nelgeorges nelmisc) -SET_TARGET_PROPERTIES(nelgeorges PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL Georges") +NL_DEFAULT_PROPS(nelgeorges "Library: NeL Georges") -IF(WIN32) - SET_TARGET_PROPERTIES(nelgeorges PROPERTIES - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r") -ENDIF(WIN32) +NL_ADD_LIB_SUFFIX(nelgeorges) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) @@ -31,4 +18,5 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelgeorges ${CMAKE_CURRENT_SOURCE_DIR}/stdgeorges.h ${CMAKE_CURRENT_SOURCE_DIR}/stdgeorges.cpp) ENDIF(WITH_PCH) +NL_GEN_PC(nel-georges.pc) INSTALL(TARGETS nelgeorges LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/src/ligo/CMakeLists.txt b/code/nel/src/ligo/CMakeLists.txt index c1ddd5b27..0ee8ac180 100644 --- a/code/nel/src/ligo/CMakeLists.txt +++ b/code/nel/src/ligo/CMakeLists.txt @@ -1,27 +1,14 @@ FILE(GLOB SRC *.cpp *.h) -IF(NOT WIN32) - ADD_LIBRARY(nelligo SHARED ${SRC}) - CONFIGURE_FILE(nel-ligo.pc.in nel-ligo.pc) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-ligo.pc" DESTINATION lib/pkgconfig) -ELSE(NOT WIN32) - ADD_LIBRARY(nelligo STATIC ${SRC}) -ENDIF(NOT WIN32) +NL_TARGET_LIB(nelligo ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nelligo ${LIBXML2_LIBRARIES} nelmisc) -SET_TARGET_PROPERTIES(nelligo PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL Ligo") - -IF(WIN32) - SET_TARGET_PROPERTIES(nelligo PROPERTIES - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nelligo "Library: NeL Ligo") +NL_ADD_LIB_SUFFIX(nelligo) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +NL_GEN_PC(nel-ligo.pc) INSTALL(TARGETS nelligo LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/src/logic/CMakeLists.txt b/code/nel/src/logic/CMakeLists.txt index 806190233..0f01f0641 100644 --- a/code/nel/src/logic/CMakeLists.txt +++ b/code/nel/src/logic/CMakeLists.txt @@ -1,23 +1,12 @@ FILE(GLOB SRC *.cpp *.h) -IF(NOT WIN32) - ADD_LIBRARY(nellogic SHARED ${SRC}) -ELSE(NOT WIN32) - ADD_LIBRARY(nellogic STATIC ${SRC}) -ENDIF(NOT WIN32) +NL_TARGET_LIB(nellogic ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nellogic ${LIBXML2_LIBRARIES} nelmisc nelnet) -SET_TARGET_PROPERTIES(nellogic PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL Logic") +NL_DEFAULT_PROPS(nellogic "Library: NeL Logic") -IF(WIN32) - SET_TARGET_PROPERTIES(nellogic PROPERTIES - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r") -ENDIF(WIN32) +NL_ADD_LIB_SUFFIX(nellogic) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) diff --git a/code/nel/src/misc/CMakeLists.txt b/code/nel/src/misc/CMakeLists.txt index ab523536c..bb404f88a 100644 --- a/code/nel/src/misc/CMakeLists.txt +++ b/code/nel/src/misc/CMakeLists.txt @@ -1,12 +1,6 @@ FILE(GLOB SRC *.cpp *.h config_file/*.cpp config_file/*.h) -IF(NOT WIN32) - ADD_LIBRARY(nelmisc SHARED ${SRC}) - CONFIGURE_FILE(nel-misc.pc.in nel-misc.pc) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-misc.pc" DESTINATION lib/pkgconfig) -ELSE(NOT WIN32) - ADD_LIBRARY(nelmisc STATIC ${SRC}) -ENDIF(NOT WIN32) +NL_TARGET_LIB(nelmisc ${SRC}) IF(WITH_GTK) IF(GTK2_FOUND) @@ -24,17 +18,9 @@ ENDIF(JPEG_FOUND) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${PNG_INCLUDE_DIR} config_file) TARGET_LINK_LIBRARIES(nelmisc ${LIBXML2_LIBRARIES} ${PNG_LIBRARIES} ${WINSOCK2_LIB}) -SET_TARGET_PROPERTIES(nelmisc PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL Misc") +NL_DEFAULT_PROPS(nelmisc "Library: NeL Misc") -IF(WIN32) - SET_TARGET_PROPERTIES(nelmisc PROPERTIES - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r") - INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) -ENDIF(WIN32) +NL_ADD_LIB_SUFFIX(nelmisc) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) @@ -42,4 +28,5 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelmisc ${CMAKE_CURRENT_SOURCE_DIR}/stdmisc.h ${CMAKE_CURRENT_SOURCE_DIR}/stdmisc.cpp) ENDIF(WITH_PCH) +NL_GEN_PC(nel-misc.pc) INSTALL(TARGETS nelmisc LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/src/net/CMakeLists.txt b/code/nel/src/net/CMakeLists.txt index 712ce0e5a..fa6e35e05 100644 --- a/code/nel/src/net/CMakeLists.txt +++ b/code/nel/src/net/CMakeLists.txt @@ -2,18 +2,7 @@ FILE(GLOB SRC "*.cpp") FILE(GLOB NET_MANAGER "net_manager.*") LIST(REMOVE_ITEM SRC ${NET_MANAGER}) -DECORATE_NEL_LIB("nelmisc") -SET(NLMISC_LIB ${LIBNAME}) -DECORATE_NEL_LIB("nelnet") -SET(NLNET_LIB ${LIBNAME}) - -IF(NOT WIN32) - ADD_LIBRARY(nelnet SHARED ${SRC}) - CONFIGURE_FILE(nel-net.pc.in nel-net.pc) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-net.pc" DESTINATION lib/pkgconfig) -ELSE(NOT WIN32) - ADD_LIBRARY(nelnet STATIC ${SRC}) -ENDIF(NOT WIN32) +NL_TARGET_LIB(nelnet ${SRC}) IF(WITH_GTK) IF(GTK2_FOUND) @@ -24,22 +13,16 @@ ENDIF(WITH_GTK) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nelnet ${LIBXML2_LIBRARIES} ${NLMISC_LIB}) -SET_TARGET_PROPERTIES(nelnet PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL Net") +TARGET_LINK_LIBRARIES(nelnet ${LIBXML2_LIBRARIES} nelmisc) +NL_DEFAULT_PROPS(nelnet "Library: NeL Net") -IF(WIN32) - SET_TARGET_PROPERTIES(${NLNET_LIB} PROPERTIES - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r") -ENDIF(WIN32) +NL_ADD_LIB_SUFFIX(nelnet) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) IF(WITH_PCH) - ADD_NATIVE_PRECOMPILED_HEADER(${NLNET_LIB} ${CMAKE_CURRENT_SOURCE_DIR}/stdnet.h ${CMAKE_CURRENT_SOURCE_DIR}/stdnet.cpp) + ADD_NATIVE_PRECOMPILED_HEADER(nelnet ${CMAKE_CURRENT_SOURCE_DIR}/stdnet.h ${CMAKE_CURRENT_SOURCE_DIR}/stdnet.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS ${NLNET_LIB} LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) +NL_GEN_PC(nel-net.pc) +INSTALL(TARGETS nelnet LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/src/pacs/CMakeLists.txt b/code/nel/src/pacs/CMakeLists.txt index 722f151d9..4f1c5e48d 100644 --- a/code/nel/src/pacs/CMakeLists.txt +++ b/code/nel/src/pacs/CMakeLists.txt @@ -1,27 +1,17 @@ FILE(GLOB SRC *.cpp *.h) -IF(NOT WIN32) - ADD_LIBRARY(nelpacs SHARED ${SRC}) - CONFIGURE_FILE(nel-pacs.pc.in nel-pacs.pc) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-pacs.pc" DESTINATION lib/pkgconfig) -ELSE(NOT WIN32) - ADD_LIBRARY(nelpacs STATIC ${SRC}) -ENDIF(NOT WIN32) +NL_TARGET_LIB(nelpacs ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nelpacs ${LIBXML2_LIBRARIES} nelmisc) -SET_TARGET_PROPERTIES(nelpacs PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL PACS") +NL_DEFAULT_PROPS(nelpacs "Library: NeL PACS") ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -IF(WIN32) - SET_TARGET_PROPERTIES(nelpacs PROPERTIES DEBUG_POSTFIX "_d" RELEASE_POSTFIX "_r") -ENDIF(WIN32) +NL_ADD_LIB_SUFFIX(nelpacs) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelpacs ${CMAKE_CURRENT_SOURCE_DIR}/stdpacs.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpacs.cpp) ENDIF(WITH_PCH) +NL_GEN_PC(nel-pacs.pc) INSTALL(TARGETS nelpacs LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/src/sound/CMakeLists.txt b/code/nel/src/sound/CMakeLists.txt index 36d43c182..28fe90c71 100644 --- a/code/nel/src/sound/CMakeLists.txt +++ b/code/nel/src/sound/CMakeLists.txt @@ -6,32 +6,20 @@ IF(APPLE) SET(SRC ${SRC} driver/sound_driver.cpp driver/buffer.cpp) ENDIF(APPLE) -IF(NOT WIN32) - ADD_LIBRARY(nelsound SHARED ${SRC}) - CONFIGURE_FILE(nel-sound.pc.in nel-sound.pc) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/nel-sound.pc" DESTINATION lib/pkgconfig) -ELSE(NOT WIN32) - ADD_LIBRARY(nelsound STATIC ${SRC}) -ENDIF(NOT WIN32) +nl_target_lib(nelsound ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nelsound ${LIBXML2_LIBRARIES} nelligo nelgeorges nel3d) -SET_TARGET_PROPERTIES(nelsound PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL Sound") +nl_default_props(nelsound "Library: NeL Sound") ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -IF(WIN32) - SET_TARGET_PROPERTIES(nelsound PROPERTIES - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r") -ENDIF(WIN32) +nl_add_lib_suffix(nelsound) IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelsound ${CMAKE_CURRENT_SOURCE_DIR}/stdsound.h ${CMAKE_CURRENT_SOURCE_DIR}/stdsound.cpp) ENDIF(WITH_PCH) +nl_gen_pc(nel-sound.pc) INSTALL(TARGETS nelsound LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) ADD_SUBDIRECTORY(driver) diff --git a/code/nel/src/sound/driver/CMakeLists.txt b/code/nel/src/sound/driver/CMakeLists.txt index 6ac614a69..3c504a20f 100644 --- a/code/nel/src/sound/driver/CMakeLists.txt +++ b/code/nel/src/sound/driver/CMakeLists.txt @@ -1,22 +1,13 @@ FILE(GLOB SRC *.cpp *.h) -IF(NOT WIN32) - ADD_LIBRARY(nelsnd_lowlevel SHARED ${SRC}) -ELSE(NOT WIN32) - ADD_LIBRARY(nelsnd_lowlevel STATIC ${SRC}) -ENDIF(NOT WIN32) +nl_target_lib(nelsnd_lowlevel ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nelsnd_lowlevel ${LIBXML2_LIBRARIES} nelsound) -SET_TARGET_PROPERTIES(nelsnd_lowlevel PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR} - PROJECT_LABEL "Library: NeL Sound Lowlevel") +nl_default_props(nelsnd_lowlevel "Library: NeL Sound Lowlevel") ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) -IF(WIN32) - SET_TARGET_PROPERTIES(nelsnd_lowlevel PROPERTIES DEBUG_POSTFIX "_d" RELEASE_POSTFIX "_r") -ENDIF(WIN32) +nl_add_lib_suffix(nelsnd_lowlevel) INSTALL(TARGETS nelsnd_lowlevel LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/code/nel/src/sound/driver/openal/CMakeLists.txt b/code/nel/src/sound/driver/openal/CMakeLists.txt index cb180898c..401a8d1ea 100644 --- a/code/nel/src/sound/driver/openal/CMakeLists.txt +++ b/code/nel/src/sound/driver/openal/CMakeLists.txt @@ -1,12 +1,12 @@ FILE(GLOB SRC *.cpp *.h) -ADD_LIBRARY(nel_drv_openal SHARED ${SRC}) +NL_TARGET_DRIVER(nel_drv_openal ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${OPENAL_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_drv_openal ${LIBXML2_LIBRARIES} ${OPENAL_LIBRARY} nelsnd_lowlevel) -SET_TARGET_PROPERTIES(nel_drv_openal PROPERTIES - VERSION ${NL_VERSION} - SOVERSION ${NL_VERSION_MAJOR}) +NL_DEFAULT_PROPS(nel_drv_openal "Driver, Sound: OpenAL") +NL_ADD_LIB_SUFFIX(nel_drv_openal) +NL_ADD_RUNTIME_FLAGS(nel_drv_openal) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) IF(WIN32) @@ -14,13 +14,6 @@ IF(WIN32) FIND_PACKAGE(EFXUtil) INCLUDE_DIRECTORIES(${EFXUTIL_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_drv_openal ${EFXUTIL_LIBRARY}) - - SET_TARGET_PROPERTIES(nel_drv_openal PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - DEBUG_POSTFIX "_d" - RELEASE_POSTFIX "_r" - PROJECT_LABEL "Driver, Sound: OpenAL") ENDIF(WIN32) IF(WITH_PCH) diff --git a/code/nel/tools/nel_unit_test/CMakeLists.txt b/code/nel/tools/nel_unit_test/CMakeLists.txt index 96fe4b110..66fefc76a 100644 --- a/code/nel/tools/nel_unit_test/CMakeLists.txt +++ b/code/nel/tools/nel_unit_test/CMakeLists.txt @@ -1,22 +1,12 @@ FILE(GLOB SRC *.cpp *.h) -DECORATE_NEL_LIB("nelmisc") -SET(NLMISC_LIB ${LIBNAME}) -DECORATE_NEL_LIB("nelnet") -SET(NLNET_LIB ${LIBNAME}) -DECORATE_NEL_LIB("nelligo") -SET(NLLIGO_LIB ${LIBNAME}) - ADD_EXECUTABLE(nel_unit_test ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${CPPTEST_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_unit_test ${LIBXML2_LIBRARIES} ${CPPTEST_LIBRARY} ${PLATFORM_LINKFLAGS} nelmisc nelnet nelligo) -IF(WIN32) - SET_TARGET_PROPERTIES(nel_unit_test PROPERTIES - LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" - LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}" - PROJECT_LABEL "Unit Tests") -ENDIF(WIN32) +NL_DEFAULT_PROPS(nel_unit_test "Unit Tests") +NL_ADD_RUNTIME_FLAGS(nel_unit_test) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) ADD_DEFINITIONS(-DNEL_UNIT_BASE="\\"${PROJECT_SOURCE_DIR}/tools/nel_unit_test/\\"")