summaryrefslogtreecommitdiffstats
path: root/c++
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2015-08-05 21:01:07 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2015-08-05 21:01:07 (GMT)
commit9e2434625dde11a19b46a5154477247266792219 (patch)
tree7e7b94935a7acdf8024ec464218c564dccf52963 /c++
parent0b4b73331d2cd4d6d3433e8bc5c45011f75d6fd3 (diff)
downloadhdf5-9e2434625dde11a19b46a5154477247266792219.zip
hdf5-9e2434625dde11a19b46a5154477247266792219.tar.gz
hdf5-9e2434625dde11a19b46a5154477247266792219.tar.bz2
[svn-r27469] Merge from trunk with dual-binary CMake code.
Tested: local linux with CMake
Diffstat (limited to 'c++')
-rw-r--r--c++/CMakeLists.txt9
-rw-r--r--c++/Makefile.in5
-rw-r--r--c++/examples/CMakeLists.txt8
-rw-r--r--c++/examples/Makefile.in5
-rw-r--r--c++/src/CMakeLists.txt33
-rw-r--r--c++/src/Makefile.in5
-rw-r--r--c++/test/CMakeLists.txt4
-rw-r--r--c++/test/Makefile.in5
8 files changed, 43 insertions, 31 deletions
diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt
index 39280e8..6f288a0 100644
--- a/c++/CMakeLists.txt
+++ b/c++/CMakeLists.txt
@@ -7,15 +7,6 @@ PROJECT (HDF5_CPP)
add_definitions (${HDF_EXTRA_C_FLAGS})
#-----------------------------------------------------------------------------
-# Shared/Static Libs
-#-----------------------------------------------------------------------------
-if (BUILD_SHARED_LIBS)
- set (CPP_BUILT_AS_DYNAMIC_LIB 1)
-else (BUILD_SHARED_LIBS)
- set (CPP_BUILT_AS_STATIC_LIB 1)
-endif (BUILD_SHARED_LIBS)
-
-#-----------------------------------------------------------------------------
# Generate configure file
#-----------------------------------------------------------------------------
configure_file (${HDF_RESOURCES_DIR}/H5cxx_config.h.in
diff --git a/c++/Makefile.in b/c++/Makefile.in
index 2315cc2..e3b7e89 100644
--- a/c++/Makefile.in
+++ b/c++/Makefile.in
@@ -102,7 +102,10 @@ TESTS =
subdir = c++
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \
- $(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt
index ff375f3..cfcdd8d 100644
--- a/c++/examples/CMakeLists.txt
+++ b/c++/examples/CMakeLists.txt
@@ -34,16 +34,16 @@ set (tutr_examples
foreach (example ${examples})
add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp)
- TARGET_NAMING (cpp_ex_${example} ${LIB_TYPE})
- TARGET_C_PROPERTIES (cpp_ex_${example} ${LIB_TYPE} " " " ")
+ TARGET_NAMING (cpp_ex_${example} STATIC)
+ TARGET_C_PROPERTIES (cpp_ex_${example} STATIC " " " ")
target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp)
endforeach (example ${examples})
foreach (example ${tutr_examples})
add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp)
- TARGET_NAMING (cpp_ex_${example} ${LIB_TYPE})
- TARGET_C_PROPERTIES (cpp_ex_${example} ${LIB_TYPE} " " " ")
+ TARGET_NAMING (cpp_ex_${example} STATIC)
+ TARGET_C_PROPERTIES (cpp_ex_${example} STATIC " " " ")
target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp)
endforeach (example ${tutr_examples})
diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in
index 6b0f894..9de558c 100644
--- a/c++/examples/Makefile.in
+++ b/c++/examples/Makefile.in
@@ -108,7 +108,10 @@ TESTS = $(TEST_SCRIPT)
subdir = c++/examples
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \
- $(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
index 44b912c..1ae5647 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
@@ -2,13 +2,6 @@ cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_CPP_SRC)
#-----------------------------------------------------------------------------
-# Shared/Static Libs
-#-----------------------------------------------------------------------------
-if (BUILD_SHARED_LIBS)
- set (CPP_BUILT_AS_DYNAMIC_LIB 1)
-endif (BUILD_SHARED_LIBS)
-
-#-----------------------------------------------------------------------------
# Generate configure file
#-----------------------------------------------------------------------------
configure_file (${HDF_RESOURCES_DIR}/H5cxx_config.h.in
@@ -83,15 +76,31 @@ set (CPP_HDRS
${HDF5_CPP_SRC_SOURCE_DIR}/H5VarLenType.h
)
-add_library (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS})
-TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} " " " ")
+add_library (${HDF5_CPP_LIB_TARGET} STATIC ${CPP_SRCS} ${CPP_HDRS})
+TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} STATIC " " " ")
target_link_libraries (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}")
-H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} ${LIB_TYPE})
+H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} STATIC)
set_target_properties (${HDF5_CPP_LIB_TARGET} PROPERTIES
FOLDER libraries/cpp
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
+set (install_targets ${HDF5_CPP_LIB_TARGET})
+
+if (BUILD_SHARED_LIBS)
+ add_library (${HDF5_CPP_LIBSH_TARGET} SHARED ${CPP_SRCS} ${CPP_HDRS})
+ TARGET_C_PROPERTIES (${HDF5_CPP_LIBSH_TARGET} SHARED " " " ")
+ target_link_libraries (${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIBSH_TARGET}")
+ H5_SET_LIB_OPTIONS (${HDF5_CPP_LIBSH_TARGET} ${HDF5_CPP_LIB_NAME} SHARED)
+ set_target_properties (${HDF5_CPP_LIBSH_TARGET} PROPERTIES
+ FOLDER libraries/cpp
+ COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB"
+ INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1
+ )
+ set (install_targets ${install_targets} ${HDF5_CPP_LIBSH_TARGET})
+endif (BUILD_SHARED_LIBS)
#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
@@ -110,12 +119,12 @@ install (
#-----------------------------------------------------------------------------
if (HDF5_EXPORTED_TARGETS)
if (BUILD_SHARED_LIBS)
- INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries)
+ INSTALL_TARGET_PDB (${HDF5_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries)
endif (BUILD_SHARED_LIBS)
install (
TARGETS
- ${HDF5_CPP_LIB_TARGET}
+ ${install_targets}
EXPORT
${HDF5_EXPORTED_TARGETS}
LIBRARY DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT cpplibraries
diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in
index c19c169..f9c3964 100644
--- a/c++/src/Makefile.in
+++ b/c++/src/Makefile.in
@@ -107,7 +107,10 @@ TESTS =
subdir = c++/src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \
- $(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt
index dcdf3a3..6f1d857 100644
--- a/c++/test/CMakeLists.txt
+++ b/c++/test/CMakeLists.txt
@@ -35,8 +35,8 @@ set (srcdir ${CMAKE_CURRENT_SOURCE_DIR})
configure_file (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY)
add_executable (cpp_testhdf5 ${CPP_TEST_SRCS} )
-TARGET_NAMING (cpp_testhdf5 ${LIB_TYPE})
-TARGET_C_PROPERTIES (cpp_testhdf5 ${LIB_TYPE} " " " ")
+TARGET_NAMING (cpp_testhdf5 STATIC)
+TARGET_C_PROPERTIES (cpp_testhdf5 STATIC " " " ")
target_link_libraries (cpp_testhdf5
${HDF5_CPP_LIB_TARGET}
${HDF5_LIB_TARGET}
diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in
index 0da1d86..6109c13 100644
--- a/c++/test/Makefile.in
+++ b/c++/test/Makefile.in
@@ -104,7 +104,10 @@ TESTS = $(am__EXEEXT_1)
subdir = c++/test
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \
- $(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs