Skip to content

Commit

Permalink
Sets OCCA_<MODE>_ENABLED in CMake parent scope.
Browse files Browse the repository at this point in the history
Intended for CMake builds which add occa as a subdirectory.
  • Loading branch information
kris-rowe committed Nov 28, 2023
1 parent f92bf81 commit c5b8b77
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.17 FATAL_ERROR)
cmake_minimum_required (VERSION 3.21 FATAL_ERROR)

#---[ CMake Config ]--------------------
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
Expand Down Expand Up @@ -244,6 +244,16 @@ if(ENABLE_METAL AND APPLE)
endif()
endif()
#=======================================

if(NOT OCCA_IS_TOP_LEVEL)
# OCCA is being built as a subdirectory in another project
set(OCCA_OPENMP_ENABLED ${OCCA_OPENMP_ENABLED} PARENT_SCOPE)
set(OCCA_CUDA_ENABLED ${OCCA_CUDA_ENABLED} PARENT_SCOPE)
set(OCCA_HIP_ENABLED ${OCCA_HIP_ENABLED} PARENT_SCOPE)
set(OCCA_DPCPP_ENABLED ${OCCA_DPCPP_ENABLED} PARENT_SCOPE)
set(OCCA_OPENCL_ENABLED ${OCCA_OPENCL_ENABLED} PARENT_SCOPE)
set(OCCA_METAL_ENABLED ${OCCA_METAL_ENABLED} PARENT_SCOPE)
endif()

# Generate CompiledDefines from libraries we found
configure_file(
Expand Down

0 comments on commit c5b8b77

Please sign in to comment.