diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2013-04-02 16:27:46 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2013-04-02 16:27:46 (GMT) |
commit | 91831f41ad8c6fe7d88cf44d7384176a9d0751f5 (patch) | |
tree | 227ee2571b135216bc3a0e2a4deeec2a6996b64b | |
parent | b8c258a9700e6633b681891794458e57598d55ae (diff) | |
download | hdf5-91831f41ad8c6fe7d88cf44d7384176a9d0751f5.zip hdf5-91831f41ad8c6fe7d88cf44d7384176a9d0751f5.tar.gz hdf5-91831f41ad8c6fe7d88cf44d7384176a9d0751f5.tar.bz2 |
[svn-r23520] Add new plugin library to build list for test.
Tested: local linux, windows
-rw-r--r-- | test/CMakeLists.txt | 70 |
1 files changed, 37 insertions, 33 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 75f398d..3d958ca 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -41,44 +41,48 @@ SET_TARGET_PROPERTIES (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test) # If plugin library tests can be tested #----------------------------------------------------------------------------- IF (BUILD_SHARED_LIBS) - SET (HDF5_TEST_PLUGIN_LIB_CORENAME "dynlib1") - SET (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") - SET (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) - ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - #----------------------------------------------------------------------------- - # Define Sources - #----------------------------------------------------------------------------- - - SET (H5_TEST_PLUGIN_LIB_SRCS - ${HDF5_TEST_SOURCE_DIR}/dynlib1.c - ) - - ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${H5_TEST_PLUGIN_LIB_SRCS}) - TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS ( - ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} - ${LIB_TYPE} - HDF5_TEST_PLUGIN_LIB_NAME_RELEASE - HDF5_TEST_PLUGIN_LIB_NAME_DEBUG - ) - SET_TARGET_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) + # make plugins dir + FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") #----------------------------------------------------------------------------- - # Copy plugin library to a plugins folder + # Define Test Library Sources #----------------------------------------------------------------------------- - - # make plugins dir - FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") - ADD_CUSTOM_COMMAND ( - TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - "$<TARGET_FILE:${HDF5_TEST_PLUGIN_LIB_TARGET}>" - "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_LIB_TARGET}>" + SET (TEST_PLUGIN_LIBS + dynlib1 + dynlib2 + dynlib3 ) + + FOREACH (test_lib ${TEST_PLUGIN_LIBS}) + SET (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") + SET (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") + SET (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) + ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) + + ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) + TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + H5_SET_LIB_OPTIONS ( + ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} + ${LIB_TYPE} + HDF5_TEST_PLUGIN_LIB_NAME_RELEASE + HDF5_TEST_PLUGIN_LIB_NAME_DEBUG + ) + SET_TARGET_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) + + #----------------------------------------------------------------------------- + # Copy plugin library to a plugins folder + #----------------------------------------------------------------------------- + ADD_CUSTOM_COMMAND ( + TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + "$<TARGET_FILE:${HDF5_TEST_PLUGIN_LIB_TARGET}>" + "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_LIB_TARGET}>" + ) + ENDFOREACH (test_lib ${TEST_PLUGIN_LIBS}) ENDIF (BUILD_SHARED_LIBS) # -------------------------------------------------------------------- |