From b2ec161782e4c0a01da923183f0278a276efafcc Mon Sep 17 00:00:00 2001 From: Incardona Pietro <incardon@mpi-cbg.de> Date: Fri, 2 Apr 2021 18:08:10 +0200 Subject: [PATCH] Fixing OpenFPMConfig.cmake --- openfpm_devices | 2 +- openfpm_vcluster | 2 +- src/CMakeLists.txt | 40 +++++++++++++++++++--------------------- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/openfpm_devices b/openfpm_devices index 9ea5dfcc2..ff844fabd 160000 --- a/openfpm_devices +++ b/openfpm_devices @@ -1 +1 @@ -Subproject commit 9ea5dfcc2522b48aff0c6560c5803058f0a74d67 +Subproject commit ff844fabdec40f19b3649c0e346a22ebf5676cf6 diff --git a/openfpm_vcluster b/openfpm_vcluster index 35af0cc8d..a46c5b472 160000 --- a/openfpm_vcluster +++ b/openfpm_vcluster @@ -1 +1 @@ -Subproject commit 35af0cc8d91e293a3136192cf0806ef9c03f6cac +Subproject commit a46c5b472123b848df4ee1345b188092d8b06108 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 27d754d86..66e5b0195 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -93,9 +93,6 @@ if (CUDA_FOUND) if (TEST_COVERAGE) target_compile_options(pdata PRIVATE $<$<COMPILE_LANGUAGE:CUDA>: -Xcompiler "-fprofile-arcs -ftest-coverage" >) endif() - if (CMAKE_BUILD_TYPE STREQUAL "Debug") - # target_compile_options(pdata PRIVATE $<$<COMPILE_LANGUAGE:CUDA>: -G>) - endif() endif() if(TEST_PERFORMANCE) @@ -305,17 +302,18 @@ install(FILES Debug/debug.hpp DESTINATION openfpm_pdata/include/Debug COMPONENT OpenFPM) -install(TARGETS ofpm_pdata DESTINATION openfpm_pdata/lib COMPONENT OpenFPM) +install(TARGETS ofpm_pdata EXPORT ofpm_pdata_config DESTINATION openfpm_pdata/lib COMPONENT OpenFPM) ########## Create openfpmConfig.cmake + openfpmConfigVersion.cmake -add_library(openfpm_config_bin INTERFACE) +add_library(binary_config INTERFACE) target_include_directories( - openfpm_config_bin + binary_config INTERFACE ${CMAKE_INSTALL_PREFIX}/openfpm_pdata/include ${CMAKE_INSTALL_PREFIX}/openfpm_data/include + ${CMAKE_INSTALL_PREFIX}/openfpm_pdata/include/config ${CMAKE_INSTALL_PREFIX}/openfpm_io/include ${CMAKE_INSTALL_PREFIX}/openfpm_vcluster/include ${CMAKE_INSTALL_PREFIX}/openfpm_devices/include @@ -330,18 +328,22 @@ target_include_directories( ${Boost_INCLUDE_DIRS} ) -target_link_libraries(openfpm_config_bin INTERFACE ${Boost_LIBRARIES}) -target_link_libraries(openfpm_config_bin INTERFACE ${PARMETIS_LIBRARIES}) -target_link_libraries(openfpm_config_bin INTERFACE -L${METIS_ROOT}/lib metis) -target_link_libraries(openfpm_config_bin INTERFACE ${HDF5_LIBRARIES}) -target_link_libraries(openfpm_config_bin INTERFACE -L${LIBHILBERT_LIBRARY_DIRS} ${LIBHILBERT_LIBRARIES}) -target_link_libraries(openfpm_config_bin INTERFACE ${PETSC_LIBRARIES}) -target_link_libraries(openfpm_config_bin INTERFACE ${Vc_LIBRARIES}) -target_link_libraries(openfpm_config_bin INTERFACE ${alpaka_LIBRARIES}) -#target_link_libraries(openfpm_config_bin INTERFACE vcluster) -#target_link_libraries(openfpm_config_bin INTERFACE ofpmmemory) +if (CUDA_ON_CPU) + target_compile_definitions(binary_config INTERFACE CUDA_ON_CPU) +endif() + +target_link_libraries(binary_config INTERFACE ${Boost_LIBRARIES}) +target_link_libraries(binary_config INTERFACE ${PARMETIS_LIBRARIES}) +target_link_libraries(binary_config INTERFACE -L${METIS_ROOT}/lib metis) +target_link_libraries(binary_config INTERFACE ${HDF5_LIBRARIES}) +target_link_libraries(binary_config INTERFACE -L${LIBHILBERT_LIBRARY_DIRS} ${LIBHILBERT_LIBRARIES}) +target_link_libraries(binary_config INTERFACE ${PETSC_LIBRARIES}) +target_link_libraries(binary_config INTERFACE ${Vc_LIBRARIES}) +target_link_libraries(binary_config INTERFACE ${alpaka_LIBRARIES}) +target_link_libraries(binary_config INTERFACE $<INSTALL_PREFIX>/openfpm_vcluster/lib/$<TARGET_FILE_NAME:openfpm::vcluster> ) +target_link_libraries(binary_config INTERFACE $<INSTALL_PREFIX>/openfpm_devices/lib/$<TARGET_FILE_NAME:openfpm::ofpmmemory> ) -install(TARGETS openfpm_config_bin EXPORT openfpm_config CONFIGURATIONS) +install(TARGETS binary_config vcluster ofpmmemory EXPORT openfpm_config CONFIGURATIONS) include(CMakePackageConfigHelpers) write_basic_package_version_file( @@ -350,10 +352,6 @@ write_basic_package_version_file( COMPATIBILITY AnyNewerVersion ) -#export(EXPORT openfpm_config -# FILE "${CMAKE_CURRENT_BINARY_DIR}/openfpm_cmake/openfpmConfig.cmake" -# NAMESPACE openfpm:: -#) install(EXPORT openfpm_config DESTINATION cmake/ -- GitLab