From 187545771bffb745fcb2a373dfe414c1f29f875b Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Wed, 22 Mar 2017 04:10:13 +0100 Subject: [PATCH 1/5] add LICENSE.txt for WIN32 bin package --- README/LICENSE.txt | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 README/LICENSE.txt diff --git a/README/LICENSE.txt b/README/LICENSE.txt new file mode 100644 index 0000000..ed15c23 --- /dev/null +++ b/README/LICENSE.txt @@ -0,0 +1,41 @@ + * @copyright + * Copyright (c) 1998-2017 World Wide Web Consortium (Massachusetts + * Institute of Technology, European Research Consortium for Informatics + * and Mathematics, Keio University). + * @par + * All Rights Reserved. + * @par + * This software and documentation is provided "as is," and the copyright + * holders and contributing author(s) make no representations or warranties, + * express or implied, including but not limited to, warranties of + * merchantability or fitness for any particular purpose or that the use of + * the software or documentation will not infringe any third party patents, + * copyrights, trademarks or other rights. + * @par + * The copyright holders and contributing author(s) will not be held liable + * for any direct, indirect, special or consequential damages arising out of + * any use of the software or documentation, even if advised of the + * possibility of such damage. + * @par + * Permission is hereby granted to use, copy, modify, and distribute this + * source code, or portions hereof, documentation and executables, for any + * purpose, without fee, subject to the following restrictions: + * @par + * 1. The origin of this source code must not be misrepresented. + * 2. Altered versions must be plainly marked as such and must not be + * misrepresented as being the original source. + * 3. This Copyright notice may not be removed or altered from any source + * or altered source distribution. + * @par + * The copyright holders and contributing author(s) specifically permit, + * without fee, and encourage the use of this source code as a component for + * supporting the Hypertext Markup Language in commercial products. If you + * use this source code in a product, acknowledgment is not required but + * would be appreciated. + * + * @date Created 2001-05-20 by Charles Reitzel + * @date Updated 2002-07-01 by Charles Reitzel - 1st Implementation + * @date Updated 2015-06-09 by Geoff R. McLane - Add more doxygen syntax + * @date Updated 2017-03-22 by geoff - Need a pure text file for Win32 bin packages + * @date Additional updates: consult git log + ******************************************************************************/ From ce7b5cd55eaedf2b492d85bc16f0cc5384c91c5b Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Wed, 22 Mar 2017 04:11:32 +0100 Subject: [PATCH 2/5] Issue #515 - Add system DLLs to installers --- CMakeLists.txt | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 380ffc3..f9eb837 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -313,14 +313,24 @@ if (UNIX AND SUPPORT_CONSOLE_APP) endif () endif () -########################################################## -### Create MSI,EXE, DMG, DEB/RPM -### TODO: Check each of these builds -########################################################## set(BITNESS 32) if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(BITNESS 64) endif() + +########################################################## +### Create MSI,EXE, DMG, DEB/RPM +### TODO: Check each of these builds +########################################################## +# Need to ensure that system dlls get included in a binary distribution +if (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) + # Visual Studio Express does include redistributable components so + # squelch the warning. + set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) +endif () +set (CMAKE_INSTALL_DEBUG_LIBRARIES ON) +include (InstallRequiredSystemLibraries) +########################################################## if (WIN32) # MSI - this needs WiX Tooset installed and a path to candle.exe # EXE - this needs NSIS tools to be in path @@ -345,8 +355,11 @@ set(CPACK_PACKAGE_VERSION_MAJOR "${TIDY_MAJOR_VERSION}") set(CPACK_PACKAGE_VERSION_MINOR "${TIDY_MINOR_VERSION}") set(CPACK_PACKAGE_VERSION_PATCH "${TIDY_POINT_VERSION}") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README/README.html") - -set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README/LICENSE.md") +if (WIN32) + set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README/LICENSE.txt") +else () + set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README/LICENSE.md") +endif () set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README/README.html") set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/README/README.html") @@ -355,6 +368,9 @@ set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT}) set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.html-tidy.org/") #set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc") set(CPACK_DEBIAN_PACKAGE_SECTION "Libraries") +set(CPACK_SOURCE_IGNORE_FILES + "${PROJECT_SOURCE_DIR}/build" + ) ## RPM config set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/man" "/usr/share/man/man1") From 5416bfb8ae2023ea76429b1e8740222ec7114d2a Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Thu, 23 Mar 2017 14:53:44 +0100 Subject: [PATCH 3/5] Issue #515 - Add option to use MSVC statis runtime /MT --- CMakeLists.txt | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f9eb837..6cd778a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,6 +103,27 @@ set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} ${MSVC_FLAGS} -D_REENTRANT set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} ${MSVC_FLAGS} -D_REENTRANT" ) set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MSVC_LD_FLAGS}" ) +# option to use static windows runtime - maybe only applies to WIN32/MSVC +if (MSVC) + option( USE_STATIC_RUNTIME "Set ON to change /MD(DLL) to /MT(static)" OFF ) + if (USE_STATIC_RUNTIME) + set(CompilerFlags + CMAKE_CXX_FLAGS + CMAKE_CXX_FLAGS_DEBUG + CMAKE_CXX_FLAGS_RELEASE + CMAKE_C_FLAGS + CMAKE_C_FLAGS_DEBUG + CMAKE_C_FLAGS_RELEASE + ) + foreach(CompilerFlag ${CompilerFlags}) + string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}") + endforeach() + message(STATUS "Using /MT STATIC runtime") + else () + message(STATUS "Using /MD DYNAMIC runtime") + endif () +endif () + add_definitions ( -DHAVE_CONFIG_H ) add_definitions ( -DSUPPORT_UTF16_ENCODINGS=1 ) add_definitions ( -DSUPPORT_ASIAN_ENCODINGS=1 ) @@ -328,7 +349,7 @@ if (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) # squelch the warning. set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) endif () -set (CMAKE_INSTALL_DEBUG_LIBRARIES ON) +set (CMAKE_INSTALL_DEBUG_LIBRARIES OFF) include (InstallRequiredSystemLibraries) ########################################################## if (WIN32) From 25f51604d0256bcea07e941f098b566839cfd391 Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Thu, 23 Mar 2017 15:05:05 +0100 Subject: [PATCH 4/5] Use one compatible license file for all --- CMakeLists.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6cd778a..6b9ff75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -376,11 +376,8 @@ set(CPACK_PACKAGE_VERSION_MAJOR "${TIDY_MAJOR_VERSION}") set(CPACK_PACKAGE_VERSION_MINOR "${TIDY_MINOR_VERSION}") set(CPACK_PACKAGE_VERSION_PATCH "${TIDY_POINT_VERSION}") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README/README.html") -if (WIN32) - set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README/LICENSE.txt") -else () - set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README/LICENSE.md") -endif () +# use one compatible license file for all +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README/LICENSE.txt") set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README/README.html") set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/README/README.html") From 22bc8da5838c71432ecca1ac6188e6be56eb226b Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Thu, 23 Mar 2017 15:13:28 +0100 Subject: [PATCH 5/5] Since CPack can miss some system DLLs, make option ADD_SYSTEM_RUNTIMES, def OFF --- CMakeLists.txt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b9ff75..862ca31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -344,13 +344,17 @@ endif() ### TODO: Check each of these builds ########################################################## # Need to ensure that system dlls get included in a binary distribution -if (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) - # Visual Studio Express does include redistributable components so - # squelch the warning. - set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) -endif () -set (CMAKE_INSTALL_DEBUG_LIBRARIES OFF) -include (InstallRequiredSystemLibraries) +# But since it can miss some... seems incomplete, make optionional +option( ADD_SYSTEM_RUNTIMES "Set ON to include system runtime DLLS in distribution" OFF ) +if (MSVC AND ADD_SYSTEM_RUNTIMES) + if (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) + # Visual Studio Express does include redistributable components so + # squelch the warning. + set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) + endif () + set (CMAKE_INSTALL_DEBUG_LIBRARIES OFF) + include (InstallRequiredSystemLibraries) +endif () ########################################################## if (WIN32) # MSI - this needs WiX Tooset installed and a path to candle.exe