diff --git a/CMakeLists.txt b/CMakeLists.txt index 518c959a..c2331e25 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -319,6 +319,11 @@ else(HAVE_SUBUNIT) endif (HAVE_SUBUNIT) if (NOT ENABLE_REGEX AND WITH_PCREPOSIX) + find_package(PCREPOSIX) + if (PCREPOSIX_FOUND) + include_directories(${PCREPOSIX_INCLUDE_DIRS}) + link_directories(${PCREPOSIX_LIBRARY_DIRS}) + endif() # pcreposix functions are just wrappers for pcre functions check_library_exists(pcreposix regcomp "" HAVE_LIBPCREPOSIX) if (HAVE_LIBPCREPOSIX) diff --git a/appveyor.yml b/appveyor.yml index 0ec681cf..f9473c2e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,11 +21,11 @@ version: 1.0.{build} environment: matrix: - - platform: msvc - - platform: vs - - platform: cygwin +# - platform: msvc +# - platform: vs +# - platform: cygwin - platform: mingw32 - - platform: mingw64msys +# - platform: mingw64msys # scripts that are called at very beginning, before repo cloning # init: @@ -58,6 +58,8 @@ before_build: - if %platform%==cygwin bash -c "./configure" - if %platform%==mingw32 set PATH=C:\MinGW\bin;%PATH% - if %platform%==mingw32 appveyor-retry nuget install pcre -Verbosity detailed -OutputDirectory C:\pcre + - ps: Get-ChildItem -Recurse C:\pcre + - set CMAKE_PREFIX_PATH=C:\pcre\pcre.8.33.0.1\build\native - if %platform%==mingw32 cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=%P% - if %platform%==mingw64msys set PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH% - if %platform%==mingw64msys bash -c "autoreconf -i" diff --git a/cmake/FindPCREPOSIX.cmake b/cmake/FindPCREPOSIX.cmake new file mode 100644 index 00000000..f0f6ac57 --- /dev/null +++ b/cmake/FindPCREPOSIX.cmake @@ -0,0 +1,21 @@ +include(FindPackageHandleStandardArgs) + +find_path(PCREPOSIX_INCLUDE_DIR NAMES pcreposix.h) +find_library(PCREPOSIX_LIBRARY NAMES pcreposix) +find_library(PCRE_LIBRARY NAMES pcre) + +message("PCREPOSIX_LIBRARY: ${PCREPOSIX_LIBRARY}") +message("PCRE_LIBRARY: ${PCRE_LIBRARY}") + +find_package_handle_standard_args(PCREPOSIX DEFAULT_MSG PCREPOSIX_LIBRARY PCREPOSIX_INCLUDE_DIR) + +if(PCREPOSIX_FOUND) + set(PCREPOSIX_LIBRARIES ${PCREPOSIX_LIBRARY}) + set(PCREPOSIX_INCLUDE_DIRS ${PCREPOSIX_INCLUDE_DIR}) +else() + set(PCREPOSIX_LIBRARIES) + set(PCREPOSIX_INCLUDE_DIRS) +endif() + +mark_as_advanced(PCREPOSIX_INCLUDE_DIRS PCREPOSIX_LIBRARIES) +