Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDF5 only if building tests #2

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ if (NOT PYTHON_EXECUTABLE)
endif()
endif()

find_hdf5()
if (NOT HDF5_FOUND)
message(WARNING "hdf5 library not found, some tests will not be run")
else()
include_directories(${HDF5_INCLUDE_DIR})
if(BUILD_TESTS)
find_hdf5()
if (NOT HDF5_FOUND)
message(WARNING "hdf5 library not found, some tests will not be run")
else()
include_directories(${HDF5_INCLUDE_DIR})
endif()
endif()

if (USE_MPI OR HDF5_IS_PARALLEL)
Expand Down
5 changes: 2 additions & 3 deletions src/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ add_definitions(-D_FLANN_VERSION=${FLANN_VERSION})

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/flann/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/flann/config.h)

file(GLOB_RECURSE C_SOURCES flann.cpp)
file(GLOB_RECURSE C_SOURCES flann.cpp util/serialization.cpp)
file(GLOB_RECURSE CPP_SOURCES flann_cpp.cpp util/serialization.cpp)
file(GLOB_RECURSE CU_SOURCES *.cu)

Expand All @@ -24,10 +24,9 @@ endif()
add_library(flann_cpp SHARED ${CPP_SOURCES})
target_link_directories(flann_cpp PRIVATE ${LZ4_LIBRARY_DIRS})
target_link_libraries(flann_cpp PRIVATE ${LZ4_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)
list(APPEND 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\"")
Expand Down