summaryrefslogtreecommitdiffstats
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2013-03-27 16:11:21 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2013-03-27 16:11:21 (GMT)
commit5f8f3dcb793ac58a084ed38e841bf98f4bfd486b (patch)
treeaf8940316a58e8d308ee17f89dcb01dbc8838102 /test/CMakeLists.txt
parent5b12b8e1227d70dab65a90ab1478cbf88b9e0930 (diff)
downloadhdf5-5f8f3dcb793ac58a084ed38e841bf98f4bfd486b.zip
hdf5-5f8f3dcb793ac58a084ed38e841bf98f4bfd486b.tar.gz
hdf5-5f8f3dcb793ac58a084ed38e841bf98f4bfd486b.tar.bz2
[svn-r23467] Remove subdirectory.
Tested: local linux
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt88
1 files changed, 68 insertions, 20 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index dfd6a8e..75f398d 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -7,22 +7,14 @@ PROJECT (HDF5_TEST)
ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS})
#-----------------------------------------------------------------------------
-# If plugin library tests can be tested
+# Generate the H5srcdir_str.h file containing user settings needed by compilation
#-----------------------------------------------------------------------------
-IF (BUILD_SHARED_LIBS)
- IF (EXISTS "${HDF5_TEST_SOURCE_DIR}/plugin_lib" AND IS_DIRECTORY "${HDF5_TEST_SOURCE_DIR}/plugin_lib")
- ADD_SUBDIRECTORY (${HDF5_TEST_SOURCE_DIR}/plugin_lib ${PROJECT_BINARY_DIR}/plugin_lib)
- ENDIF (EXISTS "${HDF5_TEST_SOURCE_DIR}/plugin_lib" AND IS_DIRECTORY "${HDF5_TEST_SOURCE_DIR}/plugin_lib")
-ELSE (BUILD_SHARED_LIBS)
- MESSAGE (STATUS " **** Plugins libraries must be built as shared libraries **** ")
- ADD_TEST (
- NAME H5PLUGIN-SKIPPED
- COMMAND ${CMAKE_COMMAND} -E echo "SKIP H5PLUGIN TESTING"
- )
-ENDIF (BUILD_SHARED_LIBS)
+SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR})
+CONFIGURE_FILE (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY)
+INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR})
#-----------------------------------------------------------------------------
-# Define Sources
+# Define Test Library Sources
#-----------------------------------------------------------------------------
SET (TEST_LIB_SRCS
${HDF5_TEST_SOURCE_DIR}/h5test.c
@@ -34,13 +26,6 @@ SET (TEST_LIB_HEADERS
${HDF5_TEST_SOURCE_DIR}/h5test.h
)
-#-----------------------------------------------------------------------------
-# Generate the H5srcdir_str.h file containing user settings needed by compilation
-#-----------------------------------------------------------------------------
-SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR})
-CONFIGURE_FILE (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY)
-INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR})
-
ADD_LIBRARY (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS})
IF (MSVC)
TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} "ws2_32.lib")
@@ -52,6 +37,50 @@ TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} ${LIB_TYPE})
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)
+
+ #-----------------------------------------------------------------------------
+ # Copy plugin library to a plugins folder
+ #-----------------------------------------------------------------------------
+
+ # 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}>"
+ )
+ENDIF (BUILD_SHARED_LIBS)
+
# --------------------------------------------------------------------
# Copy all the HDF5 files from the test directory into the source directory
# --------------------------------------------------------------------
@@ -569,6 +598,25 @@ ENDIF (\${TEST_RESULT} STREQUAL \"0\")
ADD_TEST (NAME testlibinfo COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$<TARGET_FILE:${HDF5_LIB_TARGET}>" -P "${GREP_RUNNER}")
##############################################################################
+### P L U G I N T E S T S
+##############################################################################
+IF (BUILD_SHARED_LIBS)
+ ADD_EXECUTABLE (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c)
+ TARGET_NAMING (plugin ${LIB_TYPE})
+ TARGET_LINK_LIBRARIES (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET})
+ SET_TARGET_PROPERTIES (plugin PROPERTIES FOLDER test)
+
+ ADD_TEST (NAME H5PLUGIN-plugin COMMAND $<TARGET_FILE:plugin>)
+ SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/plugins")
+ELSE (BUILD_SHARED_LIBS)
+ MESSAGE (STATUS " **** Plugins libraries must be built as shared libraries **** ")
+ ADD_TEST (
+ NAME H5PLUGIN-SKIPPED
+ COMMAND ${CMAKE_COMMAND} -E echo "SKIP H5PLUGIN TESTING"
+ )
+ENDIF (BUILD_SHARED_LIBS)
+
+##############################################################################
##############################################################################
### V F D T E S T S ###
##############################################################################