Skip to content
Snippets Groups Projects
CMakeLists.txt 905 B
Newer Older
数学の武士's avatar
.
数学の武士 committed
cmake_minimum_required(VERSION 3.19)

option(INCLUDE_CUDA "GPU build in mode" OFF)

project(memory-holder-test)

enable_language(CXX)
set(CMAKE_CXX_STANDARD 11)

if(INCLUDE_CUDA)
    if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
    message(FATAL_ERROR "
                    CMake will not pass any architecture flags to the compiler 
                    because the CUDA architecture is not set. You should specify 
                    an architecture: set -DCMAKE_CUDA_ARCHITECTURES=<N>.")
    endif(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)

    enable_language(CUDA)
    include_directories(${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
    add_definitions(-DINCLUDE_CUDA)
endif(INCLUDE_CUDA)

add_subdirectory(Lib)

set(SOURCES
    main.cpp
)

add_executable(test ${SOURCES})
target_include_directories(test PUBLIC ${memory_processing_SOURCE_DIR}/include ./Lib/)
target_link_libraries(test memproc memory-holder)