[CMake] find_package: keyword REQUIRED ignored

Rolf Eike Beer eike at sf-mail.de
Mon Jul 9 03:01:14 EDT 2018


Am 2018-07-08 23:34, schrieb Quaquaraquà:
> 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

Try:

find_package_handle_standard_args(SQLite3 …

i.e. use the same case for the prefix as your file is called. And maybe 
use the second function signature of FPHSA.

Greetings,

Eike
-- 


More information about the CMake mailing list