celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [09/50] celix git commit: CELIX-237: Updated FindFFI to use pkg-config when available. Also tryin to build/test again
Date Tue, 27 Oct 2015 15:21:14 GMT
CELIX-237: Updated FindFFI to use pkg-config when available. Also tryin to build/test again


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/a6272090
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/a6272090
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/a6272090

Branch: refs/heads/feature/CELIX-230_Refactoring_of_the_shell_command_service
Commit: a6272090a42e467ab9e4277a7d189b7da9257f3a
Parents: 24d6d11
Author: Pepijn Noltes <pepijnnoltes@gmail.com>
Authored: Tue Oct 13 22:34:47 2015 +0200
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
Committed: Tue Oct 13 22:34:47 2015 +0200

----------------------------------------------------------------------
 .travis.yml         |  2 +-
 cmake/FindFFI.cmake | 27 +++++++++++++++------------
 2 files changed, 16 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/a6272090/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index f91ab76..5a86242 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,7 +22,7 @@ before_script:
 
 script:
     - cd build
-    - cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON
-DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON
-DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON
-DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON
-DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON
-DENABLE_TESTING=ON -DCMAKE_INSTALL_PREFIX=../install ..
+    - cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON
-DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON
-DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON
-DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON
-DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON
-DENABLE_TESTING=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON -DCMAKE_INSTALL_PREFIX=../install
..
     - make all && make deploy && make install-all
     - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/utils:`pwd`/framework && make
test ARGS="-V" && make coverage
 

http://git-wip-us.apache.org/repos/asf/celix/blob/a6272090/cmake/FindFFI.cmake
----------------------------------------------------------------------
diff --git a/cmake/FindFFI.cmake b/cmake/FindFFI.cmake
index 7fd04e4..15680b7 100644
--- a/cmake/FindFFI.cmake
+++ b/cmake/FindFFI.cmake
@@ -23,23 +23,26 @@
 #  FFI_INCLUDE_DIRS - The package include directories
 #  FFI_LIBRARIES - The libraries needed to use this package
 
-find_library(FFI_LIBRARY NAMES ffi
-             	PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr/local /opt/local ENV FFI_DIR
-             	PATH_SUFFIXES lib lib/x86_64-linux-gnu NO_DEFAULT_PATH)
+if (NOT WIN32)
+   # try using pkg-config to get the directories and then use these values
+   # in the find_path() and find_library() calls
+   find_package(PkgConfig QUIET)
+   PKG_CHECK_MODULES(PC_LIBFFI QUIET libffi)
+endif ()
 
-find_library(FFI_LIBRARY NAMES ffi
-             	PATH_SUFFIXES lib)
+mark_as_advanced(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY)
 
-#NOTE on OSX ffi.h from macport is located at /opt/local/lib/libffi-<version>/ffi.h

-#Using FFI_LIBRARY location as hint to find it
-find_path(FFI_INCLUDE_DIR ffi.h
-		HINTS /opt/local/lib/*
-        PATH_SUFFIXES include include/ffi) 
+find_library(FFI_LIBRARY NAMES ffi
+        PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr/local /opt/local
+        PATH_SUFFIXES lib
+        HINTS ${PC_LIBFFI_LIBDIR} ${PC_LIBFFI_LIBRARY_DIRS}
+)
 
 find_path(FFI_INCLUDE_DIR ffi.h
 		PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr /usr/local /opt/local 
-        PATH_SUFFIXES include include/ffi include/x86_64-linux-gnu) 
-
+        PATH_SUFFIXES include include/ffi
+        HINTS ${PC_LIBFFI_INCLUDEDIR} ${PC_LIBFFI_INCLUDE_DIRS}
+)
 
 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set FFI_FOUND to TRUE


Mime
View raw message