diff --git a/hdi/dimensionality_reduction/CMakeLists.txt b/hdi/dimensionality_reduction/CMakeLists.txt index 452e7e7..d410ba0 100644 --- a/hdi/dimensionality_reduction/CMakeLists.txt +++ b/hdi/dimensionality_reduction/CMakeLists.txt @@ -26,11 +26,15 @@ if(DEFINED ENV{CI}) target_include_directories(${PROJECT} PRIVATE ${flann_INCLUDE_DIR} ${lz4_INCLUDE_DIR}) else() message (STATUS "Flann path: " ${flann_DIR}) - if(WIN32) - target_link_libraries(${PROJECT} PRIVATE flann::flann_cpp_s) - else() - target_link_libraries(${PROJECT} PRIVATE flann::flann) + + if(TARGET flann::flann_cpp_s) + set(FLANN_TARGET flann::flann_cpp_s) + elseif(TARGET flann::flann) + set(FLANN_TARGET flann::flann) endif() + + message (STATUS "Flann link library: " ${FLANN_TARGET}) + target_link_libraries(${PROJECT} PRIVATE ${FLANN_TARGET}) endif() if(OpenMP_CXX_FOUND)