Skip to content

Commit

Permalink
Fix building without git
Browse files Browse the repository at this point in the history
If git isn't present, don't try to cache the
build configuration.
  • Loading branch information
L-as committed Sep 1, 2021
1 parent dff1cbc commit 6bac5f0
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 6bac5f0

Please sign in to comment.