Skip to content

Commit

Permalink
CMake: OS independent flann linking
Browse files Browse the repository at this point in the history
  • Loading branch information
alxvth committed Aug 28, 2024
1 parent 31ed8ce commit e3cfd89
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions hdi/dimensionality_reduction/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e3cfd89

Please sign in to comment.