diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt index c09400df..39186714 100644 --- a/c/CMakeLists.txt +++ b/c/CMakeLists.txt @@ -22,9 +22,9 @@ set_target_properties(parallelproj_c PROPERTIES PUBLIC_HEADER "include/parallelp find_library(MATH_LIBRARY m) if(MATH_LIBRARY) message(STATUS "linking against libm") - target_link_libraries(parallelproj_c PUBLIC ${MATH_LIBRARY} OpenMP::OpenMP_C) + target_link_libraries(parallelproj_c PRIVATE ${MATH_LIBRARY} OpenMP::OpenMP_C) else() - target_link_libraries(parallelproj_c PUBLIC OpenMP::OpenMP_C) + target_link_libraries(parallelproj_c PRIVATE OpenMP::OpenMP_C) endif() install(TARGETS parallelproj_c EXPORT parallelprojTargets @@ -39,4 +39,5 @@ if(PARALLELPROJ_BUILD_WITH_IDL_WRAPPERS) endif() # add the test executables -add_subdirectory(tests) \ No newline at end of file +add_subdirectory(tests) + diff --git a/cuda/CMakeLists.txt b/cuda/CMakeLists.txt index ddde1137..a19f1c0f 100644 --- a/cuda/CMakeLists.txt +++ b/cuda/CMakeLists.txt @@ -58,7 +58,7 @@ target_include_directories(parallelproj_cuda PUBLIC ) # we have to add the openmp library to be linked -target_link_libraries(parallelproj_cuda PUBLIC OpenMP::OpenMP_CXX) +target_link_libraries(parallelproj_cuda PRIVATE OpenMP::OpenMP_CXX) install(TARGETS parallelproj_cuda EXPORT parallelprojTargets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} @@ -76,3 +76,4 @@ endif() # add test executables add_subdirectory(tests) +