flann-lib / flann

Fast Library for Approximate Nearest Neighbors
http://people.cs.ubc.ca/~mariusm/flann
Other
2.21k stars 646 forks source link

Overwrite install list #500

Open OgreTransporter opened 1 year ago

OgreTransporter commented 1 year ago

Line 27 https://github.com/flann-lib/flann/blob/f9caaf609d8b8cb2b7104a85cf59eb92c275a25d/src/cpp/CMakeLists.txt#L27 overwrites line 17 https://github.com/flann-lib/flann/blob/f9caaf609d8b8cb2b7104a85cf59eb92c275a25d/src/cpp/CMakeLists.txt#L17 so that flann_cpp_s is never installed.

Proposal:

diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt
index 7603abc..e0e519c 100644
--- a/src/cpp/CMakeLists.txt
+++ b/src/cpp/CMakeLists.txt
@@ -8,6 +8,13 @@ file(GLOB_RECURSE C_SOURCES flann.cpp)
 file(GLOB_RECURSE CPP_SOURCES flann_cpp.cpp)
 file(GLOB_RECURSE CU_SOURCES *.cu)

+add_library(flann_cpp SHARED ${CPP_SOURCES})
+target_link_libraries(flann_cpp ${LZ4_LINK_LIBRARIES})
+# export lz4 headers, so that MSVC to creates flann_cpp.lib
+set_target_properties(flann_cpp PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS YES)
+
+set(flann_install_targets flann_cpp)
+
 add_library(flann_cpp_s STATIC ${CPP_SOURCES})
 target_link_libraries(flann_cpp_s PUBLIC ${LZ4_LINK_LIBRARIES})
 if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
@@ -19,13 +26,6 @@ else()
     set_target_properties(flann_cpp_s PROPERTIES EXCLUDE_FROM_ALL true)
 endif()

-add_library(flann_cpp SHARED ${CPP_SOURCES})
-target_link_libraries(flann_cpp ${LZ4_LINK_LIBRARIES})
-# export lz4 headers, so that MSVC to creates flann_cpp.lib
-set_target_properties(flann_cpp PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS YES)
-
-set(flann_install_targets flann_cpp)
-
 if (BUILD_CUDA_LIB)
     SET(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-DFLANN_USE_CUDA;-Xcudafe \"--diag_suppress=partial_override\" ;-gencode=arch=compute_52,code=\"sm_52,compute_52\";-gencode=arch=compute_61,code=\"sm_61,compute_61\"")
     if(CMAKE_COMPILER_IS_GNUCC)