summaryrefslogtreecommitdiffstats
path: root/contrib/lgpl/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/lgpl/CMakeLists.txt')
-rw-r--r--contrib/lgpl/CMakeLists.txt24
1 files changed, 24 insertions, 0 deletions
diff --git a/contrib/lgpl/CMakeLists.txt b/contrib/lgpl/CMakeLists.txt
new file mode 100644
index 000000000..0973e2243
--- /dev/null
+++ b/contrib/lgpl/CMakeLists.txt
@@ -0,0 +1,24 @@
+# Hack for glib < 2.16
+IF(GLIB2_VERSION VERSION_LESS "2.16")
+ IF(GLIB2_VERSION VERSION_LESS "2.14")
+ SET(LIBGLIBSRC gregex.c gchecksum.c guniscript.c)
+ SET(GLIB_RE_COMPAT 1 PARENT_SCOPE)
+ SET(GLIB_UNISCRIPT_COMPAT 1 PARENT_SCOPE)
+ SET(GLIB_HASH_COMPAT 1 PARENT_SCOPE)
+ ELSE(GLIB2_VERSION VERSION_LESS "2.14")
+ SET(LIBGLIBSRC gchecksum.c)
+ ENDIF(GLIB2_VERSION VERSION_LESS "2.14")
+
+ ADD_LIBRARY(glibadditions SHARED ${LIBGLIBSRC})
+ SET_TARGET_PROPERTIES(glibadditions PROPERTIES COMPILE_FLAGS "-I${CMAKE_SOURCE_DIR}/contrib/lgpl")
+
+ TARGET_LINK_LIBRARIES(glibadditions ${CMAKE_REQUIRED_LIBRARIES})
+ TARGET_LINK_LIBRARIES(glibadditions ${GLIB2_LIBRARIES})
+
+ SET_TARGET_PROPERTIES(glibadditions PROPERTIES VERSION ${RSPAMD_VERSION})
+
+ INSTALL(TARGETS glibadditions LIBRARY PUBLIC_HEADER
+ LIBRARY DESTINATION lib
+ PUBLIC_HEADER DESTINATION include)
+ SET(GLIB_COMPAT 1 PARENT_SCOPE)
+ENDIF(GLIB2_VERSION VERSION_LESS "2.16")