Merge pull request #293 from rolk/293_wogit
Make project buildable also without Git
This commit is contained in:
commit
e9b5a55b4b
@ -23,6 +23,15 @@ else ()
|
|||||||
find_package (Git)
|
find_package (Git)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
# if git is *still* not found means it is not present on the
|
||||||
|
# system, so there is "no" way we can update the SHA. notice
|
||||||
|
# that this is a slightly different version of the label than
|
||||||
|
# above.
|
||||||
|
if (NOT GIT_FOUND)
|
||||||
|
file (WRITE "${PROJECT_BINARY_DIR}/project-version.h"
|
||||||
|
"#define PROJECT_VERSION \"${${project}_LABEL}\"\n"
|
||||||
|
)
|
||||||
|
else ()
|
||||||
add_custom_target (update-version ALL
|
add_custom_target (update-version ALL
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
-DCMAKE_HOME_DIRECTORY=${CMAKE_HOME_DIRECTORY}
|
-DCMAKE_HOME_DIRECTORY=${CMAKE_HOME_DIRECTORY}
|
||||||
@ -38,4 +47,5 @@ else ()
|
|||||||
# but it must also be done before the main library so it can pick up
|
# but it must also be done before the main library so it can pick up
|
||||||
# any changes it does.
|
# any changes it does.
|
||||||
add_dependencies (${${project}_TARGET} update-version)
|
add_dependencies (${${project}_TARGET} update-version)
|
||||||
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
Loading…
Reference in New Issue
Block a user