2020-06-07 05:55:15 +00:00
|
|
|
# _scmversion.cpp is a dummy file that will never be created, so the command will always be run
|
2020-04-16 15:56:11 +00:00
|
|
|
if(WIN32)
|
2020-06-07 05:55:15 +00:00
|
|
|
add_custom_command(OUTPUT scmversion.cpp _scmversion.cpp
|
2020-05-16 03:10:31 +00:00
|
|
|
COMMAND cmd /k "${CMAKE_CURRENT_SOURCE_DIR}/gen_scmversion.bat"
|
|
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
2020-04-16 15:56:11 +00:00
|
|
|
else()
|
2020-06-07 05:55:15 +00:00
|
|
|
add_custom_command(OUTPUT scmversion.cpp _scmversion.cpp
|
2020-05-16 03:10:31 +00:00
|
|
|
COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/gen_scmversion.sh")
|
2020-04-16 15:56:11 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library(scmversion
|
|
|
|
scmversion.cpp
|
|
|
|
scmversion.h
|
|
|
|
)
|
|
|
|
|