diff --git a/CMakeModules/boost_package.cmake b/CMakeModules/boost_package.cmake index 361b9d58a8..cf63452286 100644 --- a/CMakeModules/boost_package.cmake +++ b/CMakeModules/boost_package.cmake @@ -48,6 +48,13 @@ if(NOT INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIR};${source_dir}/include" INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIR};${source_dir}/include" ) +else() + if(NOT TARGET Boost::boost) + add_library(Boost::boost IMPORTED INTERFACE GLOBAL) + set_target_properties(Boost::boost PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIR}" + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIR}") + endif() endif() if(TARGET Boost::boost) diff --git a/src/backend/cuda/CMakeLists.txt b/src/backend/cuda/CMakeLists.txt index f6e81063a5..53ce4cf2d1 100644 --- a/src/backend/cuda/CMakeLists.txt +++ b/src/backend/cuda/CMakeLists.txt @@ -184,6 +184,16 @@ endfunction() arrayfire_get_cuda_cxx_flags(cuda_cxx_flags) arrayfire_get_platform_definitions(platform_flags) + +get_property(boost_includes TARGET Boost::boost PROPERTY INTERFACE_INCLUDE_DIRECTORIES) +get_property(boost_definitions TARGET Boost::boost PROPERTY INTERFACE_COMPILE_DEFINITIONS) + +string(REPLACE ";" ";-I" boost_includes "-I${boost_includes}") +string(REPLACE ";" ";-D" boost_definitions "-D${boost_definitions}") + +set(cuda_cxx_flags "${cuda_cxx_flags};${boost_includes}") +set(cuda_cxx_flags "${cuda_cxx_flags};${boost_definitions}") + # This definition is required in addition to the definition below because in # an older verion of cmake definitions added using target_compile_definitions # were not added to the nvcc flags. This manually adds these definitions and diff --git a/src/backend/cuda/kernel/scan_by_key/CMakeLists.txt b/src/backend/cuda/kernel/scan_by_key/CMakeLists.txt index e110bd8152..55ba972de0 100644 --- a/src/backend/cuda/kernel/scan_by_key/CMakeLists.txt +++ b/src/backend/cuda/kernel/scan_by_key/CMakeLists.txt @@ -31,8 +31,6 @@ foreach(SBK_BINARY_OP ${SBK_BINARY_OPS}) "${CMAKE_CURRENT_SOURCE_DIR}/kernel/scan_dim_by_key_impl.hpp" "${CMAKE_CURRENT_SOURCE_DIR}/kernel/scan_first_by_key_impl.hpp" OPTIONS - -I$, -I> - -D$, -D> -DSBK_BINARY_OP=${SBK_BINARY_OP} "${platform_flags} ${cuda_cxx_flags} -DAFDLL" ) diff --git a/src/backend/cuda/kernel/thrust_sort_by_key/CMakeLists.txt b/src/backend/cuda/kernel/thrust_sort_by_key/CMakeLists.txt index 654141948f..3a6f660098 100644 --- a/src/backend/cuda/kernel/thrust_sort_by_key/CMakeLists.txt +++ b/src/backend/cuda/kernel/thrust_sort_by_key/CMakeLists.txt @@ -9,11 +9,11 @@ file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/kernel/thrust_sort_by_key/thrust_sort_ foreach(STR ${FILESTRINGS}) if(${STR} MATCHES "// SBK_TYPES") - STRING(REPLACE "// SBK_TYPES:" "" TEMP ${STR}) - STRING(REPLACE " " ";" SBK_TYPES ${TEMP}) + string(REPLACE "// SBK_TYPES:" "" TEMP ${STR}) + string(REPLACE " " ";" SBK_TYPES ${TEMP}) elseif(${STR} MATCHES "// SBK_INSTS:") - STRING(REPLACE "// SBK_INSTS:" "" TEMP ${STR}) - STRING(REPLACE " " ";" SBK_INSTS ${TEMP}) + string(REPLACE "// SBK_INSTS:" "" TEMP ${STR}) + string(REPLACE " " ";" SBK_INSTS ${TEMP}) endif() endforeach() @@ -34,8 +34,6 @@ foreach(SBK_TYPE ${SBK_TYPES}) ${CMAKE_CURRENT_BINARY_DIR}/kernel/thrust_sort_by_key/thrust_sort_by_key_impl_${SBK_TYPE}_${SBK_INST}.cu ${CMAKE_CURRENT_SOURCE_DIR}/kernel/thrust_sort_by_key_impl.hpp OPTIONS - -I$, -I> - -D$, -D> -DSBK_TYPE=${SBK_TYPE} -DINSTANTIATESBK_INST=INSTANTIATE${SBK_INST} "${platform_flags} ${cuda_cxx_flags} -DAFDLL"