|
|
|
|
@ -87,38 +87,41 @@ set(localedir "${CMAKE_INSTALL_FULL_DATAROOTDIR}/locale")
|
|
|
|
|
configure_file(gncla-dir.h.in gncla-dir.h)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Create gnc-vcs-info.h
|
|
|
|
|
# This can only be done when building from a vcs (git/svn/bzr/svk) working directory.
|
|
|
|
|
# This file is shipped in the distribution tarball, so no need to generate it in that case anyway.
|
|
|
|
|
# The meta-cmake gymnastics here come from https://cmake.org/pipermail/cmake/2010-July/038015.html
|
|
|
|
|
if (BUILDING_FROM_VCS)
|
|
|
|
|
set(VCS_INFO_BASE_DIR ${CMAKE_BINARY_DIR})
|
|
|
|
|
else()
|
|
|
|
|
set(VCS_INFO_BASE_DIR ${CMAKE_SOURCE_DIR})
|
|
|
|
|
endif()
|
|
|
|
|
set(VCS_INFO_FILE ${VCS_INFO_BASE_DIR}/libgnucash/core-utils/gnc-vcs-info.h CACHE STRING "path to gnc-vcs-info.h file")
|
|
|
|
|
|
|
|
|
|
if (BUILDING_FROM_VCS)
|
|
|
|
|
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h.in
|
|
|
|
|
### Build rules for gnc-vcs-info.h
|
|
|
|
|
# When building from a distribution tarball simply use the one
|
|
|
|
|
# found in the source tree.
|
|
|
|
|
# When building from a git working directory extract the neede information from git.
|
|
|
|
|
# Otherwise work from the PROJECT_VERSION variable and today's date, but annotate
|
|
|
|
|
# the version info to indicate it's inaccurate.
|
|
|
|
|
|
|
|
|
|
if (GENERATE_VCS_INFO)
|
|
|
|
|
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h.in
|
|
|
|
|
"/* Autogenerated. Do not change. */
|
|
|
|
|
#define GNC_VCS_REV \"@GNC_VCS_REV@\"
|
|
|
|
|
#define GNC_VCS_REV_DATE \"@GNC_VCS_REV_DATE@\"
|
|
|
|
|
#define GNC_VCS_REV_YEAR \"@GNC_VCS_REV_YEAR@\"
|
|
|
|
|
#define GNC_VCS_REV_Y_M \"@GNC_VCS_REV_Y_M@\"
|
|
|
|
|
")
|
|
|
|
|
|
|
|
|
|
add_custom_target(gnc-vcs-info ALL
|
|
|
|
|
BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h.in
|
|
|
|
|
-D DST=${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h
|
|
|
|
|
-D SRC_DIR=${CMAKE_SOURCE_DIR}
|
|
|
|
|
-D SHELL="${SHELL}"
|
|
|
|
|
-P ${CMAKE_SOURCE_DIR}/cmake/git2version-info.cmake
|
|
|
|
|
)
|
|
|
|
|
#define GNC_VCS_REV_Y_M \"@GNC_VCS_REV_Y_M@\"")
|
|
|
|
|
|
|
|
|
|
if (BUILDING_FROM_VCS)
|
|
|
|
|
add_custom_target(gnc-vcs-info ALL
|
|
|
|
|
BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h.in
|
|
|
|
|
-D DST=${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h
|
|
|
|
|
-D SRC_DIR=${CMAKE_SOURCE_DIR}
|
|
|
|
|
-D SHELL="${SHELL}"
|
|
|
|
|
-P ${CMAKE_SOURCE_DIR}/cmake/git2version-info.cmake)
|
|
|
|
|
else()
|
|
|
|
|
add_custom_target(gnc-vcs-info ALL
|
|
|
|
|
BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h.in
|
|
|
|
|
-D DST=${CMAKE_CURRENT_BINARY_DIR}/gnc-vcs-info.h
|
|
|
|
|
-D PROJECT_VERSION=${PROJECT_VERSION}
|
|
|
|
|
-P ${CMAKE_SOURCE_DIR}/cmake/no-vcs2version-info.cmake)
|
|
|
|
|
endif()
|
|
|
|
|
else()
|
|
|
|
|
add_custom_target(gnc-vcs-info DEPENDS ${VCS_INFO_FILE})
|
|
|
|
|
endif()
|
|
|
|
|
dist_add_generated (${BUILDING_FROM_VCS} gnc-vcs-info.h)
|
|
|
|
|
dist_add_generated (${GENERATE_VCS_INFO} gnc-vcs-info.h)
|
|
|
|
|
|
|
|
|
|
# Dist files
|
|
|
|
|
set_local_dist(core_utils_DIST_local
|
|
|
|
|
|