diff --git a/cmake/Modules/FindSqlite3.cmake b/cmake/Modules/FindSqlite3.cmake index 5b775546d..fb724b27d 100644 --- a/cmake/Modules/FindSqlite3.cmake +++ b/cmake/Modules/FindSqlite3.cmake @@ -20,12 +20,15 @@ if (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS) else (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS) # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls - include(UsePkgConfig) - - pkgconfig(sqlite3 _Sqlite3IncDir _Sqlite3LinkDir _Sqlite3LinkFlags _Sqlite3Cflags) - - set(SQLITE3_DEFINITIONS ${_Sqlite3Cflags}) - + if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) + include(UsePkgConfig) + pkgconfig(sqlite3 _SQLITE3_INCLUDEDIR _SQLITE3_LIBDIR _SQLITE3_LDFLAGS _SQLITE3_CFLAGS) + else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) + find_package(PkgConfig) + if (PKG_CONFIG_FOUND) + pkg_check_modules(_SQLITE3 sqlite3) + endif (PKG_CONFIG_FOUND) + endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) find_path(SQLITE3_INCLUDE_DIR NAMES sqlite3.h