Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Bård Skaflestad 2013-07-31 15:37:56 +02:00
commit 0ad891aaba

View File

@ -23,19 +23,29 @@ else ()
find_package (Git) find_package (Git)
endif () endif ()
add_custom_target (update-version ALL # if git is *still* not found means it is not present on the
COMMAND ${CMAKE_COMMAND} # system, so there is "no" way we can update the SHA. notice
-DCMAKE_HOME_DIRECTORY=${CMAKE_HOME_DIRECTORY} # that this is a slightly different version of the label than
-DGIT_EXECUTABLE=${GIT_EXECUTABLE} # above.
-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR} if (NOT GIT_FOUND)
-DPROJECT_BINARY_DIR=${PROJECT_BINARY_DIR} file (WRITE "${PROJECT_BINARY_DIR}/project-version.h"
-DPROJECT_LABEL=${${project}_LABEL} "#define PROJECT_VERSION \"${${project}_LABEL}\"\n"
-P ${PROJECT_SOURCE_DIR}/cmake/Scripts/WriteVerSHA.cmake )
COMMENT "Updating version information" else ()
) add_custom_target (update-version ALL
COMMAND ${CMAKE_COMMAND}
-DCMAKE_HOME_DIRECTORY=${CMAKE_HOME_DIRECTORY}
-DGIT_EXECUTABLE=${GIT_EXECUTABLE}
-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
-DPROJECT_BINARY_DIR=${PROJECT_BINARY_DIR}
-DPROJECT_LABEL=${${project}_LABEL}
-P ${PROJECT_SOURCE_DIR}/cmake/Scripts/WriteVerSHA.cmake
COMMENT "Updating version information"
)
# the target above gets built every time thanks to the "ALL" modifier, # the target above gets built every time thanks to the "ALL" modifier,
# 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 ()