tidy-html5/CMakeLists.txt

371 lines
14 KiB
CMake
Raw Normal View History

2015-04-02 11:17:14 +00:00
# CMakeLists.txt - 20150402 - 20150130 - 20140801 - for github htacg/tidy-html5
# Prepare for changing the name to 'tidy'
2015-12-22 23:51:01 +00:00
cmake_minimum_required (VERSION 2.8.7)
2014-08-03 18:08:57 +00:00
set(LIB_NAME tidy)
2015-04-02 11:17:14 +00:00
project (${LIB_NAME})
2014-08-03 18:08:57 +00:00
2015-01-29 17:25:57 +00:00
# ### NOTE: *** Adjust version.txt when required ***
# read 'version' file into a variable (stripping any newlines or spaces)
# 20150609: Revert to supplying BOTH version and date, as we had back in Jan 2015
# NOTE: Both version and date MUST be DOT separated, in two lines.
2015-01-29 17:25:57 +00:00
file(READ version.txt versionFile)
if (NOT versionFile)
message(FATAL_ERROR "Unable to determine libtidy version. version.txt file is missing.")
endif()
string(STRIP "${versionFile}" VERSION_TEXT)
string(REGEX REPLACE "(.*)[\r\n|\n](.*)" "\\1" LIBTIDY_VERSION ${VERSION_TEXT})
string(REGEX REPLACE "(.*)[\r\n|\n](.*)" "\\2" LIBTIDY_DATE ${VERSION_TEXT})
# establish version number
if (LIBTIDY_VERSION)
string(REPLACE "." ";" VERSION_LIST ${LIBTIDY_VERSION})
list(GET VERSION_LIST 0 TIDY_MAJOR_VERSION)
list(GET VERSION_LIST 1 TIDY_MINOR_VERSION)
list(GET VERSION_LIST 2 TIDY_POINT_VERSION)
else ()
message(FATAL_ERROR "*** FAILED to get a VERSION from version.txt!")
endif ()
# establish version date
if (LIBTIDY_DATE)
string(REPLACE "." ";" DATE_LIST ${LIBTIDY_DATE})
list(GET DATE_LIST 0 tidy_YEAR)
list(GET DATE_LIST 1 tidy_MONTH)
list(GET DATE_LIST 2 tidy_DAY)
else ()
message(FATAL_ERROR "*** FAILED to get a DATE from version.txt!")
endif ()
# By default, BOTH library types built, Allow turning OFF shared if not needed
set( LIB_TYPE STATIC ) # set default message
option( BUILD_SHARED_LIB "Set OFF to NOT build shared library" ON )
2015-01-28 16:15:44 +00:00
option( BUILD_TAB2SPACE "Set ON to build utility app, tab2space" OFF )
option( BUILD_SAMPLE_CODE "Set ON to build the sample code" OFF )
if (NOT MAN_INSTALL_DIR)
set(MAN_INSTALL_DIR share/man/man1)
endif ()
# Issue #326 - Allow linkage choice of console app tidy
option( TIDY_CONSOLE_SHARED "Set ON to link with shared(DLL) lib." OFF )
if (TIDY_CONSOLE_SHARED)
if (NOT BUILD_SHARED_LIB)
message(FATAL_ERROR "Enable shared build for this tidy linkage!")
endif ()
endif ()
2014-08-03 18:08:57 +00:00
# Allow building without extra language support
option( SUPPORT_LOCALIZATIONS "Set OFF to build without additional languages." ON )
if (SUPPORT_LOCALIZATIONS)
add_definitions ( -DSUPPORT_LOCALIZATIONS=1 )
else ()
add_definitions ( -DSUPPORT_LOCALIZATIONS=0 )
endif ()
Several foundational changes preparing for release of 5.4 and future 5.5: - Consolidated all output string definitions enums into `tidyenum.h`, which is where they belong, and where they have proper visibility. - Re-arranged `messages.c/h` with several comments useful to developers. - Properly added the key lookup functions and the language localization functions into tidy.h/tidylib.c with proper name-spacing. - Previous point restored a *lot* of sanity to the #include pollution that's been introduced in light of these. - Note that opaque types have been (properly) introduced. Look at the updated headers for `language.h`. In particular only an opaque structure is passed outside of LibTidy, and so use TidyLangWindowsName and TidyLangPosixName to poll these objects. - Console application updated as a result of this. - Removed dead code: - void TY_(UnknownOption)( TidyDocImpl* doc, char c ); - void TY_(UnknownFile)( TidyDocImpl* doc, ctmbstr program, ctmbstr file ); - Redundant strings were removed with the removal of this dead code. - Several enums were given fixed starting values. YOUR PROGRAMS SHOULD NEVER depend on enum values. `TidyReportLevel` is an example of such. - Some enums were removed as a result of this. `TidyReportLevel` now has matching strings, so the redundant `TidyReportLevelStrings` was removed. - All of the PO's and language header files were regenerated as a result of the string cleanup and header cleanup. - Made the interface to the library version and release date consistent. - CMakeLists.txt now supports SUPPORT_CONSOLE_APP. The intention is to be able to remove console-only code from LibTidy (for LibTidy users). - Updated README/MESSAGES.md, which is *vastly* more simple now.
2017-02-13 19:29:47 +00:00
# Allow building without console support, which mostly prevents console strings
# from existing in the library. Note that this will prevent the console
# application from being built, since it can't be linked.
option( SUPPORT_CONSOLE_APP "Set OFF to libraries only without console application support." ON )
if (SUPPORT_CONSOLE_APP)
add_definitions ( -DSUPPORT_CONSOLE_APP=1 )
else ()
add_definitions ( -DSUPPORT_CONSOLE_APP=0 )
endif ()
2014-08-03 18:08:57 +00:00
if(CMAKE_COMPILER_IS_GNUCXX)
set( WARNING_FLAGS -Wall )
endif(CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set( WARNING_FLAGS "-Wall -Wno-overloaded-virtual" )
endif()
if(WIN32 AND MSVC)
# turn off various warnings
set(WARNING_FLAGS "${WARNING_FLAGS} /wd4996")
# C4090: 'function' : different 'const' qualifiers
2014-08-06 10:09:13 +00:00
# C4244: '=' : conversion from '__int64' to 'uint', possible loss of data
# C4267: 'function' : conversion from 'size_t' to 'uint', possible loss of data
2014-08-03 18:08:57 +00:00
# foreach(warning 4244 4251 4267 4275 4290 4786 4305)
2014-08-06 10:09:13 +00:00
foreach(warning 4090 4244 4267)
2014-08-03 18:08:57 +00:00
set(WARNING_FLAGS "${WARNING_FLAGS} /wd${warning}")
endforeach()
set( MSVC_FLAGS "-DNOMINMAX -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS" )
# if (${MSVC_VERSION} EQUAL 1600)
# set( MSVC_LD_FLAGS "/FORCE:MULTIPLE" )
# endif (${MSVC_VERSION} EQUAL 1600)
2015-01-20 17:09:01 +00:00
# set( NOMINMAX 1 )
# to distinguish between debug and release lib in windows
set( CMAKE_DEBUG_POSTFIX "d" ) # little effect in unix
2014-08-03 18:08:57 +00:00
else()
2014-08-06 10:09:13 +00:00
# add any gcc flags
2014-08-03 18:08:57 +00:00
endif()
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}" )
add_definitions ( -DHAVE_CONFIG_H )
add_definitions ( -DSUPPORT_UTF16_ENCODINGS=1 )
add_definitions ( -DSUPPORT_ASIAN_ENCODINGS=1 )
add_definitions ( -DSUPPORT_ACCESSIBILITY_CHECKS=1 )
2015-01-29 17:25:57 +00:00
add_definitions ( -DLIBTIDY_VERSION="${LIBTIDY_VERSION}" )
add_definitions ( -DRELEASE_DATE="${tidy_YEAR}/${tidy_MONTH}/${tidy_DAY}" )
if (TIDY_RC_NUMBER)
add_definitions ( -DRC_NUMBER="${TIDY_RC_NUMBER}" )
endif ()
2014-08-03 18:08:57 +00:00
# Issue #188 - Support user items in platform.h
if (TIDY_CONFIG_FILE)
add_definitions( -DTIDY_CONFIG_FILE="${TIDY_CONFIG_FILE}" )
endif ()
if (TIDY_USER_CONFIG_FILE)
add_definitions( -DTIDY_USER_CONFIG_FILE="${TIDY_USER_CONFIG_FILE}" )
endif ()
if (SUPPORT_GETPWNAM)
add_definitions( -DSUPPORT_GETPWNAM=1 )
endif ()
2014-08-03 18:08:57 +00:00
if(BUILD_SHARED_LIB)
set(LIB_TYPE SHARED)
message(STATUS "*** Also building DLL library ${LIB_TYPE}, version ${LIBTIDY_VERSION}, date ${LIBTIDY_DATE}")
else()
message(STATUS "*** Only building static library ${LIB_TYPE}, version ${LIBTIDY_VERSION}, date ${LIBTIDY_DATE}")
endif()
2014-08-03 18:08:57 +00:00
include_directories ( "${PROJECT_SOURCE_DIR}/include" "${PROJECT_SOURCE_DIR}/src" )
##############################################################################
### tidy library
# file locations
set ( SRCDIR src )
set ( INCDIR include )
# file lists
set ( CFILES
${SRCDIR}/access.c ${SRCDIR}/attrs.c ${SRCDIR}/istack.c
${SRCDIR}/parser.c ${SRCDIR}/tags.c ${SRCDIR}/entities.c
${SRCDIR}/lexer.c ${SRCDIR}/pprint.c ${SRCDIR}/charsets.c
${SRCDIR}/clean.c ${SRCDIR}/message.c ${SRCDIR}/config.c
${SRCDIR}/alloc.c ${SRCDIR}/attrapi.c ${SRCDIR}/attrdict.c
2014-08-03 18:08:57 +00:00
${SRCDIR}/buffio.c ${SRCDIR}/fileio.c ${SRCDIR}/streamio.c
${SRCDIR}/tagask.c ${SRCDIR}/tmbstr.c ${SRCDIR}/utf8.c
${SRCDIR}/tidylib.c ${SRCDIR}/mappedio.c ${SRCDIR}/gdoc.c
Massive Revamp of the Messaging System This is a rather large refactoring of Tidy's messaging system. This was done mostly to allow non-C libraries that cannot adequately take advantage of arg_lists a chance to query report filter information for information related to arguments used in constructing an error message. Three main goals were in mind for this project: - Don't change the contents of Tidy's existing output sinks. This will ensure that changes do no affect console Tidy users, or LibTidy users who use the output sinks directly. This was accomplished 100% other than some improved cosmetics in the output. See tidy-html5-tests repository, the `refactor` and `more_messages_changes` branches for these minor diffs. - Provide an API that is simple and also extensible without having to write new error filters all the time. This was accomplished by adding the new message callback `TidyMessageCallback` that provides callback functions an opaque object representing the message, and an API to query the message for wanted details. With this, we should never have to add a new callback routine again, as additional API can simply be written against the opaque object. - The API should work the same as the rest of LibTidy's API in that it's consistent and only uses simple types with wide interoperability with other languages. Thanks to @gagern who suggested the model for the API in #409. Although the API uses the "Tidy" way off accessing data via an iterator rather than an index, this can be easily abstracted in the target language. There are two *major* API breaking changes: - Removed TidyReportFilter2 - This was only used by one application in the entire world, and was a hacky kludge that served its purpose. TidyReportCallback (né TidyReportFilter3) is much better. If, for some reason, this affects you, I recommend using TidyReportCallback instead. It's a minor change for your application. - Renamed TidyReportFilter3 to TidyReportCallback - This name is much more semantic, and much more sensible in light of improved callback system. As the name implies, it remains capable of *only* receiving callbacks for Tidy "reports." Introducing TidyMessageCallback, and a new message interrogation API. - As its name implies, it is able to capture (and optionally suppress) *all* of Tidy's output, including the dialogue messages that never make it to the existing report filters. - Provides an opaque `TidyMessage` and an API that can be used to query against it to find the juicy goodness inside. - For example, `tidyGetMessageOutput( tmessage )` will return the complete, localized message. - Another example, `tidyGetMessageLine( tmessage )` will return the line the message applies to. - You can also get information about the individual arguments that make up a message. By using the `tidyGetMessageArguments( tmessage )` itorator and `tidyGetNextMessageArgument` you will obtain an opaque `TidyMessageArgument` which has its own interrogation API. For example: - tidyGetArgType( tmessage, &iterator ); - tidyGetArgFormat( tmessage, &iterator ); - tidyGetArgValueString( tmessage, &iterator ); - …and so on. Other major changes include refactoring `messages.c` to use the new message "object" directly when emitting messages to the console or output sinks. This allowed replacement of a lot of specialized functions with generalized ones. Some of this generalizing involved modifications to the `language_xx.h` header files, and these are all positive improvements even without the above changes.
2017-03-13 17:28:57 +00:00
${SRCDIR}/language.c ${SRCDIR}/messageobj.c )
2014-08-03 18:08:57 +00:00
set ( HFILES
${INCDIR}/tidyplatform.h ${INCDIR}/tidy.h ${INCDIR}/tidyenum.h
${INCDIR}/tidybuffio.h )
option (TIDY_COMPAT_HEADERS "If set to ON, compatability headers are included" OFF)
if (TIDY_COMPAT_HEADERS)
set ( HFILES ${HFILES} ${INCDIR}/buffio.h ${INCDIR}/platform.h )
endif ()
2014-08-03 18:08:57 +00:00
set ( LIBHFILES
${SRCDIR}/access.h ${SRCDIR}/attrs.h ${SRCDIR}/attrdict.h ${SRCDIR}/charsets.h
${SRCDIR}/clean.h ${SRCDIR}/config.h ${SRCDIR}/entities.h
${SRCDIR}/fileio.h ${SRCDIR}/forward.h ${SRCDIR}/lexer.h
${SRCDIR}/mappedio.h ${SRCDIR}/message.h ${SRCDIR}/parser.h
${SRCDIR}/pprint.h ${SRCDIR}/streamio.h ${SRCDIR}/tags.h
${SRCDIR}/tmbstr.h ${SRCDIR}/utf8.h ${SRCDIR}/tidy-int.h
${SRCDIR}/version.h ${SRCDIR}/gdoc.h ${SRCDIR}/language.h
${SRCDIR}/language_en.h ${SRCDIR}/win32tc.h )
2014-08-03 18:08:57 +00:00
if (MSVC)
list(APPEND CFILES ${SRCDIR}/sprtf.c)
list(APPEND LIBHFILES ${SRCDIR}/sprtf.h)
endif ()
#######################################
if (NOT LIB_INSTALL_DIR)
set(LIB_INSTALL_DIR lib${LIB_SUFFIX})
endif ()
if (NOT BIN_INSTALL_DIR)
set(BIN_INSTALL_DIR bin)
endif ()
2015-11-13 19:19:10 +00:00
if (NOT INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR include)
endif ()
# Always build the STATIC library
set(name tidy-static)
add_library ( ${name} STATIC ${CFILES} ${HFILES} ${LIBHFILES} )
set_target_properties( ${name} PROPERTIES
OUTPUT_NAME ${LIB_NAME}s
)
if (NOT TIDY_CONSOLE_SHARED) # user wants default static linkage
list ( APPEND add_LIBS ${name} )
endif ()
2014-08-06 10:09:13 +00:00
install(TARGETS ${name}
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
)
2015-11-13 19:19:10 +00:00
install( FILES ${HFILES} DESTINATION ${INCLUDE_INSTALL_DIR} )
########################################
# if user option still on
if (BUILD_SHARED_LIB)
set(name tidy-share)
add_library ( ${name} SHARED ${CFILES} ${HFILES} ${LIBHFILES} )
set_target_properties( ${name} PROPERTIES
OUTPUT_NAME ${LIB_NAME} )
set_target_properties( ${name} PROPERTIES
VERSION ${LIBTIDY_VERSION}
SOVERSION ${TIDY_MAJOR_VERSION} )
set_target_properties( ${name} PROPERTIES
COMPILE_FLAGS "-DBUILD_SHARED_LIB" )
set_target_properties( ${name} PROPERTIES
COMPILE_FLAGS "-DBUILDING_SHARED_LIB" )
install(TARGETS ${name}
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
)
if (TIDY_CONSOLE_SHARED) # user wants shared/dll linkage
list ( APPEND add_LIBS ${name} )
endif ()
endif ()
2014-08-03 18:08:57 +00:00
##########################################################
### main executable - linked with STATIC/SHARED library
Several foundational changes preparing for release of 5.4 and future 5.5: - Consolidated all output string definitions enums into `tidyenum.h`, which is where they belong, and where they have proper visibility. - Re-arranged `messages.c/h` with several comments useful to developers. - Properly added the key lookup functions and the language localization functions into tidy.h/tidylib.c with proper name-spacing. - Previous point restored a *lot* of sanity to the #include pollution that's been introduced in light of these. - Note that opaque types have been (properly) introduced. Look at the updated headers for `language.h`. In particular only an opaque structure is passed outside of LibTidy, and so use TidyLangWindowsName and TidyLangPosixName to poll these objects. - Console application updated as a result of this. - Removed dead code: - void TY_(UnknownOption)( TidyDocImpl* doc, char c ); - void TY_(UnknownFile)( TidyDocImpl* doc, ctmbstr program, ctmbstr file ); - Redundant strings were removed with the removal of this dead code. - Several enums were given fixed starting values. YOUR PROGRAMS SHOULD NEVER depend on enum values. `TidyReportLevel` is an example of such. - Some enums were removed as a result of this. `TidyReportLevel` now has matching strings, so the redundant `TidyReportLevelStrings` was removed. - All of the PO's and language header files were regenerated as a result of the string cleanup and header cleanup. - Made the interface to the library version and release date consistent. - CMakeLists.txt now supports SUPPORT_CONSOLE_APP. The intention is to be able to remove console-only code from LibTidy (for LibTidy users). - Updated README/MESSAGES.md, which is *vastly* more simple now.
2017-02-13 19:29:47 +00:00
if (SUPPORT_CONSOLE_APP)
set(name ${LIB_NAME})
set ( BINDIR console )
add_executable( ${name} ${BINDIR}/tidy.c )
target_link_libraries( ${name} ${add_LIBS} )
if (MSVC)
set_target_properties( ${name} PROPERTIES DEBUG_POSTFIX d )
endif ()
if (NOT TIDY_CONSOLE_SHARED)
set_target_properties( ${name} PROPERTIES
COMPILE_FLAGS "-DTIDY_STATIC" )
endif ()
install (TARGETS ${name} DESTINATION bin)
endif ()
2014-08-03 18:08:57 +00:00
2015-01-28 16:15:44 +00:00
if (BUILD_TAB2SPACE)
set(name tab2space)
add_executable( ${name} ${BINDIR}/tab2space.c )
if (MSVC)
set_target_properties( ${name} PROPERTIES DEBUG_POSTFIX d )
endif ()
# no INSTALL of this 'local' tool - use depreciated
2014-08-03 18:08:57 +00:00
endif ()
if (BUILD_SAMPLE_CODE)
set(name test71)
set(dir console)
add_executable( ${name} ${dir}/${name}.cxx )
if (MSVC)
set_target_properties( ${name} PROPERTIES DEBUG_POSTFIX d )
endif ()
target_link_libraries( ${name} ${add_LIBS} )
# no INSTALL of this 'local' sample
endif ()
2015-03-07 22:08:39 +00:00
#==========================================================
# Create man pages
#==========================================================
Several foundational changes preparing for release of 5.4 and future 5.5: - Consolidated all output string definitions enums into `tidyenum.h`, which is where they belong, and where they have proper visibility. - Re-arranged `messages.c/h` with several comments useful to developers. - Properly added the key lookup functions and the language localization functions into tidy.h/tidylib.c with proper name-spacing. - Previous point restored a *lot* of sanity to the #include pollution that's been introduced in light of these. - Note that opaque types have been (properly) introduced. Look at the updated headers for `language.h`. In particular only an opaque structure is passed outside of LibTidy, and so use TidyLangWindowsName and TidyLangPosixName to poll these objects. - Console application updated as a result of this. - Removed dead code: - void TY_(UnknownOption)( TidyDocImpl* doc, char c ); - void TY_(UnknownFile)( TidyDocImpl* doc, ctmbstr program, ctmbstr file ); - Redundant strings were removed with the removal of this dead code. - Several enums were given fixed starting values. YOUR PROGRAMS SHOULD NEVER depend on enum values. `TidyReportLevel` is an example of such. - Some enums were removed as a result of this. `TidyReportLevel` now has matching strings, so the redundant `TidyReportLevelStrings` was removed. - All of the PO's and language header files were regenerated as a result of the string cleanup and header cleanup. - Made the interface to the library version and release date consistent. - CMakeLists.txt now supports SUPPORT_CONSOLE_APP. The intention is to be able to remove console-only code from LibTidy (for LibTidy users). - Updated README/MESSAGES.md, which is *vastly* more simple now.
2017-02-13 19:29:47 +00:00
if (UNIX AND SUPPORT_CONSOLE_APP)
2015-03-07 22:08:39 +00:00
find_program( XSLTPROC_FOUND xsltproc )
if (XSLTPROC_FOUND)
2015-04-02 11:17:14 +00:00
## NOTE: man name must match exe ie currently `${LIB_NAME}.1` not `tidy.1`
2015-03-07 22:11:51 +00:00
## also could use `manpath` command output to determine target install path
2015-04-02 11:17:14 +00:00
set(TIDY_MANFILE ${LIB_NAME}.1)
message(STATUS "*** Generating man ${TIDY_MANFILE} custom commands...")
set(TIDY1XSL ${CMAKE_CURRENT_BINARY_DIR}/tidy1.xsl)
2015-09-29 21:39:08 +00:00
set(TIDYHELP ${CMAKE_CURRENT_BINARY_DIR}/tidy-help.xml)
set(TIDYCONFIG ${CMAKE_CURRENT_BINARY_DIR}/tidy-config.xml)
add_custom_target(man ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/man/tidy1.xsl.in
${TIDY1XSL}
)
2015-03-08 05:39:46 +00:00
2015-03-07 22:08:39 +00:00
# run built EXE to generate xml output
add_custom_command(
2015-03-08 05:39:46 +00:00
TARGET man
2015-09-29 21:39:08 +00:00
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME} -xml-help > ${TIDYHELP}
2015-03-07 22:08:39 +00:00
COMMENT "Generate ${TIDYHELP}"
VERBATIM
2015-03-08 05:39:46 +00:00
)
2015-03-08 07:39:48 +00:00
# run built EXE to generate more xml output
add_custom_command(
TARGET man
2015-09-29 21:39:08 +00:00
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME} -xml-config > ${TIDYCONFIG}
2015-03-08 11:35:41 +00:00
COMMENT "Generate ${TIDYCONFIG}"
2015-03-08 07:39:48 +00:00
VERBATIM
)
2015-03-07 22:08:39 +00:00
# run xsltproc to generate the install files..
add_custom_command(
TARGET man
2015-03-08 05:39:46 +00:00
DEPENDS ${TIDYHELP}
2015-09-29 21:39:08 +00:00
COMMAND xsltproc ARGS ${TIDY1XSL} ${TIDYHELP} > ${CMAKE_CURRENT_BINARY_DIR}/${TIDY_MANFILE}
2015-03-08 05:39:46 +00:00
COMMENT "Generate ${TIDY_MANFILE}"
2015-03-07 22:08:39 +00:00
VERBATIM
)
2015-03-08 05:39:46 +00:00
2015-09-29 21:39:08 +00:00
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TIDY_MANFILE} DESTINATION ${MAN_INSTALL_DIR})
else ()
message(STATUS "*** NOTE: xsltproc NOT FOUND! Can NOT generate man page.")
message(STATUS "*** You need to install xsltproc in your system.")
2015-03-07 22:08:39 +00:00
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()
if (WIN32)
# MSI - this needs WiX Tooset installed and a path to candle.exe
# EXE - this needs NSIS tools to be in path
2015-03-20 12:56:20 +00:00
set(CPACK_GENERATOR "NSIS;WIX;ZIP")
set(CPACK_SOURCE_GENERATOR "ZIP")
set(CPACK_WIX_UPGRADE_GUID "D809598A-B513-4752-B268-0BAC403B00E4")
elseif ( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
set(CPACK_GENERATOR "PackageMake")
set(CPACK_SOURCE_GENERATOR "TGZ")
else ()
set(CPACK_GENERATOR "DEB;RPM")
set(CPACK_SOURCE_GENERATOR "TGZ")
endif ()
2015-04-02 11:17:14 +00:00
set(CPACK_PACKAGE_NAME "${LIB_NAME}")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${LIB_NAME} - HTML syntax checker")
set(CPACK_PACKAGE_VENDOR "HTML Tidy Advocacy Community Group")
set(CPACK_PACKAGE_CONTACT "maintainer@htacg.org")
set(CPACK_PACKAGE_VERSION ${LIBTIDY_VERSION})
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")
2016-07-11 18:40:20 +00:00
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README/LICENSE.md")
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README/README.html")
set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/README/README.html")
## debian config
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")
## RPM config
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/man" "/usr/share/man/man1")
2015-09-29 21:39:08 +00:00
set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/test/;${CMAKE_CURRENT_SOURCE_DIR}/build/;${CMAKE_CURRENT_SOURCE_DIR}/.git/")
if (NOT WIN32 AND NOT APPLE)
2015-04-02 11:17:14 +00:00
set( CPACK_PACKAGE_FILE_NAME "${LIB_NAME}-${CPACK_PACKAGE_VERSION}-${BITNESS}bit" )
endif ()
include(CPack)
2015-01-24 12:14:12 +00:00
# eof