1 cmake_minimum_required(VERSION 3.22.1) 2 project(backends) 3 4 add_custom_target(copy_libs) 5 6 if ("${SHARED_BACKEND}EMPTY" STREQUAL "EMPTY") 7 set (SHARED_BACKEND "${CMAKE_SOURCE_DIR}/shared") 8 message("SHARED_BACKEND=${SHARED_BACKEND}") 9 endif() 10 11 set(CMAKE_CXX_STANDARD 14) 12 13 include_directories( 14 ${SHARED_BACKEND}/include 15 ) 16 17 if ("${OPENCL_BACKEND}EMPTY" STREQUAL "EMPTY") 18 set (OPENCL_BACKEND "${CMAKE_SOURCE_DIR}/opencl") 19 message("OPENCL_BACKEND=${OPENCL_BACKEND}") 20 endif() 21 add_subdirectory(opencl) 22 23 if ("${CUDA_BACKEND}EMPTY" STREQUAL "EMPTY") 24 set (CUDA_BACKEND "${CMAKE_SOURCE_DIR}/cuda") 25 message("CUDA_BACKEND=${CUDA_BACKEND}") 26 endif() 27 add_subdirectory(cuda) 28 29 if ("${SPIRV_BACKEND}EMPTY" STREQUAL "EMPTY") 30 set (SPIRV_BACKEND "${CMAKE_SOURCE_DIR}/spirv") 31 message("SPIRV_BACKEND=${SPIRV_BACKEND}") 32 endif() 33 add_subdirectory(spirv) 34 35 if ("${PTX_BACKEND}EMPTY" STREQUAL "EMPTY") 36 set (PTX_BACKEND "${CMAKE_SOURCE_DIR}/ptx") 37 message("PTX_BACKEND=${PTX_BACKEND}") 38 endif() 39 add_subdirectory(ptx) 40 41 if ("${MOCK_BACKEND}EMPTY" STREQUAL "EMPTY") 42 set (MOCK_BACKEND "${CMAKE_SOURCE_DIR}/mock") 43 message("MOCK_BACKEND=${MOCK_BACKEND}") 44 endif() 45 add_subdirectory(mock) 46 47 add_executable(schemadump 48 ${SHARED_BACKEND}/cpp/schema.cpp 49 ${SHARED_BACKEND}/cpp/schemadump.cpp 50 ) 51