Ich habe folgende CMakeLists:Wie kann ich CMake und SQLite ohne ein externes Skript verknüpfen?
cmake_minimum_required (VERSION 2.8.12.2)
project (Tutorial)
find_package (sqlite3)
if (SQLITE3_FOUND)
include_directories(${SQLITE3_INCLUDE_DIRS})
target_link_libraries (new ${SQLITE3_LIBRARIES})
endif (SQLITE3_FOUND)
add_executable(Tutorial new.cpp)
Allerdings, wenn ich cmake, erhalte ich die folgende Meldung:
CMake Warning at CMakeLists.txt:3 (find_package):
By not providing "Findsqlite3.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "sqlite3", but
CMake did not find one.
Could not find a package configuration file provided by "sqlite3" with any
of the following names:
sqlite3Config.cmake
sqlite3-config.cmake
Add the installation prefix of "sqlite3" to CMAKE_PREFIX_PATH or set
"sqlite3_DIR" to a directory containing one of the above files. If
"sqlite3" provides a separate development package or SDK, be sure it has
been installed.
ich auch this und this für alternative CMakeLists Dateien versucht, aber keiner von ihnen habe gearbeitet.
Ich versuche dies auch und es hat nicht funktioniert:
FIND_PATH(SQLITE3_INCLUDE_DIR NAMES sqlite3.h)
FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SQLITE3 DEFAULT_MSG SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR)
IF(SQLITE3_FOUND)
SET(SQLITE3_LIBRARIES ${SQLITE3_LIBRARY})
SET(SQLITE3_INCLUDE_DIRS ${SQLITE3_INCLUDE_DIR})
ELSE(SQLITE3_FOUND)
SET(SQLITE3_LIBRARIES)
SET(SQLITE3_INCLUDE_DIRS)
ENDIF(SQLITE3_FOUND)
MARK_AS_ADVANCED(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES)
Wie kann ich SQLite verbinden, ohne eine Erweiterung zu verwenden?
Vielen Dank!