-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Git hooks for updating version in header
- Loading branch information
Showing
6 changed files
with
25 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env sh | ||
|
||
if ! git diff --quiet --cached src/*; then | ||
if ! git diff --cached -U0 CMakeLists.txt | grep -q ' VERSION'; then | ||
ver="$(git describe --always --long | sed 's/^v//')" | ||
ver="${ver%-*}-$(git branch --show-current)" | ||
echo "Updating version macro to $ver" | ||
sed -i 's/#define XDGDIRS_VER ".*"/#define XDGDIRS_VER "'"$ver"'"/' src/xdgdirs.h | ||
git add src/xdgdirs.h | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,3 @@ | ||
set(CMAKE_C_OUTPUT_EXTENSION_REPLACE YES) | ||
add_library("${XDGDIRS}" STATIC xdgdirs.c) | ||
|
||
add_custom_target(version | ||
${CMAKE_COMMAND} | ||
-D SRC=${CMAKE_CURRENT_SOURCE_DIR}/xdgdirs_ver.h.in | ||
-D DST=${CMAKE_CURRENT_SOURCE_DIR}/xdgdirs_ver.h | ||
-P ${CMAKE_CURRENT_SOURCE_DIR}/GenerateVersion.cmake | ||
) | ||
add_dependencies(${XDGDIRS} version) | ||
|
||
file(GLOB_RECURSE INCLUDE_FILES "*.h") | ||
|
||
set_target_properties("${XDGDIRS}" | ||
PROPERTIES | ||
PUBLIC_HEADER "${INCLUDE_FILES}" | ||
) | ||
set_target_properties("${XDGDIRS}" PROPERTIES PUBLIC_HEADER "src/xdgdirs.h") |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.