cmake: make sure all DKS related libaries and include paths are properly set.

This commit is contained in:
2018-06-04 11:16:45 +02:00
parent b2c8b9b72b
commit 58148581ba
2 changed files with 32 additions and 12 deletions

View File

@ -109,11 +109,17 @@ set_target_properties(PUserFcnBase
target_include_directories(
PUserFcnBase BEFORE PRIVATE $<BUILD_INTERFACE:${MUSRFIT_INC}>
)
#--- add OpenMP compile options if needed -------------------------------------
if (OpenMP_FOUND)
target_compile_options(PMusr PUBLIC ${OpenMP_CXX_FLAGS})
endif (OpenMP_FOUND)
#--- add DKS compiler flags if enabled ----------------------------------------
if (DKS_FOUND)
target_compile_options(PMusr PUBLIC ${DKS_CFLAGS})
endif (DKS_FOUND)
#--- add library dependencies -------------------------------------------------
set(DependOnLibs ${ROOT_LIBARIES})
set(DependOnLibs ${DependOnLibs} ${FFTW3_LIBRARY})
@ -134,13 +140,7 @@ if (OpenMP_FOUND)
endif (OpenMP_CXX_LIBRARIES)
endif (OpenMP_FOUND)
if (DKS_FOUND)
if (CUDA_FOUND)
set(DependOnLibs ${DependOnLibs} ${CUDA_LIBRARIES} ${CUDA_CUBLAS_LIBRARIES})
endif (CUDA_FOUND)
if (NOT CUDA_FOUND AND OpenCL_FOUND)
set(DependOnLibs ${DependOnLibs} ${OpenCL_LIBRARIES})
endif (NOT CUDA_FOUND AND OpenCL_FOUND)
set(DependOnLibs ${DependOnLibs} ${DKS_LIBRARY})
set(DependOnLibs ${DependOnLibs} ${DKS_LIBS})
endif (DKS_FOUND)
target_link_libraries(PUserFcnBase ${ROOT_LIBRARIES})