Skip to content

Commit 94597bf

Browse files
authored
Tweaks to cmake so that pip and local builds both work (#663)
* 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 <[email protected]>
1 parent 0303169 commit 94597bf

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,16 @@ endif()
1111

1212
# make sure that git submodules are up to date when building
1313
find_package(Git QUIET)
14+
if (GIT_FOUND)
15+
execute_process(
16+
COMMAND ${GIT_EXECUTABLE} rev-parse --is-inside-work-tree
17+
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
18+
RESULT_VARIABLE IN_A_GIT_REPO_RETCODE
19+
)
20+
endif()
21+
1422
# XXX this is broken for travis builds
15-
if (GIT_FOUND AND NOT DEFINED ENV{TRAVIS})
23+
if (GIT_FOUND AND IN_A_GIT_REPO_RETCODE EQUAL 0 AND NOT DEFINED ENV{TRAVIS})
1624
# you might want to turn this off if you're working in one of the submodules
1725
# or trying it out with a different version of the submodule
1826
option(GIT_UPDATE_SUBMODULES "Update submodules each build" ON)

0 commit comments

Comments
 (0)