mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -07:00
Cmake reorganization
* Move all cmake-related files in a new “cmake” folder * move nsis files in there, too, since they are templates parsed by cake * retrieve git version once when cmake is run, and use it for both creating version_string.h/cpp and for package naming
This commit is contained in:
parent
e997b1d2bc
commit
fc24ffdec2
11 changed files with 40 additions and 48 deletions
17
cmake/createversionfile.cmake
Normal file
17
cmake/createversionfile.cmake
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
set(VERSION_STRING_CPP "${PROJECT_BINARY_DIR}/version_string.cpp")
|
||||
set(VERSION_STRING_H "${PROJECT_BINARY_DIR}/version_string.h")
|
||||
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR})
|
||||
|
||||
set( hstring "extern const char *VERSION_STRING\;\n" )
|
||||
set( cppstring "const char * VERSION_STRING = \"${PROJECT_VERSION}\"\;\n")
|
||||
|
||||
file(WRITE ${PROJECT_BINARY_DIR}/version_string.cpp.txt ${cppstring} )
|
||||
file(WRITE ${PROJECT_BINARY_DIR}/version_string.h.txt ${hstring} )
|
||||
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_BINARY_DIR}/version_string.h.txt ${VERSION_STRING_H}
|
||||
)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_BINARY_DIR}/version_string.cpp.txt ${VERSION_STRING_CPP}
|
||||
)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue