From f60e86b19c6d785a91bc126ac587bf9f3ee87369 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 17 Nov 2015 18:23:32 -0200 Subject: Move FTDI and Grantlee configuration out of CMakeLists.txt Signed-off-by: Tomaz Canabrava --- cmake/Modules/FindLIBGIT2.cmake | 1 + cmake/Modules/HandleFindGrantlee.cmake | 15 +++++++++++++++ cmake/Modules/HandleFtdiSupport.cmake | 8 ++++++++ 3 files changed, 24 insertions(+) create mode 100644 cmake/Modules/HandleFindGrantlee.cmake create mode 100644 cmake/Modules/HandleFtdiSupport.cmake (limited to 'cmake') 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() -- cgit v1.2.3-70-g09d2