Skip to content

Commit

Permalink
Tweaks to cmake so that pip and local builds both work (#663)
Browse files Browse the repository at this point in the history
* Don't run the submodule sync if not in a git dir
* update the cmakelists.txt
* Update cmake syntax so that equals works

Co-authored-by: ssteinbach <ssteinbach@users.noreply.github.com>
  • Loading branch information
ssteinbach and ssteinbach committed Mar 17, 2020
1 parent 0303169 commit 94597bf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/CMakeLists.txt
Expand Up @@ -11,8 +11,16 @@ endif()

# make sure that git submodules are up to date when building
find_package(Git QUIET)
if (GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --is-inside-work-tree
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
RESULT_VARIABLE IN_A_GIT_REPO_RETCODE
)
endif()

# XXX this is broken for travis builds
if (GIT_FOUND AND NOT DEFINED ENV{TRAVIS})
if (GIT_FOUND AND IN_A_GIT_REPO_RETCODE EQUAL 0 AND NOT DEFINED ENV{TRAVIS})
# you might want to turn this off if you're working in one of the submodules
# or trying it out with a different version of the submodule
option(GIT_UPDATE_SUBMODULES "Update submodules each build" ON)
Expand Down

0 comments on commit 94597bf

Please sign in to comment.