From 52d307e3b01b733e925d51d0367995813bb283b2 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Fri, 9 Jan 2015 20:38:25 +0100 Subject: CMake: Check libs in submodules before configuring. This provides an early error message when someone forgets to init / update submodules. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4e9d41e8..493cecdb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,14 @@ set(SQLITECPP_BUILD_EXAMPLES OFF CACHE BOOL "Build examples." set(SQLITECPP_BUILD_TESTS OFF CACHE BOOL "Build and run tests." FORCE) set(SQLITECPP_INTERNAL_SQLITE OFF CACHE BOOL "Add the internal SQLite3 source to the project." FORCE) +# Check that the libraries are present: +if (NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/SQLiteCpp/CMakeLists.txt) + message(FATAL_ERROR "SQLiteCpp is missing in folder lib/SQLiteCpp. Have you initialized the submodules / downloaded the extra libraries?") +endif() +if (NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/polarssl/CMakeLists.txt) + message(FATAL_ERROR "PolarSSL is missing in folder lib/polarssl. Have you initialized the submodules / downloaded the extra libraries?") +endif() + # Include all the libraries: add_subdirectory(lib/jsoncpp/) add_subdirectory(lib/zlib/) -- cgit v1.2.3