mirror of
https://github.com/FWGS/hlsdk-xash3d
synced 2025-01-09 02:25:32 +01:00
Add install() for CMake.
This commit is contained in:
parent
e1dce5fce9
commit
c128c69ceb
@ -32,6 +32,10 @@ option(USE_VOICEMGR "Enable VOICE MANAGER." OFF)
|
||||
option(BUILD_CLIENT "Build client dll" ON)
|
||||
option(BUILD_SERVER "Build server dll" ON)
|
||||
option(GOLDSOURCE_SUPPORT "Build goldsource compatible client library" OFF)
|
||||
set(GAMEDIR "valve" CACHE STRING "Gamedir path")
|
||||
set(SERVER_INSTALL_DIR "dlls" CACHE STRING "Where put server dll")
|
||||
set(CLIENT_INSTALL_DIR "cl_dlls" CACHE STRING "Where put client dll")
|
||||
set(SERVER_LIBRARY_NAME "hl" CACHE STRING "Library name for Linux/MacOS/Windows")
|
||||
|
||||
#-----------------
|
||||
# MAIN BUILD CODE \
|
||||
|
@ -110,6 +110,17 @@ if (GOLDSOURCE_SUPPORT)
|
||||
target_link_libraries( ${CLDLL_LIBRARY} ${CMAKE_DL_LIBS} )
|
||||
endif()
|
||||
|
||||
set_target_properties (${CLDLL_SHARED} PROPERTIES
|
||||
set_target_properties (${CLDLL_LIBRARY} PROPERTIES
|
||||
POSITION_INDEPENDENT_CODE 1)
|
||||
|
||||
if(APPLE OR WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
set_target_properties(${CLDLL_LIBRARY} PROPERTIES
|
||||
OUTPUT_NAME "client"
|
||||
PREFIX "")
|
||||
endif()
|
||||
|
||||
install( TARGETS ${CLDLL_LIBRARY}
|
||||
DESTINATION "${GAMEDIR}/${CLIENT_INSTALL_DIR}/"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
||||
GROUP_READ GROUP_EXECUTE
|
||||
WORLD_READ WORLD_EXECUTE )
|
||||
|
@ -145,6 +145,17 @@ endif()
|
||||
|
||||
add_library (${SVDLL_LIBRARY} SHARED ${SVDLL_SOURCES})
|
||||
|
||||
set_target_properties (${SVDLL_SHARED} PROPERTIES
|
||||
set_target_properties (${SVDLL_LIBRARY} PROPERTIES
|
||||
POSITION_INDEPENDENT_CODE 1)
|
||||
|
||||
if(APPLE OR WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
set_target_properties(${SVDLL_LIBRARY} PROPERTIES
|
||||
OUTPUT_NAME ${SERVER_LIBRARY_NAME}
|
||||
PREFIX "")
|
||||
endif()
|
||||
|
||||
install( TARGETS ${SVDLL_LIBRARY}
|
||||
DESTINATION "${GAMEDIR}/${SERVER_INSTALL_DIR}/"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
||||
GROUP_READ GROUP_EXECUTE
|
||||
WORLD_READ WORLD_EXECUTE)
|
||||
|
Loading…
Reference in New Issue
Block a user