openspades/Resources/CMakeLists.txt

81 lines
2.8 KiB
CMake
Raw Normal View History

if(OPENSPADES_RESOURCES)
2014-04-23 17:41:08 +11:00
if (WIN32)
# No automatic downloading for Windows (for now)
elseif (UNIX)
add_custom_target(OpenSpades_Resources_DevPaks ALL COMMENT "Downloading non-GPL assets")
add_custom_command(
TARGET OpenSpades_Resources_DevPaks
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/downloadpak.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endif()
2014-04-23 17:41:08 +11:00
# TODO: subgroups for script files
file(GLOB_RECURSE SCRIPT_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Scripts/*.as)
file(GLOB_RECURSE SHADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Shaders/*.fs
${CMAKE_CURRENT_SOURCE_DIR}/Shaders/*.program
${CMAKE_CURRENT_SOURCE_DIR}/Shaders/*.vs)
2014-04-23 17:41:08 +11:00
source_group("Scripts" FILES ${SCRIPT_FILES})
source_group("Shaders" FILES ${SHADER_FILES})
add_custom_target(OpenSpades_Resources ALL
COMMENT "Packing assets"
SOURCES ${SCRIPT_FILES} ${SHADER_FILES}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR})
if(WIN32)
if(MSVC)
# multi-config
add_custom_command(
TARGET OpenSpades_Resources
COMMAND powershell -ExecutionPolicy Bypass ${CMAKE_CURRENT_SOURCE_DIR}/mkpak.ps1
${CMAKE_BINARY_DIR}/bin/$<CONFIGURATION>/Resources
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
else()
add_custom_command(
TARGET OpenSpades_Resources
COMMAND powershell -ExecutionPolicy Bypass ${CMAKE_CURRENT_SOURCE_DIR}/mkpak.ps1
${CMAKE_BINARY_DIR}/bin/Resources
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endif()
elseif (UNIX)
add_custom_command(
TARGET OpenSpades_Resources
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/mkpak.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endif()
2014-04-23 21:47:48 +11:00
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/PackageInfo.json
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
2014-04-23 21:47:48 +11:00
endif()
2018-12-20 02:52:26 -05:00
if(UNIX)
2014-05-06 00:24:24 +11:00
add_custom_target(OpenSpades_Unix ALL COMMENT "Process unix stuff")
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Icons)
add_custom_command(
2014-05-06 00:24:24 +11:00
TARGET OpenSpades_Unix
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/Icons/converticons.sh ${CMAKE_CURRENT_SOURCE_DIR}/Icons
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Icons)
2014-04-27 12:52:28 +11:00
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Unix)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Unix/Debian)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Unix/Man)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Unix/Debian/copyright.in" "${CMAKE_CURRENT_BINARY_DIR}/Unix/Debian/copyright")
2014-04-27 15:13:34 +11:00
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Unix/Man/openspades.6.in" "${CMAKE_CURRENT_BINARY_DIR}/Unix/Man/openspades.6")
2014-04-27 12:52:28 +11:00
add_custom_command(
TARGET OpenSpades_Unix
COMMAND sh -c \"gzip -9 -c ${CMAKE_CURRENT_SOURCE_DIR}/Unix/Debian/changelog > changelog.gz\"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Unix/Debian
)
add_custom_command(
TARGET OpenSpades_Unix
COMMAND sh -c \"gzip -9 -c ${CMAKE_CURRENT_BINARY_DIR}/Unix/Man/openspades.6 > openspades.6.gz\"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Unix/Man
)
2018-12-20 02:52:26 -05:00
endif(UNIX)