diff options
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 225 |
1 files changed, 119 insertions, 106 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7257a41..f79ae6c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,15 +1,15 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_SRC C CXX) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # List Source Files #----------------------------------------------------------------------------- -SET (H5_SRCS +set (H5_SRCS ${HDF5_SRC_DIR}/H5.c ${HDF5_SRC_DIR}/H5checksum.c ${HDF5_SRC_DIR}/H5dbg.c @@ -18,7 +18,7 @@ SET (H5_SRCS ${HDF5_SRC_DIR}/H5trace.c ) -SET (H5_HDRS +set (H5_HDRS ${HDF5_SRC_DIR}/hdf5.h ${HDF5_SRC_DIR}/H5api_adpt.h ${HDF5_SRC_DIR}/H5public.h @@ -27,7 +27,7 @@ SET (H5_HDRS ) IDE_GENERATED_PROPERTIES ("H5" "${H5_HDRS}" "${H5_SRCS}" ) -SET (H5A_SRCS +set (H5A_SRCS ${HDF5_SRC_DIR}/H5A.c ${HDF5_SRC_DIR}/H5Abtree2.c ${HDF5_SRC_DIR}/H5Adense.c @@ -36,23 +36,23 @@ SET (H5A_SRCS ${HDF5_SRC_DIR}/H5Atest.c ) -SET (H5A_HDRS +set (H5A_HDRS ${HDF5_SRC_DIR}/H5Apkg.h ${HDF5_SRC_DIR}/H5Apublic.h ) IDE_GENERATED_PROPERTIES ("H5A" "${H5A_HDRS}" "${H5A_SRCS}" ) -SET (H5AC_SRCS +set (H5AC_SRCS ${HDF5_SRC_DIR}/H5AC.c ) -SET (H5AC_HDRS +set (H5AC_HDRS ${HDF5_SRC_DIR}/H5ACpkg.h ${HDF5_SRC_DIR}/H5ACpublic.h ) IDE_GENERATED_PROPERTIES ("H5AC" "${H5AC_HDRS}" "${H5AC_SRCS}" ) -SET (H5B_SRCS +set (H5B_SRCS ${HDF5_SRC_DIR}/H5B.c ${HDF5_SRC_DIR}/H5B2.c ${HDF5_SRC_DIR}/H5B2cache.c @@ -65,7 +65,7 @@ SET (H5B_SRCS ${HDF5_SRC_DIR}/H5Bdbg.c ) -SET (H5B_HDRS +set (H5B_HDRS ${HDF5_SRC_DIR}/H5B2pkg.h ${HDF5_SRC_DIR}/H5B2public.h ${HDF5_SRC_DIR}/H5Bpkg.h @@ -73,7 +73,7 @@ SET (H5B_HDRS ) IDE_GENERATED_PROPERTIES ("H5B" "${H5B_HDRS}" "${H5B_SRCS}" ) -SET (H5D_SRCS +set (H5D_SRCS ${HDF5_SRC_DIR}/H5D.c ${HDF5_SRC_DIR}/H5Dcompact.c ${HDF5_SRC_DIR}/H5Dbtree.c @@ -93,19 +93,19 @@ SET (H5D_SRCS ${HDF5_SRC_DIR}/H5Dtest.c ) -SET (H5D_HDRS +set (H5D_HDRS ${HDF5_SRC_DIR}/H5Dpkg.h ${HDF5_SRC_DIR}/H5Dpublic.h ) IDE_GENERATED_PROPERTIES ("H5D" "${H5D_HDRS}" "${H5D_SRCS}" ) -SET (H5E_SRCS +set (H5E_SRCS ${HDF5_SRC_DIR}/H5E.c ${HDF5_SRC_DIR}/H5Edeprec.c ${HDF5_SRC_DIR}/H5Eint.c ) -SET (H5E_HDRS +set (H5E_HDRS ${HDF5_SRC_DIR}/H5Edefin.h ${HDF5_SRC_DIR}/H5Einit.h ${HDF5_SRC_DIR}/H5Epkg.h @@ -115,7 +115,7 @@ SET (H5E_HDRS ) IDE_GENERATED_PROPERTIES ("H5E" "${H5E_HDRS}" "${H5E_SRCS}" ) -SET (H5F_SRCS +set (H5F_SRCS ${HDF5_SRC_DIR}/H5F.c ${HDF5_SRC_DIR}/H5Faccum.c ${HDF5_SRC_DIR}/H5Fcwfs.c @@ -132,13 +132,13 @@ SET (H5F_SRCS ${HDF5_SRC_DIR}/H5Ftest.c ) -SET (H5F_HDRS +set (H5F_HDRS ${HDF5_SRC_DIR}/H5Fpkg.h ${HDF5_SRC_DIR}/H5Fpublic.h ) IDE_GENERATED_PROPERTIES ("H5F" "${H5F_HDRS}" "${H5F_SRCS}" ) -SET (H5FD_SRCS +set (H5FD_SRCS ${HDF5_SRC_DIR}/H5FD.c ${HDF5_SRC_DIR}/H5FDcore.c ${HDF5_SRC_DIR}/H5FDdirect.c @@ -153,7 +153,7 @@ SET (H5FD_SRCS ${HDF5_SRC_DIR}/H5FDstdio.c ) -SET (H5FD_HDRS +set (H5FD_HDRS ${HDF5_SRC_DIR}/H5FDcore.h ${HDF5_SRC_DIR}/H5FDdirect.h ${HDF5_SRC_DIR}/H5FDfamily.h @@ -168,7 +168,7 @@ SET (H5FD_HDRS ) IDE_GENERATED_PROPERTIES ("H5FD" "${H5FD_HDRS}" "${H5FD_SRCS}" ) -SET (H5FS_SRCS +set (H5FS_SRCS ${HDF5_SRC_DIR}/H5FS.c ${HDF5_SRC_DIR}/H5FScache.c ${HDF5_SRC_DIR}/H5FSdbg.c @@ -177,13 +177,13 @@ SET (H5FS_SRCS ${HDF5_SRC_DIR}/H5FStest.c ) -SET (H5FS_HDRS +set (H5FS_HDRS ${HDF5_SRC_DIR}/H5FSpkg.h ${HDF5_SRC_DIR}/H5FSpublic.h ) IDE_GENERATED_PROPERTIES ("H5FS" "${H5FS_HDRS}" "${H5FS_SRCS}" ) -SET (H5G_SRCS +set (H5G_SRCS ${HDF5_SRC_DIR}/H5G.c ${HDF5_SRC_DIR}/H5Gbtree2.c ${HDF5_SRC_DIR}/H5Gcache.c @@ -204,13 +204,13 @@ SET (H5G_SRCS ${HDF5_SRC_DIR}/H5Gtraverse.c ) -SET (H5G_HDRS +set (H5G_HDRS ${HDF5_SRC_DIR}/H5Gpkg.h ${HDF5_SRC_DIR}/H5Gpublic.h ) IDE_GENERATED_PROPERTIES ("H5G" "${H5G_HDRS}" "${H5G_SRCS}" ) -SET (H5HF_SRCS +set (H5HF_SRCS ${HDF5_SRC_DIR}/H5HF.c ${HDF5_SRC_DIR}/H5HFbtree2.c ${HDF5_SRC_DIR}/H5HFcache.c @@ -229,60 +229,60 @@ SET (H5HF_SRCS ${HDF5_SRC_DIR}/H5HFtiny.c ) -SET (H5HF_HDRS +set (H5HF_HDRS ${HDF5_SRC_DIR}/H5HFpkg.h ${HDF5_SRC_DIR}/H5HFpublic.h ) IDE_GENERATED_PROPERTIES ("H5HF" "${H5HF_HDRS}" "${H5HF_SRCS}" ) -SET (H5HG_SRCS +set (H5HG_SRCS ${HDF5_SRC_DIR}/H5HG.c ${HDF5_SRC_DIR}/H5HGcache.c ${HDF5_SRC_DIR}/H5HGdbg.c ${HDF5_SRC_DIR}/H5HGquery.c ) -SET (H5HG_HDRS +set (H5HG_HDRS ${HDF5_SRC_DIR}/H5HGpkg.h ${HDF5_SRC_DIR}/H5HGpublic.h ) IDE_GENERATED_PROPERTIES ("H5HG" "${H5HG_HDRS}" "${H5HG_SRCS}" ) -SET (H5HL_SRCS +set (H5HL_SRCS ${HDF5_SRC_DIR}/H5HL.c ${HDF5_SRC_DIR}/H5HLcache.c ${HDF5_SRC_DIR}/H5HLdbg.c ${HDF5_SRC_DIR}/H5HLint.c ) -SET (H5HL_HDRS +set (H5HL_HDRS ${HDF5_SRC_DIR}/H5HLpkg.h ${HDF5_SRC_DIR}/H5HLpublic.h ) IDE_GENERATED_PROPERTIES ("H5HL" "${H5HL_HDRS}" "${H5HL_SRCS}" ) -SET (H5MF_SRCS +set (H5MF_SRCS ${HDF5_SRC_DIR}/H5MF.c ${HDF5_SRC_DIR}/H5MFaggr.c ${HDF5_SRC_DIR}/H5MFdbg.c ${HDF5_SRC_DIR}/H5MFsection.c ) -SET (H5MF_HDRS +set (H5MF_HDRS ) IDE_GENERATED_PROPERTIES ("H5MF" "${H5MF_HDRS}" "${H5MF_SRCS}" ) -SET (H5MP_SRCS +set (H5MP_SRCS ${HDF5_SRC_DIR}/H5MP.c ${HDF5_SRC_DIR}/H5MPtest.c ) -SET (H5MP_HDRS +set (H5MP_HDRS ${HDF5_SRC_DIR}/H5MPpkg.h ) IDE_GENERATED_PROPERTIES ("H5MP" "${H5MP_HDRS}" "${H5MP_SRCS}" ) -SET (H5O_SRCS +set (H5O_SRCS ${HDF5_SRC_DIR}/H5O.c ${HDF5_SRC_DIR}/H5Oainfo.c ${HDF5_SRC_DIR}/H5Oalloc.c @@ -317,14 +317,14 @@ SET (H5O_SRCS ${HDF5_SRC_DIR}/H5Ounknown.c ) -SET (H5O_HDRS +set (H5O_HDRS ${HDF5_SRC_DIR}/H5Opkg.h ${HDF5_SRC_DIR}/H5Opublic.h ${HDF5_SRC_DIR}/H5Oshared.h ) IDE_GENERATED_PROPERTIES ("H5O" "${H5O_HDRS}" "${H5O_SRCS}" ) -SET (H5P_SRCS +set (H5P_SRCS ${HDF5_SRC_DIR}/H5P.c ${HDF5_SRC_DIR}/H5Pacpl.c ${HDF5_SRC_DIR}/H5Pdapl.c @@ -344,49 +344,49 @@ SET (H5P_SRCS ${HDF5_SRC_DIR}/H5Ptest.c ) -SET (H5P_HDRS +set (H5P_HDRS ${HDF5_SRC_DIR}/H5Ppkg.h ${HDF5_SRC_DIR}/H5Ppublic.h ) IDE_GENERATED_PROPERTIES ("H5P" "${H5P_HDRS}" "${H5P_SRCS}" ) -SET (H5PL_SRCS +set (H5PL_SRCS ${HDF5_SRC_DIR}/H5PL.c ) -SET (H5PL_HDRS +set (H5PL_HDRS ${HDF5_SRC_DIR}/H5PLextern.h ) IDE_GENERATED_PROPERTIES ("H5PL" "${H5PL_HDRS}" "${H5PL_SRCS}" ) -SET (H5R_SRCS +set (H5R_SRCS ${HDF5_SRC_DIR}/H5R.c ${HDF5_SRC_DIR}/H5Rdeprec.c ) -SET (H5R_HDRS +set (H5R_HDRS ${HDF5_SRC_DIR}/H5Rpkg.h ${HDF5_SRC_DIR}/H5Rpublic.h ) IDE_GENERATED_PROPERTIES ("H5R" "${H5R_HDRS}" "${H5R_SRCS}" ) -SET (H5RC_SRCS +set (H5RC_SRCS ${HDF5_SRC_DIR}/H5RC.c ) -SET (H5RC_HDRS +set (H5RC_HDRS ) IDE_GENERATED_PROPERTIES ("H5RC" "${H5RC_HDRS}" "${H5RC_SRCS}" ) -SET (H5RS_SRCS +set (H5RS_SRCS ${HDF5_SRC_DIR}/H5RS.c ) -SET (H5RS_HDRS +set (H5RS_HDRS ) IDE_GENERATED_PROPERTIES ("H5RS" "${H5RS_HDRS}" "${H5RS_SRCS}" ) -SET (H5S_SRCS +set (H5S_SRCS ${HDF5_SRC_DIR}/H5S.c ${HDF5_SRC_DIR}/H5Sall.c ${HDF5_SRC_DIR}/H5Sdbg.c @@ -398,13 +398,13 @@ SET (H5S_SRCS ${HDF5_SRC_DIR}/H5Stest.c ) -SET (H5S_HDRS +set (H5S_HDRS ${HDF5_SRC_DIR}/H5Spkg.h ${HDF5_SRC_DIR}/H5Spublic.h ) IDE_GENERATED_PROPERTIES ("H5S" "${H5S_HDRS}" "${H5S_SRCS}" ) -SET (H5SM_SRCS +set (H5SM_SRCS ${HDF5_SRC_DIR}/H5SM.c ${HDF5_SRC_DIR}/H5SMbtree2.c ${HDF5_SRC_DIR}/H5SMcache.c @@ -412,12 +412,12 @@ SET (H5SM_SRCS ${HDF5_SRC_DIR}/H5SMtest.c ) -SET (H5SM_HDRS +set (H5SM_HDRS ${HDF5_SRC_DIR}/H5SMpkg.h ) IDE_GENERATED_PROPERTIES ("H5SM" "${H5SM_HDRS}" "${H5SM_SRCS}" ) -SET (H5T_SRCS +set (H5T_SRCS ${HDF5_SRC_DIR}/H5T.c ${HDF5_SRC_DIR}/H5Tarray.c ${HDF5_SRC_DIR}/H5Tbit.c @@ -443,13 +443,13 @@ SET (H5T_SRCS ${HDF5_SRC_DIR}/H5Tvlen.c ) -SET (H5T_HDRS +set (H5T_HDRS ${HDF5_SRC_DIR}/H5Tpkg.h ${HDF5_SRC_DIR}/H5Tpublic.h ) IDE_GENERATED_PROPERTIES ("H5T" "${H5T_HDRS}" "${H5T_SRCS}" ) -SET (H5Z_SRCS +set (H5Z_SRCS ${HDF5_SRC_DIR}/H5Z.c ${HDF5_SRC_DIR}/H5Zdeflate.c ${HDF5_SRC_DIR}/H5Zfletcher32.c @@ -459,19 +459,19 @@ SET (H5Z_SRCS ${HDF5_SRC_DIR}/H5Zszip.c ${HDF5_SRC_DIR}/H5Ztrans.c ) -IF (H5_ZLIB_HEADER) +if (H5_ZLIB_HEADER) SET_PROPERTY(SOURCE ${HDF5_SRC_DIR}/H5Zdeflate.c PROPERTY COMPILE_DEFINITIONS H5_ZLIB_HEADER="${H5_ZLIB_HEADER}") -ENDIF (H5_ZLIB_HEADER) +endif (H5_ZLIB_HEADER) -SET (H5Z_HDRS +set (H5Z_HDRS ${HDF5_SRC_DIR}/H5Zpkg.h ${HDF5_SRC_DIR}/H5Zpublic.h ) IDE_GENERATED_PROPERTIES ("H5Z" "${H5Z_HDRS}" "${H5Z_SRCS}" ) -SET (common_SRCS +set (common_SRCS ${H5_SRCS} ${H5A_SRCS} ${H5AC_SRCS} @@ -518,7 +518,7 @@ SET (common_SRCS ${HDF5_SRC_DIR}/H5WB.c ) -SET (H5_PUBLIC_HEADERS +set (H5_PUBLIC_HEADERS ${H5_HDRS} ${H5A_HDRS} ${H5AC_HDRS} @@ -556,12 +556,12 @@ SET (H5_PUBLIC_HEADERS # -------------------------------------------------------------------- # If we are compiling on Windows then add the windows specific files # -------------------------------------------------------------------- -IF (WIN32 AND NOT CYGWIN) - SET (common_SRCS ${common_SRCS} ${HDF5_SRC_DIR}/H5FDwindows.c) - SET (H5_PUBLIC_HEADERS ${H5_PUBLIC_HEADERS} ${HDF5_SRC_DIR}/H5FDwindows.h) -ENDIF (WIN32 AND NOT CYGWIN) +if (WIN32) + set (common_SRCS ${common_SRCS} ${HDF5_SRC_DIR}/H5FDwindows.c) + set (H5_PUBLIC_HEADERS ${H5_PUBLIC_HEADERS} ${HDF5_SRC_DIR}/H5FDwindows.h) +endif (WIN32) -SET (H5_PRIVATE_HEADERS +set (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5private.h ${HDF5_SRC_DIR}/H5Aprivate.h ${HDF5_SRC_DIR}/H5ACprivate.h @@ -604,35 +604,32 @@ SET (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5win32defs.h ) -INCLUDE_DIRECTORIES (${HDF5_SOURCE_DIR}) -INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}) - #----------------------------------------------------------------------------- # Setup the H5Detect utility which generates H5Tinit with platform # specific type checks inside #----------------------------------------------------------------------------- -ADD_EXECUTABLE (H5detect ${HDF5_SRC_DIR}/H5detect.c) +add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) TARGET_C_PROPERTIES (H5detect " " " ") -IF (MSVC) - TARGET_LINK_LIBRARIES (H5detect "ws2_32.lib") -ENDIF (MSVC) +if (MSVC) + target_link_libraries (H5detect "ws2_32.lib") +endif (MSVC) -SET (CMD $<TARGET_FILE:H5detect>) -ADD_CUSTOM_COMMAND ( +set (CMD $<TARGET_FILE:H5detect>) +add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c COMMAND ${CMD} ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c DEPENDS H5detect ) -ADD_EXECUTABLE (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) +add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) TARGET_C_PROPERTIES (H5make_libsettings " " " ") -IF (MSVC) - TARGET_LINK_LIBRARIES (H5make_libsettings "ws2_32.lib") -ENDIF (MSVC) +if (MSVC) + target_link_libraries (H5make_libsettings "ws2_32.lib") +endif (MSVC) -SET (CMD $<TARGET_FILE:H5make_libsettings>) -ADD_CUSTOM_COMMAND ( +set (CMD $<TARGET_FILE:H5make_libsettings>) +add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c COMMAND ${CMD} ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c @@ -640,21 +637,21 @@ ADD_CUSTOM_COMMAND ( WORKING_DIRECTORY ${HDF5_BINARY_DIR} ) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET ${HDF5_BINARY_DIR}/H5Edefin.h PRE_BUILD COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_err ${HDF5_SOURCE_DIR}/src/H5err.txt COMMENT " Creating err headers" ) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET ${HDF5_BINARY_DIR}/H5version.h PRE_BUILD COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_vers ${HDF5_SOURCE_DIR}/src/H5vers.txt COMMENT " Creating API version macro" ) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET ${HDF5_BINARY_DIR}/H5overflow.h PRE_BUILD COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_overflow ${HDF5_SOURCE_DIR}/src/H5overflow.txt @@ -664,51 +661,67 @@ ADD_CUSTOM_COMMAND ( #----------------------------------------------------------------------------- # Add H5Tinit source to build - generated by H5Detect/CMake at configure time #----------------------------------------------------------------------------- -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Tinit.c) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5Tinit.c GENERATED) -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5lib_settings.c) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5lib_settings.c GENERATED) -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Edefin.h) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5Edefin.h GENERATED) -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5version.h) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5version.h GENERATED) -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5overflow.h) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5overflow.h GENERATED) - -ADD_LIBRARY (${HDF5_LIB_TARGET} ${LIB_TYPE} ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Tinit.c) +set_source_files_properties (${HDF5_BINARY_DIR}/H5Tinit.c GENERATED) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5lib_settings.c) +set_source_files_properties (${HDF5_BINARY_DIR}/H5lib_settings.c GENERATED) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Edefin.h) +set_source_files_properties (${HDF5_BINARY_DIR}/H5Edefin.h GENERATED) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5version.h) +set_source_files_properties (${HDF5_BINARY_DIR}/H5version.h GENERATED) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5overflow.h) +set_source_files_properties (${HDF5_BINARY_DIR}/H5overflow.h GENERATED) + +add_library (${HDF5_LIB_TARGET} ${LIB_TYPE} ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} ${LINK_LIBS}) -IF (NOT WIN32) - TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} dl) -ENDIF (NOT WIN32) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_LIB_TARGET} ${LINK_LIBS}) +if (NOT WIN32) + target_link_libraries (${HDF5_LIB_TARGET} dl) +endif (NOT WIN32) +if (H5_HAVE_PARALLEL AND MPI_C_FOUND) + target_link_libraries (${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) +endif (H5_HAVE_PARALLEL AND MPI_C_FOUND) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries) +set_target_properties (${HDF5_LIB_TARGET} PROPERTIES + FOLDER libraries + INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" +) + +option (HDF5_ENABLE_DEBUG_APIS "Turn on debugging in all packages" OFF) +if (HDF5_ENABLE_DEBUG_APIS) + set_target_properties (${HDF5_LIB_TARGET} PROPERTIES + COMPILE_DEFINITIONS + "-DH5Z_DEBUG -DH5VM_DEBUG -DH5T_DEBUG + -DH5S_DEBUG -DH5P_DEBUG -DH5O_DEBUG -DH5MM_DEBUG -DH5MF_DEBUG + -DH5I_DEBUG -DH5HL_DEBUG -DH5HG_DEBUG -DH5G_DEBUG -DH5F_DEBUG + -DH5E_DEBUG -DH5D_DEBUG -DH5B_DEBUG -DH5AC_DEBUG -UNDEBUG" + ) +endif (HDF5_ENABLE_DEBUG_APIS) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -IF (NOT HDF5_INSTALL_NO_DEVELOPMENT) - INSTALL ( +if (NOT HDF5_INSTALL_NO_DEVELOPMENT) + install ( FILES ${H5_PUBLIC_HEADERS} - ${H5_PRIVATE_HEADERS} DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT headers ) -ENDIF (NOT HDF5_INSTALL_NO_DEVELOPMENT) +endif (NOT HDF5_INSTALL_NO_DEVELOPMENT) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) - IF (BUILD_SHARED_LIBS) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} libraries) - ENDIF (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS) - INSTALL ( + install ( TARGETS ${HDF5_LIB_TARGET} EXPORT @@ -717,4 +730,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT libraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT libraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) |