vcpkg/ports/zimpl/msvc.diff

45 lines
1.5 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4631864..080285c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,7 @@ project(ZIMPL
VERSION 3.7.1
LANGUAGES C)
-if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT WIN32)
# if changing these flags, also update GCCWARN/GXXWARN in make/make.project
if((CMAKE_C_COMPILER_ID MATCHES "GNU") OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))
set(ADD_C_FLAGS -Wall -Wextra -Wno-unknown-pragmas -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-noreturn -Wmissing-declarations -fno-omit-frame-pointer)
@@ -117,7 +117,6 @@ if(MSVC)
)
foreach(variable ${variables})
- string(REGEX REPLACE "/M[T,D][ d]" "" ${variable} "${${variable}}")
# message("${variable} = ${${variable}}")
endforeach()
endif()
@@ -137,7 +136,8 @@ endif()
if(MSVC)
# look for pcre if Windows
- find_package(PCRE)
+ find_package(PCRE NAMES pcre2 REQUIRED)
+ set(PCRE_LIBRARIES "$<TARGET_NAME:PCRE2::POSIX>")
if(PCRE_FOUND)
add_definitions(-DWITH_PCRE)
add_definitions(-DPCRE2_STATIC)
diff --git a/zimpl-config.cmake.in b/zimpl-config.cmake.in
index b653f0c..946f6f2 100644
--- a/zimpl-config.cmake.in
+++ b/zimpl-config.cmake.in
@@ -1,3 +1,8 @@
+if(WIN32)
+ include(CMakeFindDependencyMacro)
+ find_dependency(pcre2)
+endif()
+
if(NOT TARGET libzimpl)
include("${CMAKE_CURRENT_LIST_DIR}/zimpl-targets.cmake")
endif()