-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/AnswerDotAI/gpu.cpp
- Loading branch information
Showing
6 changed files
with
167 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# file name to find | ||
set(FILENAME "gpu.h") | ||
|
||
# Function to check for file existence up the directory hierarchy | ||
function(find_project_root current_dir filename result_var) | ||
set(found FALSE) # Flag to indicate if the file is found | ||
set(current_check_dir "${current_dir}") # Start from the given directory | ||
# using 1 is jsut to supress the cmane-format warning | ||
foreach(i RANGE 0 2 1) | ||
set(filepath "${current_check_dir}/${filename}") | ||
|
||
if(EXISTS "${filepath}") | ||
set(${result_var} | ||
"${current_check_dir}" | ||
PARENT_SCOPE) | ||
set(found TRUE) | ||
break() | ||
endif() | ||
|
||
# Move one level up | ||
get_filename_component(current_check_dir "${current_check_dir}" | ||
DIRECTORY) | ||
endforeach() | ||
|
||
if(NOT found) | ||
set(${result_var} | ||
"" | ||
PARENT_SCOPE) # Set to empty if not found | ||
endif() | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters