From db6f38bc1b73930f1da954525464cf1986f43a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 29 Apr 2022 15:21:04 +0200 Subject: New upstream version 6.9.8 --- CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 12 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 1944037..db6b0a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.1) project(oniguruma - VERSION 6.9.7 + VERSION 6.9.8 LANGUAGES C) set(PACKAGE onig) @@ -9,6 +9,8 @@ set(PACKAGE_VERSION ${PROJECT_VERSION}) option(BUILD_SHARED_LIBS "Build shared libraries" ON) option(ENABLE_POSIX_API "Include POSIX API" OFF) option(ENABLE_BINARY_COMPATIBLE_POSIX_API "Include Binary compatible POSIX API" OFF) +option(INSTALL_DOCUMENTATION "Install documentation" ON) +option(INSTALL_EXAMPLES "Install examples" OFF) if(MSVC) option(MSVC_STATIC_RUNTIME "Build with static runtime" OFF) endif() @@ -23,7 +25,6 @@ include(CheckSymbolExists) include(CheckTypeSize) include(TestBigEndian) -check_function_exists(alloca HAVE_ALLOCA) check_include_files(alloca.h HAVE_ALLOCA_H) check_include_files(stdint.h HAVE_STDINT_H) check_include_files(sys/times.h HAVE_SYS_TIMES_H) @@ -36,9 +37,13 @@ check_type_size(long SIZEOF_LONG) check_type_size("long long" SIZEOF_LONG_LONG) check_type_size("void*" SIZEOF_VOIDP) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) +if(HAVE_ALLOCA_H) + check_symbol_exists(alloca "alloca.h" HAVE_ALLOCA) +else() + check_symbol_exists(alloca "stdlib.h;malloc.h" HAVE_ALLOCA) +endif() -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/oniguruma.pc.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/oniguruma.pc @ONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) set(_SRCS src/regint.h src/regparse.h src/regenc.h src/st.h src/regerror.c src/regparse.c src/regext.c src/regcomp.c src/regexec.c @@ -135,7 +140,7 @@ set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake") set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets") set(namespace "${PROJECT_NAME}::") -# Include module with fuction 'write_basic_package_version_file' +# Include module with function 'write_basic_package_version_file' include(CMakePackageConfigHelpers) # Configure 'ConfigVersion.cmake' @@ -156,7 +161,7 @@ configure_package_config_file( ) # Targets: -# * /lib/libonig.a +# * /lib*/libonig.a # * header location after install: /include/ # * headers can be included by C code `#include ` install( @@ -176,15 +181,15 @@ install( ) # Config -# * /lib/cmake/oniguruma/onigurumaConfig.cmake -# * /lib/cmake/oniguruma/onigurumaConfigVersion.cmake +# * /lib*/cmake/oniguruma/onigurumaConfig.cmake +# * /lib*/cmake/oniguruma/onigurumaConfigVersion.cmake install( FILES "${project_config}" "${version_config}" DESTINATION "${config_install_dir}" ) # Config -# * /lib/cmake/oniguruma/onigurumaTargets.cmake +# * /lib*/cmake/oniguruma/onigurumaTargets.cmake install( EXPORT "${TARGETS_EXPORT_NAME}" NAMESPACE "${namespace}" @@ -192,16 +197,37 @@ install( ) # Documentation (uses onig not oniguruma for directory) +if(INSTALL_DOCUMENTATION) install(FILES doc/API doc/API.ja doc/RE doc/RE.ja doc/FAQ doc/FAQ.ja doc/CALLOUTS.BUILTIN doc/CALLOUTS.BUILTIN.ja doc/CALLOUTS.API doc/CALLOUTS.API.ja doc/UNICODE_PROPERTIES - DESTINATION "${CMAKE_INSTALL_DATADIR}/${PACKAGE}") + DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/${PACKAGE}") # Other files (uses onig not oniguruma for directory) install(FILES AUTHORS COPYING HISTORY README.md - DESTINATION "${CMAKE_INSTALL_DATADIR}/${PACKAGE}") + DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/${PACKAGE}") +endif() + +# Examples +if(INSTALL_EXAMPLES) +install(FILES sample/bug_fix.c sample/callback_each_match.c + sample/callout.c sample/count.c sample/crnl.c + sample/echo.c sample/encode.c sample/listcap.c + sample/names.c sample/posix.c sample/regset.c + sample/scan.c sample/simple.c sample/sql.c + sample/syntax.c sample/user_property.c + DESTINATION "${CMAKE_INSTALL_DATADIR}/examples/${PACKAGE}") +endif() # pkg-config + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/oniguruma.pc.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/oniguruma.pc @ONLY) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/onig-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/onig-config @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/oniguruma.pc - DESTINATION lib/pkgconfig) + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/onig-config + DESTINATION "${CMAKE_INSTALL_BINDIR}") -- cgit v1.2.3