From ae1f863b8713dffcd36cfb6252fbb4088e6af56c Mon Sep 17 00:00:00 2001 From: Andrey Zelenchuk Date: Fri, 26 Feb 2021 00:36:56 +0700 Subject: [PATCH] Install: add `-DLIBVERSION_STATIC_DEFINE` to `Cflags` in the pkg-config file on Windows. --- libversion/CMakeLists.txt | 3 +++ libversion/libversion.pc.in | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libversion/CMakeLists.txt b/libversion/CMakeLists.txt index fd063a8..16e3e2a 100644 --- a/libversion/CMakeLists.txt +++ b/libversion/CMakeLists.txt @@ -68,6 +68,9 @@ target_compile_definitions(libversion_object PUBLIC ) # pkgconfig file +if(WIN32) + set(EXTRA_CFLAGS "-DLIBVERSION_STATIC_DEFINE") +endif() configure_file(libversion.pc.in libversion.pc @ONLY) # installation diff --git a/libversion/libversion.pc.in b/libversion/libversion.pc.in index 99dfda2..19eebd5 100644 --- a/libversion/libversion.pc.in +++ b/libversion/libversion.pc.in @@ -7,5 +7,5 @@ Name: libversion Description: Version comparison library Version: @libversion_VERSION@ Libs: -L${libdir} -lversion -Cflags: -I${includedir} +Cflags: -I${includedir} @EXTRA_CFLAGS@ Cflags.private: -DLIBVERSION_STATIC_DEFINE