[CMake] find_package: keyword REQUIRED ignored

Quaquaraquà nuquaquaraqua at gmail.com
Sun Jul 8 17:34:40 EDT 2018


Hi there,

I'm using a custom script [1] to look for the library sqlite3. However, 
the keyword "REQUIRED" (as quietly) is ignored by find_package. That is 
even if the library is not found, the script continues is processing:

// CMakeLists.txt

cmake_minimum_required(VERSION 3.10)project(hello_world)list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build-aux/")
find_package(SQLite3 REQUIRED)

// output:

cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang 
-DCMAKE_CXX_COMPILER=clang++ -G "CodeBlocks - Unix Makefiles" ../
-- Could NOT find SQLITE3 (missing: SQLITE3_LIBRARY)
-- Configuring done
-- Generating done
-- Build files have been written to: ...


Any idea what is wrong here?


[1] 
https://github.com/LuaDist/libsqlite3/blob/master/cmake/FindSQLite3.cmake

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180708/6fe845f7/attachment.html>


More information about the CMake mailing list