diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-11-26 12:09:12 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-11-26 12:09:12 +0000 |
commit | 92c6f988cf346f018579bf0fd27a7ef5d78756eb (patch) | |
tree | e6cc43432dccd8a0a712dda71d2493641b4c9baf /contrib | |
parent | 1370bc0b24ab10c43b1a15877f70ae7488d851c2 (diff) | |
download | rspamd-92c6f988cf346f018579bf0fd27a7ef5d78756eb.tar.gz rspamd-92c6f988cf346f018579bf0fd27a7ef5d78756eb.zip |
[Fix] Fix build with custom glib/gmime
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/lgpl/CMakeLists.txt | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/contrib/lgpl/CMakeLists.txt b/contrib/lgpl/CMakeLists.txt index 39191620a..7f418002d 100644 --- a/contrib/lgpl/CMakeLists.txt +++ b/contrib/lgpl/CMakeLists.txt @@ -1,23 +1,25 @@ # 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 ${RSPAMD_REQUIRED_LIBRARIES}) +IF(NOT GLIB_ROOT_DIR) + 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") - SET_TARGET_PROPERTIES(glibadditions PROPERTIES VERSION ${RSPAMD_VERSION}) + ADD_LIBRARY(glibadditions SHARED ${LIBGLIBSRC}) + SET_TARGET_PROPERTIES(glibadditions PROPERTIES COMPILE_FLAGS "-I${CMAKE_SOURCE_DIR}/contrib/lgpl") - 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") + TARGET_LINK_LIBRARIES(glibadditions ${RSPAMD_REQUIRED_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") +ENDIF() |