project(libjpeg-turbo C)
set(VERSION 1.4.90)
+string(REPLACE "." ";" VERSION_TRIPLET ${VERSION})
+list(GET VERSION_TRIPLET 0 VERSION_MAJOR)
+list(GET VERSION_TRIPLET 1 VERSION_MINOR)
+list(GET VERSION_TRIPLET 2 VERSION_REVISION)
+function(pad_number NUMBER OUTPUT_LEN)
+ string(LENGTH "${${NUMBER}}" INPUT_LEN)
+ if(INPUT_LEN LESS OUTPUT_LEN)
+ math(EXPR ZEROES "${OUTPUT_LEN} - ${INPUT_LEN} - 1")
+ set(NUM ${${NUMBER}})
+ foreach(C RANGE ${ZEROES})
+ set(NUM "0${NUM}")
+ endforeach()
+ set(${NUMBER} ${NUM} PARENT_SCOPE)
+ endif()
+endfunction()
+pad_number(VERSION_MINOR 3)
+pad_number(VERSION_REVISION 3)
+set(LIBJPEG_TURBO_VERSION_NUMBER ${VERSION_MAJOR}${VERSION_MINOR}${VERSION_REVISION})
if(NOT WIN32)
message(FATAL_ERROR "Platform not supported by this build system. Use autotools instead.")
AC_DEFINE_UNQUOTED(LIBJPEG_TURBO_VERSION, [$VERSION], [libjpeg-turbo version])
+m4_define(version_triplet,m4_split(AC_PACKAGE_VERSION,[[.]]))
+m4_define(version_major,m4_argn(1,version_triplet))
+m4_define(version_minor,m4_argn(2,version_triplet))
+m4_define(version_revision,m4_argn(3,version_triplet))
+VERSION_MAJOR=version_major
+VERSION_MINOR=version_minor
+VERSION_REVISION=version_revision
+LIBJPEG_TURBO_VERSION_NUMBER=`printf "%d%03d%03d" $VERSION_MAJOR $VERSION_MINOR $VERSION_REVISION`
+AC_DEFINE_UNQUOTED(LIBJPEG_TURBO_VERSION_NUMBER, [$LIBJPEG_TURBO_VERSION_NUMBER], [libjpeg-turbo version in integer form])
+
VERSION_SCRIPT=yes
AC_ARG_ENABLE([ld-version-script],
AS_HELP_STRING([--disable-ld-version-script],
/* libjpeg-turbo version */
#define LIBJPEG_TURBO_VERSION 0
+/* libjpeg-turbo version in integer form */
+#define LIBJPEG_TURBO_VERSION_NUMBER 0
+
/* Support arithmetic encoding */
#undef C_ARITH_CODING_SUPPORTED
#define JPEG_LIB_VERSION @JPEG_LIB_VERSION@
#define LIBJPEG_TURBO_VERSION @VERSION@
+#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@
#cmakedefine C_ARITH_CODING_SUPPORTED
#cmakedefine D_ARITH_CODING_SUPPORTED
#cmakedefine MEM_SRCDST_SUPPORTED