Added initial example for automated CI
Signed-off-by: Alejandro Saucedo <axsauze@gmail.com>
This commit is contained in:
parent
637bfb1bc0
commit
8a3d2277b7
3 changed files with 64 additions and 20 deletions
|
|
@ -3,6 +3,10 @@ project(kompute_array_mult)
|
|||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
|
||||
# Options
|
||||
option(KOMPUTE_OPT_GIT_TAG "The tag of the repo to use for the example" 1344ece4ac278f9b3be3b4555ffaace7a032b91f)
|
||||
option(KOMPUTE_OPT_FROM_SOURCE "Whether to build example from source or from git fetch repo" 0)
|
||||
|
||||
# Set a default build type if none was specified
|
||||
# Based on: https://github.com/openchemistry/tomviz/blob/master/cmake/BuildType.cmake
|
||||
set(DEFAULT_BUILD_TYPE "Release")
|
||||
|
|
@ -24,11 +28,15 @@ if(WIN32) # Install dlls in the same directory as the executable on Windows
|
|||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(kompute GIT_REPOSITORY https://github.com/KomputeProject/kompute.git
|
||||
GIT_TAG 1344ece4ac278f9b3be3b4555ffaace7a032b91f) # The commit hash for a dev version before v0.9.0. Replace with the latest from: https://github.com/KomputeProject/kompute/releases
|
||||
FetchContent_MakeAvailable(kompute)
|
||||
include_directories(${kompute_SOURCE_DIR}/src/include)
|
||||
if(KOMPUTE_OPT_FROM_SOURCE)
|
||||
add_subdirectory(../../ ${CMAKE_CURRENT_BINARY_DIR}/kompute_build)
|
||||
else()
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(kompute GIT_REPOSITORY https://github.com/KomputeProject/kompute.git
|
||||
GIT_TAG ${KOMPUTE_OPT_GIT_TAG})
|
||||
FetchContent_MakeAvailable(kompute)
|
||||
include_directories(${kompute_SOURCE_DIR}/src/include)
|
||||
endif()
|
||||
|
||||
# Add to the list, so CMake can later find the code to compile shaders to header files
|
||||
list(APPEND CMAKE_PREFIX_PATH "${kompute_SOURCE_DIR}/cmake")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue