diff options
Diffstat (limited to 'c++')
-rw-r--r-- | c++/examples/CMakeLists.txt | 10 | ||||
-rw-r--r-- | c++/test/CMakeLists.txt | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index 1a9602a..75644a8 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -23,5 +23,15 @@ SET (examples FOREACH (example ${examples}) ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) H5_NAMING (cpp_ex_${example}) + IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (cpp_ex_${example} + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) + ENDIF (WIN32) TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) ENDFOREACH (example ${examples}) diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index ac72772..770348e 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -38,6 +38,16 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SOURCE_DIR} ) ADD_EXECUTABLE (cpp_testhdf5 ${CPP_TEST_SRCS} ) H5_NAMING (cpp_testhdf5) +IF (WIN32) + IF (MSVC) + IF (NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (cpp_testhdf5 + PROPERTIES + LINK_FLAGS "/NODEFAULTLIB:MSVCRT" + ) + ENDIF (NOT BUILD_SHARED_LIBS) + ENDIF (MSVC) +ENDIF (WIN32) TARGET_LINK_LIBRARIES (cpp_testhdf5 ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET} |