Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fe52be1

Browse filesBrowse files
authored
cmake : handle cases where git index is not found in .git (#5844)
* Update CMakeLists.txt * Update CMakeLists.txt
1 parent 6d341ab commit fe52be1
Copy full SHA for fe52be1

File tree

Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed

‎common/CMakeLists.txt

Copy file name to clipboardExpand all lines: common/CMakeLists.txt
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../.git")
1919
endif()
2020
endif()
2121

22-
set(GIT_INDEX "${GIT_DIR}/index")
22+
if(EXISTS "${GIT_DIR}/index")
23+
set(GIT_INDEX "${GIT_DIR}/index")
24+
else()
25+
message(WARNING "Git index not found in git repository.")
26+
set(GIT_INDEX "")
27+
endif()
2328
else()
2429
message(WARNING "Git repository not found; to enable automatic generation of build info, make sure Git is installed and the project is a Git repository.")
2530
set(GIT_INDEX "")

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.