summaryrefslogtreecommitdiffstats
path: root/config/cmake/hdf5-config.cmake.in
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2015-08-05 21:01:07 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2015-08-05 21:01:07 (GMT)
commit9e2434625dde11a19b46a5154477247266792219 (patch)
tree7e7b94935a7acdf8024ec464218c564dccf52963 /config/cmake/hdf5-config.cmake.in
parent0b4b73331d2cd4d6d3433e8bc5c45011f75d6fd3 (diff)
downloadhdf5-9e2434625dde11a19b46a5154477247266792219.zip
hdf5-9e2434625dde11a19b46a5154477247266792219.tar.gz
hdf5-9e2434625dde11a19b46a5154477247266792219.tar.bz2
[svn-r27469] Merge from trunk with dual-binary CMake code.
Tested: local linux with CMake
Diffstat (limited to 'config/cmake/hdf5-config.cmake.in')
-rw-r--r--config/cmake/hdf5-config.cmake.in51
1 files changed, 30 insertions, 21 deletions
diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in
index dec59da..adeec55 100644
--- a/config/cmake/hdf5-config.cmake.in
+++ b/config/cmake/hdf5-config.cmake.in
@@ -6,6 +6,8 @@
string(TOUPPER @HDF5_PACKAGE@ HDF5_PACKAGE_NAME)
set (${HDF5_PACKAGE_NAME}_VALID_COMPONENTS
+ static
+ shared
C
CXX
Fortran
@@ -67,12 +69,6 @@ if (${HDF5_PACKAGE_NAME}_BUILD_TOOLS)
set_and_check (${HDF5_PACKAGE_NAME}_TOOLS_DIR "@PACKAGE_CURRENT_BUILD_DIR@/bin")
endif ()
-if (HDF5_BUILD_SHARED_LIBS)
- set (H5_BUILT_AS_DYNAMIC_LIB 1)
-else ()
- set (H5_BUILT_AS_STATIC_LIB 1)
-endif ()
-
#-----------------------------------------------------------------------------
# Version Strings
#-----------------------------------------------------------------------------
@@ -94,14 +90,25 @@ if (NOT TARGET "@HDF5_PACKAGE@")
include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
endif ()
-# Handle default component :
+# Handle default component(static) :
if (NOT ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS)
- set (${HDF5_PACKAGE_NAME}_FIND_COMPONENTS C HL)
- set (${HDF5_PACKAGE_NAME}_FIND_REQUIRED_C true)
+ set (${HDF5_PACKAGE_NAME}_LIB_TYPE)
+ set (${HDF5_PACKAGE_NAME}_FIND_COMPONENTS C HL static)
+ set (${HDF5_PACKAGE_NAME}_FIND_REQUIRED_static_C true)
endif ()
# Handle requested components:
list (REMOVE_DUPLICATES ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS)
+foreach (comp IN LISTS ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS)
+ if (${comp} STREQUAL "shared")
+ list (REMOVE_ITEM ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS ${comp})
+ set (${HDF5_PACKAGE_NAME}_LIB_TYPE ${${HDF5_PACKAGE_NAME}_LIB_TYPE} ${comp})
+ elseif (${comp} STREQUAL "static")
+ list (REMOVE_ITEM ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS ${comp})
+ set (${HDF5_PACKAGE_NAME}_LIB_TYPE ${${HDF5_PACKAGE_NAME}_LIB_TYPE} ${comp})
+ endif ()
+endforeach ()
+foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE)
foreach (comp IN LISTS ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS)
set (hdf5_comp2)
if (${comp} STREQUAL "C")
@@ -121,26 +128,28 @@ list (REMOVE_DUPLICATES ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS)
set (hdf5_comp2 "hdf5_hl_f90cstub")
set (hdf5_comp "hdf5_hl_fortran")
endif ()
- list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}" HAVE_COMP)
+ list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}-${libtype}" HAVE_COMP)
if (${HAVE_COMP} LESS 0)
- set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 0)
+ set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 0)
else ()
if (hdf5_comp2)
- list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp2}" HAVE_COMP2)
+ list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp2}-${libtype}" HAVE_COMP2)
if (${HAVE_COMP2} LESS 0)
- set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 0)
+ set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 0)
else ()
- set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 1)
- string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_LIBRARY COMP_LIBRARY)
- set (${HDF5_PACKAGE_NAME}_LIBRARIES ${${HDF5_PACKAGE_NAME}_LIBRARIES} ${hdf5_comp2} ${hdf5_comp})
+ set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 1)
+ string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY)
+ set (${COMP_LIBRARY} ${${COMP_LIBRARY}} ${hdf5_comp2}-${libtype} ${hdf5_comp}-${libtype})
endif ()
else ()
- set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 1)
- string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_LIBRARY COMP_LIBRARY)
- set (${HDF5_PACKAGE_NAME}_LIBRARIES ${${HDF5_PACKAGE_NAME}_LIBRARIES} ${hdf5_comp})
+ set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 1)
+ string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY)
+ set (${COMP_LIBRARY} ${${COMP_LIBRARY}} ${hdf5_comp}-${libtype})
endif ()
endif ()
endforeach ()
+endforeach ()
- check_required_components(${HDF5_PACKAGE_NAME}_FIND_COMPONENTS)
-
+foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE)
+ check_required_components(${HDF5_PACKAGE_NAME}_${libtype})
+endforeach ()