Skip to content

Commit 03e0070

Browse files
authored
Merge pull request #178 from ngi-nix/fixnogit
Fix building without git
2 parents cd9b60f + 6bac5f0 commit 03e0070

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libtrellis/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ endif()
5858

5959
find_package(Boost REQUIRED COMPONENTS ${boost_libs})
6060

61+
find_package(Git)
62+
6163
include_directories(include/ ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} 3rdparty/pybind11/include)
6264

6365
aux_source_directory(include/ INCLUDE_FILES)
@@ -113,7 +115,7 @@ string(STRIP "${CURRENT_GIT_VERSION}" CURRENT_GIT_VERSION)
113115
if (EXISTS "${CMAKE_BINARY_DIR}/generated/last_git_version")
114116
file(READ "${CMAKE_BINARY_DIR}/generated/last_git_version" LAST_GIT_VERSION)
115117
endif()
116-
if (NOT ("${LAST_GIT_VERSION}" STREQUAL "${CURRENT_GIT_VERSION}"))
118+
if (NOT ("${LAST_GIT_VERSION}" STREQUAL "${CURRENT_GIT_VERSION}") OR NOT GIT_EXECUTABLE)
117119
configure_file(
118120
${CMAKE_SOURCE_DIR}/tools/version.cpp.in
119121
${CMAKE_BINARY_DIR}/generated/version.cpp

0 commit comments

Comments
 (0)