Skip to content

Commit

Permalink
Enable subdirectories and use alpaka_ROOT (#1022)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-stephan authored and sbastrakov committed Jun 26, 2020
1 parent da4094b commit 79ca8bb
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 18 deletions.
12 changes: 9 additions & 3 deletions example/bufferCopy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ project(${_TARGET_NAME})
# Find alpaka.

if(NOT TARGET alpaka::alpaka)
set(ALPAKA_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../" CACHE STRING "The location of alpakaConfig.cmake")
list(APPEND CMAKE_MODULE_PATH "${ALPAKA_ROOT}")
find_package(alpaka REQUIRED)
option(USE_ALPAKA_SOURCE_TREE "Use alpaka's source tree instead of an alpaka installation" OFF)

if(USE_ALPAKA_SOURCE_TREE)
# Don't build the examples recursively
set(alpaka_BUILD_EXAMPLES OFF)
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../.." "${CMAKE_BINARY_DIR}/alpaka")
else()
find_package(alpaka REQUIRED)
endif()
endif()

#-------------------------------------------------------------------------------
Expand Down
12 changes: 9 additions & 3 deletions example/heatEquation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ project(${_TARGET_NAME})
# Find alpaka.

if(NOT TARGET alpaka::alpaka)
set(ALPAKA_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../" CACHE STRING "The location of the alpaka library")
list(APPEND CMAKE_MODULE_PATH "${ALPAKA_ROOT}")
find_package(alpaka REQUIRED)
option(USE_ALPAKA_SOURCE_TREE "Use alpaka's source tree instead of an alpaka installation" OFF)

if(USE_ALPAKA_SOURCE_TREE)
# Don't build the examples recursively
set(alpaka_BUILD_EXAMPLES OFF)
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../.." "${CMAKE_BINARY_DIR}/alpaka")
else()
find_package(alpaka REQUIRED)
endif()
endif()

#-------------------------------------------------------------------------------
Expand Down
12 changes: 9 additions & 3 deletions example/helloWorld/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ project(${_TARGET_NAME})
# Find alpaka.

if(NOT TARGET alpaka::alpaka)
set(ALPAKA_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../" CACHE STRING "The location of alpakaConfig.cmake")
list(APPEND CMAKE_MODULE_PATH "${ALPAKA_ROOT}")
find_package(alpaka REQUIRED)
option(USE_ALPAKA_SOURCE_TREE "Use alpaka's source tree instead of an alpaka installation" OFF)

if(USE_ALPAKA_SOURCE_TREE)
# Don't build the examples recursively
set(alpaka_BUILD_EXAMPLES OFF)
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../.." "${CMAKE_BINARY_DIR}/alpaka")
else()
find_package(alpaka REQUIRED)
endif()
endif()

#-------------------------------------------------------------------------------
Expand Down
12 changes: 9 additions & 3 deletions example/helloWorldLambda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ project(${_TARGET_NAME})
# Find alpaka.

if(NOT TARGET alpaka::alpaka)
set(ALPAKA_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../" CACHE STRING "The location of alpakaConfig.cmake")
list(APPEND CMAKE_MODULE_PATH "${ALPAKA_ROOT}")
find_package(alpaka REQUIRED)
option(USE_ALPAKA_SOURCE_TREE "Use alpaka's source tree instead of an alpaka installation" OFF)

if(USE_ALPAKA_SOURCE_TREE)
# Don't build the examples recursively
set(alpaka_BUILD_EXAMPLES OFF)
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../.." "${CMAKE_BINARY_DIR}/alpaka")
else()
find_package(alpaka REQUIRED)
endif()
endif()

#-------------------------------------------------------------------------------
Expand Down
12 changes: 9 additions & 3 deletions example/reduce/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ project(${_TARGET_NAME})
# Find alpaka.

if(NOT TARGET alpaka::alpaka)
set(ALPAKA_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../" CACHE STRING "The location of alpakaConfig.cmake")
list(APPEND CMAKE_MODULE_PATH "${ALPAKA_ROOT}")
find_package(alpaka REQUIRED)
option(USE_ALPAKA_SOURCE_TREE "Use alpaka's source tree instead of an alpaka installation" OFF)

if(USE_ALPAKA_SOURCE_TREE)
# Don't build the examples recursively
set(alpaka_BUILD_EXAMPLES OFF)
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../.." "${CMAKE_BINARY_DIR}/alpaka")
else()
find_package(alpaka REQUIRED)
endif()
endif()

#-------------------------------------------------------------------------------
Expand Down
12 changes: 9 additions & 3 deletions example/vectorAdd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ project(${_TARGET_NAME})
# Find alpaka.

if(NOT TARGET alpaka::alpaka)
set(ALPAKA_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../" CACHE STRING "The location of the alpaka library")
list(APPEND CMAKE_MODULE_PATH "${ALPAKA_ROOT}")
find_package(alpaka REQUIRED)
option(USE_ALPAKA_SOURCE_TREE "Use alpaka's source tree instead of an alpaka installation" OFF)

if(USE_ALPAKA_SOURCE_TREE)
# Don't build the examples recursively
set(alpaka_BUILD_EXAMPLES OFF)
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../.." "${CMAKE_BINARY_DIR}/alpaka")
else()
find_package(alpaka REQUIRED)
endif()
endif()

#-------------------------------------------------------------------------------
Expand Down

0 comments on commit 79ca8bb

Please sign in to comment.