summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Compiler/TI-C.cmake2
-rw-r--r--Modules/FindHDF5.cmake15
2 files changed, 12 insertions, 5 deletions
diff --git a/Modules/Compiler/TI-C.cmake b/Modules/Compiler/TI-C.cmake
index 479666c..ebc79f4 100644
--- a/Modules/Compiler/TI-C.cmake
+++ b/Modules/Compiler/TI-C.cmake
@@ -7,4 +7,4 @@ set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> --preproc_only --c_fi
set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> --compile_only --c_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<OBJECT>")
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -r <TARGET> <OBJECTS>")
-set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> --run_linker --output_file=<TARGET> --map_file=<TARGET>.map <CMAKE_C_LINK_FLAGS> <LINK_LIBRARIES> <LINK_FLAGS> <OBJECTS>")
+set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> --run_linker --output_file=<TARGET> --map_file=<TARGET>.map <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index f589977..bc0d50b 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -345,7 +345,7 @@ macro( _HDF5_parse_compile_line
endmacro()
# Try to find HDF5 using an installed hdf5-config.cmake
-if(NOT HDF5_ROOT AND NOT HDF5_FOUND)
+if(NOT HDF5_FOUND AND NOT HDF5_ROOT)
find_package(HDF5 QUIET NO_MODULE)
if( HDF5_FOUND)
set(HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIR})
@@ -382,7 +382,7 @@ if(NOT HDF5_ROOT AND NOT HDF5_FOUND)
endif()
endif()
-if(NOT HDF5_ROOT AND NOT HDF5_FOUND)
+if(NOT HDF5_FOUND AND NOT HDF5_ROOT)
set(_HDF5_NEED_TO_SEARCH False)
set(HDF5_COMPILER_NO_INTERROGATE True)
# Only search for languages we've enabled
@@ -488,12 +488,12 @@ else()
set(_HDF5_NEED_TO_SEARCH True)
endif()
-if(HDF5_COMPILER_NO_INTERROGATE)
+if(NOT HDF5_FOUND AND HDF5_COMPILER_NO_INTERROGATE)
# No arguments necessary, all languages can use the compiler wrappers
set(HDF5_FOUND True)
set(HDF5_METHOD "Included by compiler wrappers")
set(HDF5_REQUIRED_VARS HDF5_METHOD)
-elseif(NOT _HDF5_NEED_TO_SEARCH)
+elseif(NOT HDF5_FOUND AND NOT _HDF5_NEED_TO_SEARCH)
# Compiler wrappers aren't being used by the build but were found and used
# to determine necessary include and library flags
set(HDF5_INCLUDE_DIRS)
@@ -680,6 +680,13 @@ if( NOT HDF5_FOUND )
endif()
endif()
+# If HDF5_REQUIRED_VARS is empty at this point, then it's likely that
+# something external is trying to explicitly pass already found
+# locations
+if(NOT HDF5_REQUIRED_VARS)
+ set(HDF5_REQUIRED_VARS HDF5_LIBRARIES HDF5_INCLUDE_DIRS)
+endif()
+
find_package_handle_standard_args(HDF5
REQUIRED_VARS ${HDF5_REQUIRED_VARS}
VERSION_VAR HDF5_VERSION