diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2013-04-02 17:11:37 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2013-04-02 17:11:37 (GMT) |
commit | 550bd7c0f472167cb19262e479aa2166ee0cb616 (patch) | |
tree | 7c0a809aa651d3597a68efc017108b3116c9fb9f /test | |
parent | 4da796299b0e86eb93dd7f45761696415ae8af58 (diff) | |
download | hdf5-550bd7c0f472167cb19262e479aa2166ee0cb616.zip hdf5-550bd7c0f472167cb19262e479aa2166ee0cb616.tar.gz hdf5-550bd7c0f472167cb19262e479aa2166ee0cb616.tar.bz2 |
[svn-r23522] I merged the changes that Allen added for supporting dynlib2.c and dynlib3.c from the trunk.
Not tested. Allen will do it.
Diffstat (limited to 'test')
-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 fe93a97..2ced362 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) # -------------------------------------------------------------------- |