Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 32 additions & 16 deletions Generals/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,42 +32,58 @@ if("${CMAKE_HOST_SYSTEM}" MATCHES "Windows" AND "${CMAKE_SYSTEM}" MATCHES "Windo
endif()

if(RTS_INSTALL_PREFIX_GENERALS AND NOT "${RTS_INSTALL_PREFIX_GENERALS}" STREQUAL "/registry")
install(TARGETS g_generals RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_GENERALS}")
install(FILES $<TARGET_PDB_FILE:g_generals> DESTINATION "${RTS_INSTALL_PREFIX_GENERALS}" OPTIONAL)
get_filename_component(INSTALL_BASENAME "${RTS_INSTALL_PREFIX_GENERALS}" NAME)
get_filename_component(INSTALL_PARENT "${RTS_INSTALL_PREFIX_GENERALS}" DIRECTORY)
get_filename_component(INSTALL_PARENT_BASENAME "${INSTALL_PARENT}" NAME)

if("${INSTALL_BASENAME}" STREQUAL "Command and Conquer Generals" AND
"${INSTALL_PARENT_BASENAME}" STREQUAL "Command and Conquer Generals Zero Hour")
set(RTS_INSTALL_PATH "${RTS_INSTALL_PREFIX_GENERALS}")
else()
set(NESTED_PATH "${RTS_INSTALL_PREFIX_GENERALS}/Command and Conquer Generals")
if(EXISTS "${NESTED_PATH}")
set(RTS_INSTALL_PATH "${NESTED_PATH}")
else()
set(RTS_INSTALL_PATH "${RTS_INSTALL_PREFIX_GENERALS}")
endif()
endif()

install(TARGETS g_generals RUNTIME DESTINATION "${RTS_INSTALL_PATH}")
install(FILES $<TARGET_PDB_FILE:g_generals> DESTINATION "${RTS_INSTALL_PATH}" OPTIONAL)

if(TARGET g_worldbuilder)
install(TARGETS g_worldbuilder RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_GENERALS}")
install(FILES $<TARGET_PDB_FILE:g_worldbuilder> DESTINATION "${RTS_INSTALL_PREFIX_GENERALS}" OPTIONAL)
install(TARGETS g_worldbuilder RUNTIME DESTINATION "${RTS_INSTALL_PATH}")
install(FILES $<TARGET_PDB_FILE:g_worldbuilder> DESTINATION "${RTS_INSTALL_PATH}" OPTIONAL)
endif()

if(TARGET g_particleeditor)
install(TARGETS g_particleeditor RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_GENERALS}")
install(FILES $<TARGET_PDB_FILE:g_particleeditor> DESTINATION "${RTS_INSTALL_PREFIX_GENERALS}" OPTIONAL)
install(TARGETS g_particleeditor RUNTIME DESTINATION "${RTS_INSTALL_PATH}")
install(FILES $<TARGET_PDB_FILE:g_particleeditor> DESTINATION "${RTS_INSTALL_PATH}" OPTIONAL)
endif()

if(TARGET g_debugwindow)
install(TARGETS g_debugwindow RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_GENERALS}")
install(FILES $<TARGET_PDB_FILE:g_debugwindow> DESTINATION "${RTS_INSTALL_PREFIX_GENERALS}" OPTIONAL)
install(TARGETS g_debugwindow RUNTIME DESTINATION "${RTS_INSTALL_PATH}")
install(FILES $<TARGET_PDB_FILE:g_debugwindow> DESTINATION "${RTS_INSTALL_PATH}" OPTIONAL)
endif()

if(TARGET g_guiedit)
install(TARGETS g_guiedit RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_GENERALS}")
install(FILES $<TARGET_PDB_FILE:g_guiedit> DESTINATION "${RTS_INSTALL_PREFIX_GENERALS}" OPTIONAL)
install(TARGETS g_guiedit RUNTIME DESTINATION "${RTS_INSTALL_PATH}")
install(FILES $<TARGET_PDB_FILE:g_guiedit> DESTINATION "${RTS_INSTALL_PATH}" OPTIONAL)
endif()

if(TARGET g_imagepacker)
install(TARGETS g_imagepacker RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_GENERALS}")
install(FILES $<TARGET_PDB_FILE:g_imagepacker> DESTINATION "${RTS_INSTALL_PREFIX_GENERALS}" OPTIONAL)
install(TARGETS g_imagepacker RUNTIME DESTINATION "${RTS_INSTALL_PATH}")
install(FILES $<TARGET_PDB_FILE:g_imagepacker> DESTINATION "${RTS_INSTALL_PATH}" OPTIONAL)
endif()

if(TARGET g_mapcachebuilder)
install(TARGETS g_mapcachebuilder RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_GENERALS}")
install(FILES $<TARGET_PDB_FILE:g_mapcachebuilder> DESTINATION "${RTS_INSTALL_PREFIX_GENERALS}" OPTIONAL)
install(TARGETS g_mapcachebuilder RUNTIME DESTINATION "${RTS_INSTALL_PATH}")
install(FILES $<TARGET_PDB_FILE:g_mapcachebuilder> DESTINATION "${RTS_INSTALL_PATH}" OPTIONAL)
endif()

if(TARGET g_w3dview)
install(TARGETS g_w3dview RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_GENERALS}")
install(FILES $<TARGET_PDB_FILE:g_w3dview> DESTINATION "${RTS_INSTALL_PREFIX_GENERALS}" OPTIONAL)
install(TARGETS g_w3dview RUNTIME DESTINATION "${RTS_INSTALL_PATH}")
install(FILES $<TARGET_PDB_FILE:g_w3dview> DESTINATION "${RTS_INSTALL_PATH}" OPTIONAL)
endif()
else()
message(STATUS "Generals install path not found. Registry keys for 'Generals' not found. "
Expand Down
52 changes: 34 additions & 18 deletions GeneralsMD/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,47 +31,63 @@ if("${CMAKE_HOST_SYSTEM}" MATCHES "Windows" AND "${CMAKE_SYSTEM}" MATCHES "Windo
endif()

if(RTS_INSTALL_PREFIX_ZEROHOUR AND NOT "${RTS_INSTALL_PREFIX_ZEROHOUR}" STREQUAL "/registry")
install(TARGETS z_generals RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}")
install(FILES $<TARGET_PDB_FILE:z_generals> DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}" OPTIONAL)
get_filename_component(INSTALL_BASENAME "${RTS_INSTALL_PREFIX_ZEROHOUR}" NAME)
get_filename_component(INSTALL_PARENT "${RTS_INSTALL_PREFIX_ZEROHOUR}" DIRECTORY)
get_filename_component(INSTALL_PARENT_BASENAME "${INSTALL_PARENT}" NAME)

if("${INSTALL_BASENAME}" STREQUAL "Command and Conquer Generals Zero Hour" AND
"${INSTALL_PARENT_BASENAME}" STREQUAL "Command and Conquer Generals Zero Hour")
set(RTS_INSTALL_PATH "${RTS_INSTALL_PREFIX_ZEROHOUR}")
else()
set(NESTED_PATH "${RTS_INSTALL_PREFIX_ZEROHOUR}/Command and Conquer Generals Zero Hour")
if(EXISTS "${NESTED_PATH}")
set(RTS_INSTALL_PATH "${NESTED_PATH}")
else()
set(RTS_INSTALL_PATH "${RTS_INSTALL_PREFIX_ZEROHOUR}")
endif()
endif()

install(TARGETS z_generals RUNTIME DESTINATION "${RTS_INSTALL_PATH}")
install(FILES $<TARGET_PDB_FILE:z_generals> DESTINATION "${RTS_INSTALL_PATH}" OPTIONAL)

if(TARGET z_worldbuilder)
install(TARGETS z_worldbuilder RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}")
install(FILES $<TARGET_PDB_FILE:z_worldbuilder> DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}" OPTIONAL)
install(TARGETS z_worldbuilder RUNTIME DESTINATION "${RTS_INSTALL_PATH}")
install(FILES $<TARGET_PDB_FILE:z_worldbuilder> DESTINATION "${RTS_INSTALL_PATH}" OPTIONAL)
endif()

if(TARGET z_particleeditor)
install(TARGETS z_particleeditor RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}")
install(FILES $<TARGET_PDB_FILE:z_particleeditor> DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}" OPTIONAL)
install(TARGETS z_particleeditor RUNTIME DESTINATION "${RTS_INSTALL_PATH}")
install(FILES $<TARGET_PDB_FILE:z_particleeditor> DESTINATION "${RTS_INSTALL_PATH}" OPTIONAL)
endif()

if(TARGET z_debugwindow)
install(TARGETS z_debugwindow RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}")
install(FILES $<TARGET_PDB_FILE:z_debugwindow> DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}" OPTIONAL)
install(TARGETS z_debugwindow RUNTIME DESTINATION "${RTS_INSTALL_PATH}")
install(FILES $<TARGET_PDB_FILE:z_debugwindow> DESTINATION "${RTS_INSTALL_PATH}" OPTIONAL)
endif()

if(TARGET z_guiedit)
install(TARGETS z_guiedit RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}")
install(FILES $<TARGET_PDB_FILE:z_guiedit> DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}" OPTIONAL)
install(TARGETS z_guiedit RUNTIME DESTINATION "${RTS_INSTALL_PATH}")
install(FILES $<TARGET_PDB_FILE:z_guiedit> DESTINATION "${RTS_INSTALL_PATH}" OPTIONAL)
endif()

if(TARGET z_imagepacker)
install(TARGETS z_imagepacker RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}")
install(FILES $<TARGET_PDB_FILE:z_imagepacker> DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}" OPTIONAL)
install(TARGETS z_imagepacker RUNTIME DESTINATION "${RTS_INSTALL_PATH}")
install(FILES $<TARGET_PDB_FILE:z_imagepacker> DESTINATION "${RTS_INSTALL_PATH}" OPTIONAL)
endif()

if(TARGET z_mapcachebuilder)
install(TARGETS z_mapcachebuilder RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}")
install(FILES $<TARGET_PDB_FILE:z_mapcachebuilder> DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}" OPTIONAL)
install(TARGETS z_mapcachebuilder RUNTIME DESTINATION "${RTS_INSTALL_PATH}")
install(FILES $<TARGET_PDB_FILE:z_mapcachebuilder> DESTINATION "${RTS_INSTALL_PATH}" OPTIONAL)
endif()

if(TARGET z_w3dview)
install(TARGETS z_w3dview RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}")
install(FILES $<TARGET_PDB_FILE:z_w3dview> DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}" OPTIONAL)
install(TARGETS z_w3dview RUNTIME DESTINATION "${RTS_INSTALL_PATH}")
install(FILES $<TARGET_PDB_FILE:z_w3dview> DESTINATION "${RTS_INSTALL_PATH}" OPTIONAL)
endif()

if(TARGET z_wdump)
install(TARGETS z_wdump RUNTIME DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}")
install(FILES $<TARGET_PDB_FILE:z_wdump> DESTINATION "${RTS_INSTALL_PREFIX_ZEROHOUR}" OPTIONAL)
install(TARGETS z_wdump RUNTIME DESTINATION "${RTS_INSTALL_PATH}")
install(FILES $<TARGET_PDB_FILE:z_wdump> DESTINATION "${RTS_INSTALL_PATH}" OPTIONAL)
endif()
else()
message(STATUS "Zero Hour install path not found. Registry keys for 'Command and Conquer Generals Zero Hour' not found. "
Expand Down
Loading