Skip to content

Commit

Permalink
Optimize building of netgames libraries
Browse files Browse the repository at this point in the history
Simplify building libraries by copying them into Descent3 directory.
  • Loading branch information
winterheart committed Oct 20, 2024
1 parent 4d16177 commit ac08491
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 14 deletions.
17 changes: 16 additions & 1 deletion Descent3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,22 @@ target_link_libraries(Descent3 PRIVATE
${PLATFORM_LIBS})
target_include_directories(Descent3 PRIVATE ${PROJECT_BINARY_DIR}/lib)
target_link_options(Descent3 PRIVATE $<$<PLATFORM_ID:Windows>:/DEBUG:FULL>)
add_dependencies(Descent3 get_git_hash Direct_TCP_IP_Hog Descent3_Online_TCP_IP_Hog HogFull NetgamesDir Parallax_Online_Hog)
add_dependencies(Descent3
get_git_hash
Direct_TCP_IP_Hog
Descent3_Online_TCP_IP_Hog
HogFull
Parallax_Online_Hog
anarchy
coop
ctf
entropy
hoard
hyperanarchy
monsterball
roboanarchy
tanarchy
)
install(TARGETS Descent3 RUNTIME BUNDLE DESTINATION .)
if(MSVC)
install(FILES $<TARGET_PDB_FILE:Descent3> DESTINATION ${CMAKE_INSTALL_BINDIR})
Expand Down
13 changes: 0 additions & 13 deletions netgames/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,3 @@ add_subdirectory(hyperanarchy)
add_subdirectory(monsterball)
add_subdirectory(roboanarchy)
add_subdirectory(tanarchy)

add_custom_target(NetgamesDir
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:anarchy> "$<TARGET_FILE_DIR:Descent3>/netgames/Anarchy.d3m"
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:coop> "$<TARGET_FILE_DIR:Descent3>/netgames/Co-op.d3m"
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:ctf> "$<TARGET_FILE_DIR:Descent3>/netgames/CTF.d3m"
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:entropy> "$<TARGET_FILE_DIR:Descent3>/netgames/Entropy.d3m"
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:hoard> "$<TARGET_FILE_DIR:Descent3>/netgames/Hoard.d3m"
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:hyperanarchy> "$<TARGET_FILE_DIR:Descent3>/netgames/Hyper-Anarchy.d3m"
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:monsterball> "$<TARGET_FILE_DIR:Descent3>/netgames/Monsterball.d3m"
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:roboanarchy> "$<TARGET_FILE_DIR:Descent3>/netgames/Robo-Anarchy.d3m"
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:tanarchy> "$<TARGET_FILE_DIR:Descent3>/netgames/Team Anarchy.d3m"
COMMENT "Create netgames/ directory"
)
1 change: 1 addition & 0 deletions netgames/anarchy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ add_library(${NETGAME_MODULE} MODULE ${CPPS} ${HEADERS})
set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden")
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
set_target_properties(${NETGAME_MODULE} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:Descent3>/netgames")

target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
Expand Down
1 change: 1 addition & 0 deletions netgames/coop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ add_library(${NETGAME_MODULE} MODULE ${CPPS} ${HEADERS})
set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden")
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
set_target_properties(${NETGAME_MODULE} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:Descent3>/netgames")

target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
Expand Down
1 change: 1 addition & 0 deletions netgames/ctf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ add_library(${NETGAME_MODULE} MODULE ${CPPS} ${HEADERS})
set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden")
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
set_target_properties(${NETGAME_MODULE} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:Descent3>/netgames")

target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
Expand Down
1 change: 1 addition & 0 deletions netgames/entropy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ add_library(${NETGAME_MODULE} MODULE ${CPPS} ${HEADERS})
set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden")
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
set_target_properties(${NETGAME_MODULE} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:Descent3>/netgames")

target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
Expand Down
1 change: 1 addition & 0 deletions netgames/hoard/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ add_library(${NETGAME_MODULE} MODULE ${CPPS} ${HEADERS})
set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden")
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
set_target_properties(${NETGAME_MODULE} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:Descent3>/netgames")

target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
Expand Down
1 change: 1 addition & 0 deletions netgames/hyperanarchy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ add_library(${NETGAME_MODULE} MODULE ${CPPS} ${HEADERS})
set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden")
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
set_target_properties(${NETGAME_MODULE} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:Descent3>/netgames")

target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
Expand Down
1 change: 1 addition & 0 deletions netgames/monsterball/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ add_library(${NETGAME_MODULE} MODULE ${CPPS} ${HEADERS})
set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden")
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
set_target_properties(${NETGAME_MODULE} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:Descent3>/netgames")

target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
Expand Down
1 change: 1 addition & 0 deletions netgames/roboanarchy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ add_library(${NETGAME_MODULE} MODULE ${CPPS} ${HEADERS})
set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden")
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
set_target_properties(${NETGAME_MODULE} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:Descent3>/netgames")

target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
Expand Down
1 change: 1 addition & 0 deletions netgames/tanarchy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ add_library(${NETGAME_MODULE} MODULE ${CPPS} ${HEADERS})
set_target_properties(${NETGAME_MODULE} PROPERTIES CXX_VISIBILITY_PRESET "hidden")
set_target_properties(${NETGAME_MODULE} PROPERTIES PREFIX "")
set_target_properties(${NETGAME_MODULE} PROPERTIES SUFFIX ".d3m")
set_target_properties(${NETGAME_MODULE} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:Descent3>/netgames")

target_link_libraries(${NETGAME_MODULE} PRIVATE
dmfc
Expand Down

0 comments on commit ac08491

Please sign in to comment.