summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorمهدي شينون (Mehdi Chinoune) <79349457+MehdiChinoune@users.noreply.github.com>2022-04-15 09:34:24 +0100
committerGitHub <noreply@github.com>2022-04-15 15:34:24 +0700
commit7efcf4f935d0466b6ada44bed62d729cd2cddbc4 (patch)
tree5d132d314594015b825095a4a1e7537de6dfafed /CMakeLists.txt
parent03495a4f95e325f8c7c1b5119c90032b7a52f3ae (diff)
downloadlibgd-7efcf4f935d0466b6ada44bed62d729cd2cddbc4.tar.gz
Some fixes for MINGW (#828)
* Enable webpng on MINGW * Detect GD version using cmake language * Use _aligned_malloc instead of posix_memalign on Windows * Include missing "errno.h" * Fix finding WEBP on MINGW * Fix finding XPM on MINGW * Use PkgConfig to find packages on MINGW * CI: Enable more options for MINGW
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 4 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 979d1cc..0f48851 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -86,10 +86,10 @@ if (USE_EXT_GD)
else (USE_EXT_GD)
MACRO(GV VER VAR)
- execute_process(
- COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/config/getver.sh ${VER}
- OUTPUT_VARIABLE ${VAR}
- )
+ file (STRINGS "src/gd.h" _VERSION_LINE REGEX "define[ ]+GD_${VER}_VERSION")
+ if ( _VERSION_LINE )
+ string ( REGEX REPLACE ".*define[ ]+GD_${VER}_VERSION[ ]+\"?([^ \"]*)\"?[ ]+.*" "\\1" ${VAR} "${_VERSION_LINE}" )
+ endif ()
ENDMACRO(GV)
GV(MAJOR GDLIB_MAJOR)