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