diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2013-06-11 19:03:34 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2013-06-11 19:03:34 (GMT) |
commit | 6ca79dd149087b27d2b91e38942e5b5f706ae1a3 (patch) | |
tree | 6d890484fbe96062d584e1ec57c9752a5e3a945d /config/cmake/UserMacros | |
parent | f4a3f6412bb4e739e2a5bcfe2a404191407ae3f6 (diff) | |
download | hdf5-6ca79dd149087b27d2b91e38942e5b5f706ae1a3.zip hdf5-6ca79dd149087b27d2b91e38942e5b5f706ae1a3.tar.gz hdf5-6ca79dd149087b27d2b91e38942e5b5f706ae1a3.tar.bz2 |
[svn-r23753] HDFFV-8461: Add Windows /MT support
This adds the UserMacros.cmake Windows /MT support file.
Tested: local linux
Diffstat (limited to 'config/cmake/UserMacros')
-rw-r--r-- | config/cmake/UserMacros/Windows_MT.cmake | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake new file mode 100644 index 0000000..3bd1607 --- /dev/null +++ b/config/cmake/UserMacros/Windows_MT.cmake @@ -0,0 +1,39 @@ +######################################################## +# Include file for user options +######################################################## + +# To use this option, copy both the macro and option code +# into the root UserMacros.cmake file. + +#----------------------------------------------------------------------------- +# Option to Build with Static CRT libraries on Windows +#------------------------------------------------------------------------------- +MACRO (TARGET_STATIC_CRT_FLAGS) + IF (MSVC AND NOT BUILD_SHARED_LIBS) + FOREACH (flag_var + CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + IF (${flag_var} MATCHES "/MD") + STRING (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + ENDIF (${flag_var} MATCHES "/MD") + ENDFOREACH (flag_var) + FOREACH (flag_var + CMAKE_Fortran_FLAGS CMAKE_Fortran_FLAGS_DEBUG CMAKE_Fortran_FLAGS_RELEASE + CMAKE_Fortran_FLAGS_MINSIZEREL CMAKE_Fortran_FLAGS_RELWITHDEBINFO) + IF (${flag_var} MATCHES "/libs:dll") + STRING (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}") + ENDIF (${flag_var} MATCHES "/libs:dll") + ENDFOREACH (flag_var) + SET (WIN_COMPILE_FLAGS "/MT") + SET (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT") + ENDIF (MSVC AND NOT BUILD_SHARED_LIBS) +ENDMACRO (TARGET_STATIC_CRT_FLAGS) + +#----------------------------------------------------------------------------- +OPTION (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) +IF (BUILD_STATIC_CRT_LIBS) + TARGET_STATIC_CRT_FLAGS () +ENDIF (BUILD_STATIC_CRT_LIBS) +
\ No newline at end of file |