Skip to content

Commit

Permalink
Merge pull request #178 from ngi-nix/fixnogit
Browse files Browse the repository at this point in the history
Fix building without git
  • Loading branch information
gatecat committed Sep 1, 2021
2 parents cd9b60f + 6bac5f0 commit 03e0070
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libtrellis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ endif()

find_package(Boost REQUIRED COMPONENTS ${boost_libs})

find_package(Git)

include_directories(include/ ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} 3rdparty/pybind11/include)

aux_source_directory(include/ INCLUDE_FILES)
Expand Down Expand Up @@ -113,7 +115,7 @@ string(STRIP "${CURRENT_GIT_VERSION}" CURRENT_GIT_VERSION)
if (EXISTS "${CMAKE_BINARY_DIR}/generated/last_git_version")
file(READ "${CMAKE_BINARY_DIR}/generated/last_git_version" LAST_GIT_VERSION)
endif()
if (NOT ("${LAST_GIT_VERSION}" STREQUAL "${CURRENT_GIT_VERSION}"))
if (NOT ("${LAST_GIT_VERSION}" STREQUAL "${CURRENT_GIT_VERSION}") OR NOT GIT_EXECUTABLE)
configure_file(
${CMAKE_SOURCE_DIR}/tools/version.cpp.in
${CMAKE_BINARY_DIR}/generated/version.cpp
Expand Down

0 comments on commit 03e0070

Please sign in to comment.