1 cmake_minimum_required(VERSION 2.8.11)
2 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
3 project(xonotic-data LANGUAGES ASM)
5 include_directories(qcsrc)
7 add_definitions(-DNDEBUG=1)
9 find_package(Git REQUIRED)
11 COMMAND ${GIT_EXECUTABLE} describe --tags --dirty=*
12 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
13 OUTPUT_VARIABLE GIT_DESC
14 OUTPUT_STRIP_TRAILING_WHITESPACE
16 add_definitions(-DWATERMARK=\"${GIT_DESC}\")
18 set_source_files_properties(
19 qcsrc/client/progs.inc
20 qcsrc/server/progs.inc
24 HEADER_FILE_ONLY FALSE
27 add_executable(csprogs qcsrc/client/progs.inc)
28 target_compile_definitions(csprogs PRIVATE -DCSQC)
29 add_dependencies(csprogs gmqcc)
31 add_executable(progs qcsrc/server/progs.inc)
32 target_compile_definitions(progs PRIVATE -DSVQC)
33 add_dependencies(progs gmqcc)
35 add_executable(menu qcsrc/menu/progs.inc)
36 target_compile_definitions(menu PRIVATE -DMENUQC)
37 add_dependencies(menu gmqcc)
40 add_custom_target(${prog}.pk3
41 DEPENDS ${prog}-${GIT_DESC}.pk3
43 add_custom_command(OUTPUT ${prog}-${GIT_DESC}.pk3
45 COMMAND ${CMAKE_COMMAND} -E echo "http://xonotic.org" > "${prog}-${GIT_DESC}.txt"
46 COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE_DIR:${prog}>/${prog}.dat" "${prog}-${GIT_DESC}.dat"
47 COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE_DIR:${prog}>/${prog}.lno" "${prog}-${GIT_DESC}.lno"
48 COMMAND ${CMAKE_COMMAND} -E tar "cfv" "${prog}-${GIT_DESC}.pk3" --format=zip
49 "${prog}-${GIT_DESC}.txt"
50 "${prog}-${GIT_DESC}.dat"
51 "${prog}-${GIT_DESC}.lno"