From 126d9a00e41607fc4c1eb20edcbe17529c09ef38 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 17 Nov 2015 17:52:49 -0200 Subject: Added HandleFindLibDiveComputer.cmake Anoter attempt to clear the Main CMakeLists.txt file Signed-off-by: Tomaz Canabrava --- CMakeLists.txt | 9 +-------- cmake/Modules/HandleFindLibDiveComputer.cmake | 7 +++++++ 2 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 cmake/Modules/HandleFindLibDiveComputer.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a0716ea6..d28678345 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,6 +87,7 @@ include(cmake/Modules/pkgconfig_helper.cmake) # if you think a module miss anything, take a look on the specific # module file. include(cmake/Modules/HandleFindGit2.cmake) +include(cmake/Modules/HandleFindLibDiveComputer.cmake) pkg_config_library(LIBXML libxml-2.0 REQUIRED) pkg_config_library(LIBSQLITE3 sqlite3 REQUIRED) @@ -99,14 +100,6 @@ if(SMARTTRAK_IMPORT) pkg_config_library(LIBMDB libmdb REQUIRED) endif() -if(LIBDC_FROM_PKGCONFIG) - pkg_config_library(LIBDC libdivecomputer REQUIRED) - set(LIBDIVECOMPUTER_LIBRARIES "") -else() - find_package(Libdivecomputer REQUIRED) - include_directories(${LIBDIVECOMPUTER_INCLUDE_DIR}) -endif() - # setup marble if(NOT NO_MARBLE) diff --git a/cmake/Modules/HandleFindLibDiveComputer.cmake b/cmake/Modules/HandleFindLibDiveComputer.cmake new file mode 100644 index 000000000..2f5bfeb32 --- /dev/null +++ b/cmake/Modules/HandleFindLibDiveComputer.cmake @@ -0,0 +1,7 @@ +if(LIBDC_FROM_PKGCONFIG) + pkg_config_library(LIBDC libdivecomputer REQUIRED) + set(LIBDIVECOMPUTER_LIBRARIES "") +else() + find_package(Libdivecomputer REQUIRED) + include_directories(${LIBDIVECOMPUTER_INCLUDE_DIR}) +endif() -- cgit v1.2.3-70-g09d2