fix CMakeLists.txt

This commit is contained in:
HiGarfield 2023-02-09 01:23:51 +08:00
parent e5ecd33ec4
commit 82ba4f7d1b

View File

@ -5,6 +5,17 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 11)
execute_process(COMMAND git rev-parse HEAD
OUTPUT_VARIABLE GIT_VER
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if (GIT_VER STREQUAL "")
set(GIT_VER "unknown")
endif()
file(WRITE git_version.h "const char *gitversion = \"${GIT_VER}\";")
file(REMOVE makefile)
set(SOURCE_FILES
main.cpp
lib/md5.cpp