Changed: New option WITH_INSTALL_LIBRARIES which allows user to install only final binaries and no development files (header, static libraries, etc...)

This commit is contained in:
kervala 2011-09-11 14:44:37 +02:00
parent bcd12da536
commit fedf6d5f77
23 changed files with 130 additions and 82 deletions

View file

@ -3,10 +3,10 @@
# Argument: name - the name of the .pc package, e.g. "nel-pacs.pc"
###
MACRO(NL_GEN_PC name)
IF(NOT WIN32)
IF(NOT WIN32 AND WITH_INSTALL_LIBRARIES)
CONFIGURE_FILE(${name}.in "${CMAKE_CURRENT_BINARY_DIR}/${name}")
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION lib/pkgconfig)
ENDIF(NOT WIN32)
ENDIF(NOT WIN32 AND WITH_INSTALL_LIBRARIES)
ENDMACRO(NL_GEN_PC)
###
@ -184,6 +184,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
OPTION(WITH_EXTERNAL "With provided external." OFF)
ENDIF(WIN32)
OPTION(WITH_STATIC_EXTERNAL "With static external libraries" OFF)
OPTION(WITH_INSTALL_LIBRARIES "Install development files." ON )
###
# GUI toolkits
@ -480,7 +481,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
IF(WIN32)
SET(RYZOM_ETC_PREFIX "." CACHE PATH "Installation path for configurations")
ELSE(WIN32)
SET(RYZOM_ETC_PREFIX "${CMAKE_INSTALL_PREFIX}/etc/ryzom" CACHE PATH "Installation path for configurations")
SET(RYZOM_ETC_PREFIX "${RYZOM_PREFIX}/etc/ryzom" CACHE PATH "Installation path for configurations")
ENDIF(WIN32)
ENDIF(NOT RYZOM_ETC_PREFIX)
@ -489,7 +490,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
IF(WIN32)
SET(RYZOM_SHARE_PREFIX "." CACHE PATH "Installation path for data.")
ELSE(WIN32)
SET(RYZOM_SHARE_PREFIX "${CMAKE_INSTALL_PREFIX}/share/ryzom" CACHE PATH "Installation path for data.")
SET(RYZOM_SHARE_PREFIX "${RYZOM_PREFIX}/share/ryzom" CACHE PATH "Installation path for data.")
ENDIF(WIN32)
ENDIF(NOT RYZOM_SHARE_PREFIX)
@ -498,7 +499,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
IF(WIN32)
SET(RYZOM_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.")
ELSE(WIN32)
SET(RYZOM_SBIN_PREFIX "${CMAKE_INSTALL_PREFIX}/sbin" CACHE PATH "Installation path for admin tools and services.")
SET(RYZOM_SBIN_PREFIX "${RYZOM_PREFIX}/sbin" CACHE PATH "Installation path for admin tools and services.")
ENDIF(WIN32)
ENDIF(NOT RYZOM_SBIN_PREFIX)
@ -507,7 +508,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
IF(WIN32)
SET(RYZOM_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.")
ELSE(WIN32)
SET(RYZOM_BIN_PREFIX "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation path for tools.")
SET(RYZOM_BIN_PREFIX "${RYZOM_PREFIX}/bin" CACHE PATH "Installation path for tools.")
ENDIF(WIN32)
ENDIF(NOT RYZOM_BIN_PREFIX)
@ -516,7 +517,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
IF(WIN32)
SET(RYZOM_GAMES_PREFIX "." CACHE PATH "Installation path for tools and applications.")
ELSE(WIN32)
SET(RYZOM_GAMES_PREFIX "${CMAKE_INSTALL_PREFIX}/games" CACHE PATH "Installation path for client.")
SET(RYZOM_GAMES_PREFIX "${RYZOM_PREFIX}/games" CACHE PATH "Installation path for client.")
ENDIF(WIN32)
ENDIF(NOT RYZOM_GAMES_PREFIX)

View file

@ -54,6 +54,7 @@ IF(WITH_GTK)
FIND_PACKAGE(GTK2)
ENDIF(WITH_GTK)
IF(WITH_INSTALL_LIBRARIES)
IF(UNIX)
SET(prefix ${CMAKE_INSTALL_PREFIX})
SET(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin)
@ -72,6 +73,8 @@ IF(UNIX)
ENDIF(UNIX)
ADD_SUBDIRECTORY(include)
ENDIF(WITH_INSTALL_LIBRARIES)
ADD_SUBDIRECTORY(src)
IF(WITH_NEL_SAMPLES)

View file

@ -706,6 +706,9 @@ IF(WITH_PCH)
ENDIF(WITH_PCH)
NL_GEN_PC(nel-3d.pc)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nel3d LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
ADD_SUBDIRECTORY(driver)

View file

@ -16,7 +16,9 @@ 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)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS)
INSTALL(TARGETS nel_drv_direct3d_win LIBRARY DESTINATION ${NL_DRIVER_PREFIX} 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)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS)

View file

@ -61,7 +61,9 @@ IF(NOT APPLE AND WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(${NLDRV_OGL_LIB} ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.h ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.cpp)
ENDIF(NOT APPLE AND WITH_PCH)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS)
INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d)
IF(WITH_MAXPLUGIN)
INSTALL(TARGETS ${NLDRV_OGL_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d)
ENDIF(WITH_MAXPLUGIN)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS)

View file

@ -11,4 +11,6 @@ NL_ADD_LIB_SUFFIX(nelceguirenderer)
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DNEL_CEGUIRENDERER_EXPORTS)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nelceguirenderer RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)

View file

@ -21,4 +21,7 @@ IF(WITH_PCH)
ENDIF(WITH_PCH)
NL_GEN_PC(nel-georges.pc)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nelgeorges LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)

View file

@ -19,4 +19,7 @@ IF(WITH_PCH)
ENDIF(WITH_PCH)
NL_GEN_PC(nel-ligo.pc)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nelligo LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)

View file

@ -14,4 +14,6 @@ NL_ADD_LIB_SUFFIX(nellogic)
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nellogic LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)

View file

@ -53,4 +53,7 @@ IF(WITH_PCH)
ENDIF(WITH_PCH)
NL_GEN_PC(nel-misc.pc)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nelmisc LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)

View file

@ -24,4 +24,7 @@ IF(WITH_PCH)
ENDIF(WITH_PCH)
NL_GEN_PC(nel-net.pc)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nelnet LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)

View file

@ -19,4 +19,7 @@ IF(WITH_PCH)
ENDIF(WITH_PCH)
NL_GEN_PC(nel-pacs.pc)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nelpacs LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)

View file

@ -19,6 +19,9 @@ IF(WITH_PCH)
ENDIF(WITH_PCH)
NL_GEN_PC(nel-sound.pc)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nelsound LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
ADD_SUBDIRECTORY(driver)

View file

@ -23,7 +23,9 @@ IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(nelsnd_lowlevel ${CMAKE_CURRENT_SOURCE_DIR}/stdsound_lowlevel.h ${CMAKE_CURRENT_SOURCE_DIR}/stdsound_lowlevel.cpp)
ENDIF(WITH_PCH)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nelsnd_lowlevel LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
IF(WITH_DRIVER_OPENAL)
ADD_SUBDIRECTORY(openal)

View file

@ -13,7 +13,9 @@ IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_dsound_win ${CMAKE_CURRENT_SOURCE_DIR}/stddsound.h ${CMAKE_CURRENT_SOURCE_DIR}/stddsound.cpp)
ENDIF(WITH_PCH)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS)
INSTALL(TARGETS nel_drv_dsound_win RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound)
IF(WITH_MAXPLUGIN)
INSTALL(TARGETS nel_drv_dsound_win RUNTIME DESTINATION maxplugin COMPONENT driverssound)
ENDIF(WITH_MAXPLUGIN)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS)

View file

@ -13,7 +13,9 @@ IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_fmod_win ${CMAKE_CURRENT_SOURCE_DIR}/stdfmod.h ${CMAKE_CURRENT_SOURCE_DIR}/stdfmod.cpp)
ENDIF(WITH_PCH)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS)
INSTALL(TARGETS nel_drv_fmod_win RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound)
IF(WITH_MAXPLUGIN)
INSTALL(TARGETS nel_drv_fmod_win RUNTIME DESTINATION maxplugin COMPONENT driverssound)
ENDIF(WITH_MAXPLUGIN)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS)

View file

@ -44,7 +44,9 @@ IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(${NLDRV_AL_LIB} ${CMAKE_CURRENT_SOURCE_DIR}/stdopenal.h ${CMAKE_CURRENT_SOURCE_DIR}/stdopenal.cpp)
ENDIF(WITH_PCH)
INSTALL(TARGETS ${NLDRV_AL_LIB} RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS)
INSTALL(TARGETS ${NLDRV_AL_LIB} RUNTIME DESTINATION ${NL_DRIVER_PREFIX} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound)
IF(WITH_MAXPLUGIN)
INSTALL(TARGETS ${NLDRV_AL_LIB} RUNTIME DESTINATION maxplugin COMPONENT driverssound)
ENDIF(WITH_MAXPLUGIN)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS)

View file

@ -40,7 +40,9 @@ IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_xaudio2_win ${CMAKE_CURRENT_SOURCE_DIR}/stdxaudio2.h ${CMAKE_CURRENT_SOURCE_DIR}/stdxaudio2.cpp)
ENDIF(WITH_PCH)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS)
INSTALL(TARGETS nel_drv_xaudio2_win RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound)
IF(WITH_MAXPLUGIN)
INSTALL(TARGETS nel_drv_xaudio2_win RUNTIME DESTINATION maxplugin COMPONENT driverssound)
ENDIF(WITH_MAXPLUGIN)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC_DRIVERS) OR NOT WITH_STATIC_DRIVERS)

View file

@ -1,6 +1,6 @@
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(data)
ADD_SUBDIRECTORY(patcher)
#ADD_SUBDIRECTORY(data)
#ADD_SUBDIRECTORY(patcher)
IF(UNIX AND NOT APPLE)
ADD_SUBDIRECTORY(unix)

View file

@ -113,4 +113,4 @@ IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(ryzom_client ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp)
ENDIF(WITH_PCH)
INSTALL(TARGETS ryzom_client RUNTIME DESTINATION games COMPONENT client BUNDLE DESTINATION /Applications)
INSTALL(TARGETS ryzom_client RUNTIME DESTINATION ${RYZOM_GAMES_PREFIX} COMPONENT client BUNDLE DESTINATION /Applications)

View file

@ -13,4 +13,6 @@ IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(ryzom_clientsheets ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp)
ENDIF(WITH_PCH)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS ryzom_clientsheets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)

View file

@ -19,5 +19,7 @@ NL_ADD_LIB_SUFFIX(ryzom_sevenzip)
ADD_DEFINITIONS(-D_SZ_ONE_DIRECTORY)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS ryzom_sevenzip LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
INSTALL(TARGETS 7zDec RUNTIME DESTINATION bin COMPONENT client)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)

View file

@ -22,5 +22,6 @@ IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(ryzom_gameshare ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp)
ENDIF(WITH_PCH)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS ryzom_gameshare LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)