diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-11-17 18:23:32 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-12-16 07:59:36 -0800 |
commit | f60e86b19c6d785a91bc126ac587bf9f3ee87369 (patch) | |
tree | 0e8386ba9e76e24e2c0bb9b2f39fb2ce9557ae14 | |
parent | cef86356f5e4b84c89305de3de9e614a62d18884 (diff) | |
download | subsurface-f60e86b19c6d785a91bc126ac587bf9f3ee87369.tar.gz |
Move FTDI and Grantlee configuration out of CMakeLists.txt
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
-rw-r--r-- | CMakeLists.txt | 31 | ||||
-rw-r--r-- | cmake/Modules/FindLIBGIT2.cmake | 1 | ||||
-rw-r--r-- | cmake/Modules/HandleFindGrantlee.cmake | 15 | ||||
-rw-r--r-- | cmake/Modules/HandleFtdiSupport.cmake | 8 |
4 files changed, 30 insertions, 25 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c785bcde..e4f7b8581 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,9 @@ include(cmake/Modules/pkgconfig_helper.cmake) include(cmake/Modules/HandleFindGit2.cmake) include(cmake/Modules/HandleFindLibDiveComputer.cmake) include(cmake/Modules/HandleFindMarble.cmake) +include(cmake/Modules/HandleFindGrantlee.cmake) +include(cmake/Modules/HandleFtdiSupport.cmake) + pkg_config_library(LIBXML libxml-2.0 REQUIRED) pkg_config_library(LIBSQLITE3 sqlite3 REQUIRED) pkg_config_library(LIBXSLT libxslt REQUIRED) @@ -100,31 +103,9 @@ if(SMARTTRAK_IMPORT) pkg_config_library(LIBMDB libmdb REQUIRED) endif() -if(FTDISUPPORT) - message(STATUS "building with libftdi support") - pkg_config_library(LIBFTDI libftdi QUIET) - if (NOT LIBFTDI_FOUND) - pkg_config_library(LIBFTDI libftdi1 REQUIRED) - endif() - add_definitions(-DSERIAL_FTDI) -endif() - -# setup Grantlee - -if(NO_PRINTING) - message(STATUS "building without printing support") - add_definitions(-DNO_PRINTING) - set(GRANTLEE_LIBRARIES "") -else() - if(LIBGRANTLEE_FROM_PKGCONFIG) - pkg_config_library(GRANTLEE libgrantlee REQUIRED) - set(GRANTLEE_LIBRARIES "") - else() - find_package(Grantlee5 REQUIRED) - set(GRANTLEE_LIBRARIES Grantlee5::Templates) - endif() - set(PRINTING_PKG PrintSupport) - set(PRINTING_LIB Qt5::PrintSupport) +if(ANDROID) + set(FBSUPPORT OFF) + set(NO_PRINTING ON) endif() if(NO_USERMANUAL) diff --git a/cmake/Modules/FindLIBGIT2.cmake b/cmake/Modules/FindLIBGIT2.cmake index 6e1193f50..cedb96d36 100644 --- a/cmake/Modules/FindLIBGIT2.cmake +++ b/cmake/Modules/FindLIBGIT2.cmake @@ -36,3 +36,4 @@ SET(LIBGIT2_LIBRARIES ${LIBGIT2_LIBRARIES} -lssl -lcrypto) INCLUDE( FindPackageHandleStandardArgs ) FIND_PACKAGE_HANDLE_STANDARD_ARGS( git2 DEFAULT_MSG LIBGIT2_INCLUDE_DIR LIBGIT2_LIBRARIES ) +include_directories(${LIBGIT2_INCLUDE_DIR}})
\ No newline at end of file diff --git a/cmake/Modules/HandleFindGrantlee.cmake b/cmake/Modules/HandleFindGrantlee.cmake new file mode 100644 index 000000000..0abb763df --- /dev/null +++ b/cmake/Modules/HandleFindGrantlee.cmake @@ -0,0 +1,15 @@ +if(NO_PRINTING) + message(STATUS "building without printing support") + add_definitions(-DNO_PRINTING) + set(GRANTLEE_LIBRARIES "") +else() + if(LIBGRANTLEE_FROM_PKGCONFIG) + pkg_config_library(GRANTLEE libgrantlee REQUIRED) + set(GRANTLEE_LIBRARIES "") + else() + find_package(Grantlee5 REQUIRED) + set(GRANTLEE_LIBRARIES Grantlee5::Templates) + endif() + set(PRINTING_PKG PrintSupport) + set(PRINTING_LIB Qt5::PrintSupport) +endif() diff --git a/cmake/Modules/HandleFtdiSupport.cmake b/cmake/Modules/HandleFtdiSupport.cmake new file mode 100644 index 000000000..b4ad685b3 --- /dev/null +++ b/cmake/Modules/HandleFtdiSupport.cmake @@ -0,0 +1,8 @@ +if(FTDISUPPORT) + message(STATUS "building with libftdi support") + pkg_config_library(LIBFTDI libftdi QUIET) + if (NOT LIBFTDI_FOUND) + pkg_config_library(LIBFTDI libftdi1 REQUIRED) + endif() + add_definitions(-DSERIAL_FTDI) +endif() |