From 63a378bd93fb10f343e21062bad3f4c4cc63d72c Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 14 Sep 2015 20:36:51 +0700 Subject: [PATCH] Make sure -L flags from HDF5 wrapper are passed --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76c099d52..36501c918 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -262,6 +262,11 @@ else() target_compile_options(${program} PUBLIC ${f90flags}) endif() +# Add HDF5 library directories to link line with -L +foreach(LIBDIR ${HDF5_LIBRARY_DIRS}) + list(APPEND ldflags "-L${LIBDIR}") +endforeach() + # target_link_libraries treats any arguments starting with - but not -l as # linker flags. Thus, we can pass both linker flags and libraries together. target_link_libraries(${program} ${ldflags} ${HDF5_LIBRARIES} fox_dom)