hdf5: add cmake test

This commit is contained in:
Tony Theodore 2015-11-28 20:07:29 +11:00
parent b5546cf2f5
commit 46baacbd21
2 changed files with 22 additions and 0 deletions

14
src/hdf5-test.cmake Normal file
View File

@ -0,0 +1,14 @@
# This file is part of MXE.
# See index.html for further information.
# partial module - included by src/cmake/CMakeLists.txt
set(TGT test-${PKG}-cmake)
enable_language(CXX)
add_executable(${TGT} ${CMAKE_CURRENT_LIST_DIR}/${PKG}-test.cpp)
find_package(HDF5 ${PKG_VERSION} EXACT REQUIRED)
target_link_libraries(${TGT} ${HDF5_LIBRARIES})
install(TARGETS ${TGT} DESTINATION bin)

View File

@ -69,4 +69,12 @@ define $(PKG)_BUILD
-W -Wall -Werror -ansi -pedantic \
'$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-hdf5.exe' \
-lhdf5_hl -lhdf5 -lz
# test cmake can find hdf5
mkdir '$(1).test-cmake'
cd '$(1).test-cmake' && '$(TARGET)-cmake' \
-DPKG=$(PKG) \
-DPKG_VERSION=$($(PKG)_VERSION) \
'$(PWD)/src/cmake/test'
$(MAKE) -C '$(1).test-cmake' -j 1 install VERBOSE=ON
endef