diff options
author | Kris Thielemans <kris.f.thielemans@hotmail.com> | 2017-07-03 00:40:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-07-07 12:58:57 (GMT) |
commit | 6848ff4ce54bedd5d0ef909f2bc08ab99dc0a513 (patch) | |
tree | b411063fe0e039757841cf584e7ac9e94b793a20 /Modules | |
parent | 6f131f49eee26dc5c342274f919e0ca1636182e5 (diff) | |
download | CMake-6848ff4ce54bedd5d0ef909f2bc08ab99dc0a513.zip CMake-6848ff4ce54bedd5d0ef909f2bc08ab99dc0a513.tar.gz CMake-6848ff4ce54bedd5d0ef909f2bc08ab99dc0a513.tar.bz2 |
FindHDF5: Define H5_BUILT_AS_DYNAMIC_LIB when using Windows DLLs
When searching for shared libraries on Windows, add
H5_BUILT_AS_DYNAMIC_LIB to HDF5_DEFINITIONS so that the header file
knows how to dllimport the symbols.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindHDF5.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index acf7cd4..48d5de4 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -733,6 +733,9 @@ if( NOT HDF5_FOUND ) else() set( THIS_LIBRARY_SEARCH_DEBUG ${LIB}d ${LIB}_D ${LIB}_debug ${LIB}d-shared ${LIB}_D-shared ${LIB}_debug-shared) set( THIS_LIBRARY_SEARCH_RELEASE ${LIB} ${LIB}-shared) + if(WIN32) + list(APPEND HDF5_DEFINITIONS "-DH5_BUILT_AS_DYNAMIC_LIB") + endif() endif() find_library(HDF5_${LIB}_LIBRARY_DEBUG NAMES ${THIS_LIBRARY_SEARCH_DEBUG} @@ -794,6 +797,7 @@ if( NOT HDF5_FOUND ) set(HDF5_HL_FOUND True) endif() + _HDF5_remove_duplicates_from_beginning(HDF5_DEFINITIONS) _HDF5_remove_duplicates_from_beginning(HDF5_INCLUDE_DIRS) _HDF5_remove_duplicates_from_beginning(HDF5_LIBRARIES) _HDF5_remove_duplicates_from_beginning(HDF5_HL_LIBRARIES) |