[evolution-data-server] Correct build when nss/nspr do not provide pkg-config files
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Correct build when nss/nspr do not provide pkg-config files
- Date: Tue, 21 Aug 2018 08:07:57 +0000 (UTC)
commit ce00713c25ce74df5b00a97a19628c04939e1095
Author: Milan Crha <mcrha redhat com>
Date: Tue Aug 21 10:06:08 2018 +0200
Correct build when nss/nspr do not provide pkg-config files
CMakeLists.txt | 8 ++++++++
cmake/modules/FindSMIME.cmake | 12 ++++++++++--
2 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc6096e84..4a3e8fbe5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -931,6 +931,14 @@ pkg_check_modules(CAMEL REQUIRED gio-2.0 gmodule-2.0 ${mozilla_nss} ${mozilla_ns
set(CAMEL_CFLAGS ${CAMEL_CFLAGS} ${KRB5_CFLAGS} ${MANUAL_NSS_CFLAGS} ${MANUAL_NSPR_CFLAGS} ${ICU_CFLAGS})
set(CAMEL_LDFLAGS ${CAMEL_LDFLAGS} -lz ${KRB5_LDFLAGS} ${MANUAL_NSS_LIBS} ${MANUAL_NSPR_LIBS} ${ICU_LDFLAGS})
+if(NOT (MANUAL_NSPR_INCLUDES STREQUAL ""))
+ list(APPEND CAMEL_INCLUDE_DIRS ${MANUAL_NSPR_INCLUDES})
+endif(NOT (MANUAL_NSPR_INCLUDES STREQUAL ""))
+
+if(NOT (MANUAL_NSS_INCLUDES STREQUAL ""))
+ list(APPEND CAMEL_INCLUDE_DIRS ${MANUAL_NSS_INCLUDES})
+endif(NOT (MANUAL_NSS_INCLUDES STREQUAL ""))
+
# ******************************
# libical tweaks, part II (re-using CALENDAR modules)
# ******************************
diff --git a/cmake/modules/FindSMIME.cmake b/cmake/modules/FindSMIME.cmake
index fb9f70720..0f284c26f 100644
--- a/cmake/modules/FindSMIME.cmake
+++ b/cmake/modules/FindSMIME.cmake
@@ -66,6 +66,8 @@ if(NOT (WITH_NSPR_INCLUDES STREQUAL ""))
set(CMAKE_REQUIRED_INCLUDES ${WITH_NSPR_INCLUDES})
endif(NOT (WITH_NSPR_INCLUDES STREQUAL ""))
+unset(_have_headers CACHE)
+
CHECK_INCLUDE_FILES("nspr.h;prio.h" _have_headers)
unset(CMAKE_REQUIRED_INCLUDES)
@@ -75,11 +77,13 @@ if(NOT _have_headers)
endif(NOT _have_headers)
set(MANUAL_NSPR_INCLUDES "${WITH_NSPR_INCLUDES}")
+string(STRIP ${MANUAL_NSPR_INCLUDES} MANUAL_NSPR_INCLUDES)
set(nsprlibs "-lplc4 -lplds4 -lnspr4")
set(CMAKE_REQUIRED_INCLUDES ${MANUAL_NSPR_INCLUDES})
set(CMAKE_REQUIRED_LIBRARIES ${nsprlibs})
+unset(_nsprlibs_okay CACHE)
CHECK_C_SOURCE_COMPILES("#include <prinit.h>
int main(void) { PR_Initialized(); return 0; }" _nsprlibs_okay)
unset(CMAKE_REQUIRED_INCLUDES)
@@ -96,6 +100,7 @@ if(NOT (WITH_NSPR_LIBS STREQUAL ""))
endif(NOT (WITH_NSPR_LIBS STREQUAL ""))
set(MANUAL_NSPR_LIBS "${MANUAL_NSPR_LIBS} ${nsprlibs}")
+string(STRIP ${MANUAL_NSPR_LIBS} MANUAL_NSPR_LIBS)
# *****************
# Check for NSS 3
@@ -119,12 +124,14 @@ if(NOT _have_headers)
message(FATAL_ERROR "NSS headers not found. Use -DWITH_NSS_INCLUDES=/path/to/nss to specify the
include dir of NSS.")
endif(NOT _have_headers)
-set(MANUAL_NSS_INCLUDES "${WITH_NSS_INCLUDES} ${MANUAL_NSPR_INCLUDES}")
+set(MANUAL_NSS_INCLUDES "${WITH_NSS_INCLUDES}")
+string(STRIP ${MANUAL_NSS_INCLUDES} MANUAL_NSS_INCLUDES)
set(nsslibs "-lssl3 -lsmime3 -lnss3")
-set(CMAKE_REQUIRED_INCLUDES ${MANUAL_NSS_INCLUDES})
+set(CMAKE_REQUIRED_INCLUDES ${MANUAL_NSS_INCLUDES} ${MANUAL_NSPR_INCLUDES})
set(CMAKE_REQUIRED_LIBRARIES ${nsslibs} ${nsprlibs})
+unset(_nsslibs_okay CACHE)
CHECK_C_SOURCE_COMPILES("#include <nss.h>
int main(void) { NSS_Init(\"\"); return 0; }" _nsslibs_okay)
unset(CMAKE_REQUIRED_INCLUDES)
@@ -142,6 +149,7 @@ if(NOT (WITH_NSS_LIBS STREQUAL ""))
endif(NOT (WITH_NSS_LIBS STREQUAL ""))
set(MANUAL_NSS_LIBS "${MANUAL_NSS_LIBS} ${nsslibs} ${MANUAL_NSPR_LIBS}")
+string(STRIP ${MANUAL_NSS_LIBS} MANUAL_NSS_LIBS)
if(MOZILLA_NSS_LIB_DIR STREQUAL "")
set(MOZILLA_NSS_LIB_DIR "${LIB_INSTALL_DIR}")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]