From 0f1e5c539059915a7803c799bb4ba8efcc7f9cb2 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Mon, 18 Jun 2007 06:26:31 +0000 Subject: Need by digikam/amarok svn path=/trunk/KDE/kdelibs/; revision=676977 --- modules/FindSqlite.cmake | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 modules/FindSqlite.cmake (limited to 'modules/FindSqlite.cmake') diff --git a/modules/FindSqlite.cmake b/modules/FindSqlite.cmake new file mode 100644 index 00000000..a6041e62 --- /dev/null +++ b/modules/FindSqlite.cmake @@ -0,0 +1,55 @@ +# - Try to find the SQLITE library +# Once done this will define +# +# SQLITE_FOUND - system has sqlite +# SQLITE_INCLUDE_DIR - the sqlite include directory +# SQLITE_LIBRARIES - Link these to use sqlite +# SQLITE_DEFINITIONS - Compiler switches required for using sqlite +# + +if (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES) + + # in cache already + SET(SQLITE_FOUND TRUE) + +else (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES) + IF (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + INCLUDE(UsePkgConfig) + + PKGCONFIG(sqlite3 _SQLITEIncDir _SQLITELinkDir _SQLITELinkFlags _SQLITECflags) + + set(SQLITE_DEFINITIONS ${_SQLITECflags}) + ENDIF (NOT WIN32) + + FIND_PATH(SQLITE_INCLUDE_DIR qlite3.h + ${_SQLITEIncDir} + /usr/include + /usr/local/include + ) + + FIND_LIBRARY(SQLITE_LIBRARIES NAMES sqlite3 + PATHS + ${_SQLITELinkDir} + /usr/lib + /usr/local/lib + ) + + if (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES) + set(SQLITE_FOUND TRUE) + endif (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES) + + if (SQLITE_FOUND) + if (NOT Sqlite_FIND_QUIETLY) + message(STATUS "Found SQLITE: ${SQLITE_LIBRARIES}") + endif (NOT Sqlite_FIND_QUIETLY) + else (SQLITE_FOUND) + if (Sqlite_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find SQLITE") + endif (Sqlite_FIND_REQUIRED) + endif (SQLITE_FOUND) + + MARK_AS_ADVANCED(SQLITE_INCLUDE_DIR SQLITE_LIBRARIES) + +endif (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES) -- cgit v1.2.1 From b236d0e3257ee7c40b3056a2b9c43211e675b4c7 Mon Sep 17 00:00:00 2001 From: Gilles Caulier Date: Mon, 18 Jun 2007 12:23:56 +0000 Subject: fix qlite.h to sqlite.h svn path=/trunk/KDE/kdelibs/; revision=677073 --- modules/FindSqlite.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/FindSqlite.cmake') diff --git a/modules/FindSqlite.cmake b/modules/FindSqlite.cmake index a6041e62..b3cd2a08 100644 --- a/modules/FindSqlite.cmake +++ b/modules/FindSqlite.cmake @@ -23,7 +23,7 @@ else (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES) set(SQLITE_DEFINITIONS ${_SQLITECflags}) ENDIF (NOT WIN32) - FIND_PATH(SQLITE_INCLUDE_DIR qlite3.h + FIND_PATH(SQLITE_INCLUDE_DIR sqlite3.h ${_SQLITEIncDir} /usr/include /usr/local/include -- cgit v1.2.1 From 9d5410493b0c4b2413f44f84d06bb847f2174fa8 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Mon, 6 Aug 2007 17:30:55 +0000 Subject: Remove not necessary path here too svn path=/trunk/KDE/kdelibs/; revision=697065 --- modules/FindSqlite.cmake | 4 ---- 1 file changed, 4 deletions(-) (limited to 'modules/FindSqlite.cmake') diff --git a/modules/FindSqlite.cmake b/modules/FindSqlite.cmake index b3cd2a08..b1a4ecba 100644 --- a/modules/FindSqlite.cmake +++ b/modules/FindSqlite.cmake @@ -25,15 +25,11 @@ else (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES) FIND_PATH(SQLITE_INCLUDE_DIR sqlite3.h ${_SQLITEIncDir} - /usr/include - /usr/local/include ) FIND_LIBRARY(SQLITE_LIBRARIES NAMES sqlite3 PATHS ${_SQLITELinkDir} - /usr/lib - /usr/local/lib ) if (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES) -- cgit v1.2.1 From a0ac74e03721c2b1441a733d57377f177ceff7a3 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Mon, 20 Aug 2007 06:51:13 +0000 Subject: Use FIND_PACKAGE_HANDLE_STANDARD_ARGS Fix typo svn path=/trunk/KDE/kdelibs/; revision=702150 --- modules/FindSqlite.cmake | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'modules/FindSqlite.cmake') diff --git a/modules/FindSqlite.cmake b/modules/FindSqlite.cmake index b1a4ecba..fdf09c32 100644 --- a/modules/FindSqlite.cmake +++ b/modules/FindSqlite.cmake @@ -31,20 +31,10 @@ else (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES) PATHS ${_SQLITELinkDir} ) + - if (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES) - set(SQLITE_FOUND TRUE) - endif (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES) - - if (SQLITE_FOUND) - if (NOT Sqlite_FIND_QUIETLY) - message(STATUS "Found SQLITE: ${SQLITE_LIBRARIES}") - endif (NOT Sqlite_FIND_QUIETLY) - else (SQLITE_FOUND) - if (Sqlite_FIND_REQUIRED) - message(FATAL_ERROR "Could NOT find SQLITE") - endif (Sqlite_FIND_REQUIRED) - endif (SQLITE_FOUND) + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sqlite DEFAULT_MSG SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES ) MARK_AS_ADVANCED(SQLITE_INCLUDE_DIR SQLITE_LIBRARIES) -- cgit v1.2.1 From 774a92f000c11eb7fc6d4d0032596d35b0c27de4 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Thu, 23 Aug 2007 22:14:18 +0000 Subject: unbreak checks svn path=/trunk/KDE/kdelibs/; revision=704013 --- modules/FindSqlite.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/FindSqlite.cmake') diff --git a/modules/FindSqlite.cmake b/modules/FindSqlite.cmake index fdf09c32..96f32929 100644 --- a/modules/FindSqlite.cmake +++ b/modules/FindSqlite.cmake @@ -34,7 +34,7 @@ else (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES) include(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sqlite DEFAULT_MSG SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES ) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sqlite DEFAULT_MSG SQLITE_INCLUDE_DIR SQLITE_LIBRARIES ) MARK_AS_ADVANCED(SQLITE_INCLUDE_DIR SQLITE_LIBRARIES) -- cgit v1.2.1 From 2ff39e5b0dff557ad514a2b8f1e062a6795d6108 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Sun, 9 Nov 2008 17:47:01 +0000 Subject: Convert it svn path=/trunk/KDE/kdelibs/; revision=882079 --- modules/FindSqlite.cmake | 76 +++++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 37 deletions(-) (limited to 'modules/FindSqlite.cmake') diff --git a/modules/FindSqlite.cmake b/modules/FindSqlite.cmake index 96f32929..29a23612 100644 --- a/modules/FindSqlite.cmake +++ b/modules/FindSqlite.cmake @@ -1,41 +1,43 @@ -# - Try to find the SQLITE library +# - Try to find Sqlite # Once done this will define # -# SQLITE_FOUND - system has sqlite -# SQLITE_INCLUDE_DIR - the sqlite include directory -# SQLITE_LIBRARIES - Link these to use sqlite -# SQLITE_DEFINITIONS - Compiler switches required for using sqlite +# SQLITE_FOUND - system has Sqlite +# SQLITE_INCLUDE_DIR - the Sqlite include directory +# SQLITE_LIBRARIES - Link these to use Sqlite +# SQLITE_DEFINITIONS - Compiler switches required for using Sqlite +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. # -if (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES) - - # in cache already - SET(SQLITE_FOUND TRUE) - -else (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES) - IF (NOT WIN32) - # use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - INCLUDE(UsePkgConfig) - - PKGCONFIG(sqlite3 _SQLITEIncDir _SQLITELinkDir _SQLITELinkFlags _SQLITECflags) - - set(SQLITE_DEFINITIONS ${_SQLITECflags}) - ENDIF (NOT WIN32) - - FIND_PATH(SQLITE_INCLUDE_DIR sqlite3.h - ${_SQLITEIncDir} - ) - - FIND_LIBRARY(SQLITE_LIBRARIES NAMES sqlite3 - PATHS - ${_SQLITELinkDir} - ) - - - include(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sqlite DEFAULT_MSG SQLITE_INCLUDE_DIR SQLITE_LIBRARIES ) - - MARK_AS_ADVANCED(SQLITE_INCLUDE_DIR SQLITE_LIBRARIES) - -endif (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES) + +if ( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES ) + # in cache already + SET(Sqlite_FIND_QUIETLY TRUE) +endif ( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES ) + +# use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +if( NOT WIN32 ) + INCLUDE(FindPkgConfig) + + PKG_CHECK_MODULES(SQLITE sqlite3) + + SET(SQLITE_DEFINITIONS ${SQLITE_CFLAGS}) +endif( NOT WIN32 ) + +FIND_PATH(SQLITE_INCLUDE_DIR NAMES sqlite3.h + PATHS + ${SQLITE_INCLUDE_DIRS} +) + +FIND_LIBRARY(SQLITE_LIBRARIES NAMES sqlite3 + PATHS + ${SQLITE_LIBRARY_DIRS} +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sqlite DEFAULT_MSG SQLITE_INCLUDE_DIR SQLITE_LIBRARIES ) + +# show the SQLITE_INCLUDE_DIR and SQLITE_LIBRARIES variables only in the advanced view +MARK_AS_ADVANCED(SQLITE_INCLUDE_DIR SQLITE_LIBRARIES ) + -- cgit v1.2.1 From b6f9515fff4f5e47c8514197474294c7168c3ab7 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Tue, 11 Nov 2008 11:50:35 +0000 Subject: Fix it svn path=/trunk/KDE/kdelibs/; revision=882740 --- modules/FindSqlite.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/FindSqlite.cmake') diff --git a/modules/FindSqlite.cmake b/modules/FindSqlite.cmake index 29a23612..3dd53351 100644 --- a/modules/FindSqlite.cmake +++ b/modules/FindSqlite.cmake @@ -18,11 +18,11 @@ endif ( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES ) # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls if( NOT WIN32 ) - INCLUDE(FindPkgConfig) + find_package(PkgConfig) - PKG_CHECK_MODULES(SQLITE sqlite3) + pkg_check_modules(SQLITE sqlite3) - SET(SQLITE_DEFINITIONS ${SQLITE_CFLAGS}) + set(SQLITE_DEFINITIONS ${SQLITE_CFLAGS}) endif( NOT WIN32 ) FIND_PATH(SQLITE_INCLUDE_DIR NAMES sqlite3.h -- cgit v1.2.1 From c379d4c4e0655fac2dadd4be57e2e5cd23d40572 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Tue, 2 Dec 2008 21:49:01 +0000 Subject: -rework all uses of find_package(PkgConfig)/pkg_check_modules(): the prefix used for pkgconfig config (e.g. SQLITE) now *always* gets an additional "PC_" prefix, so the prefix used for pkgconfig is now "PC_SQLITE_". This avoids name clashes between variables defined by the pkgconfig macro and the find module and unwanted effects. *Never* use the _CFLAGS coming from pkgconfig, but always CFLAGS_OTHER, since these shouldn't contain the include directories. If the include directories would be in the DEFINITIONS variable this could clash with the results of find_path() for finding include dirs. *Always* use both foo_INCLUDEDIR, foo_INCLUDE_DIRS for searching the include dir, and also both foo_LIBDIR and foo_LIBRARY_DIRS for searching the libraries. These directories coming from pkgconfig are *never* used exclusively, but *always* additionally to the standard search dirs, either before them (then using the "HINTS" keyword) or after them (then using the "PATHS" keyword) I hope I didn't break (too much) stuff. At least on my system it all seems to work the same way as it did before, with and without pkgconfig. Alex svn path=/trunk/KDE/kdelibs/; revision=891805 --- modules/FindSqlite.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'modules/FindSqlite.cmake') diff --git a/modules/FindSqlite.cmake b/modules/FindSqlite.cmake index 3dd53351..d010719f 100644 --- a/modules/FindSqlite.cmake +++ b/modules/FindSqlite.cmake @@ -20,19 +20,21 @@ endif ( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES ) if( NOT WIN32 ) find_package(PkgConfig) - pkg_check_modules(SQLITE sqlite3) + pkg_check_modules(PC_SQLITE sqlite3) - set(SQLITE_DEFINITIONS ${SQLITE_CFLAGS}) + set(SQLITE_DEFINITIONS ${PC_SQLITE_CFLAGS_OTHER}) endif( NOT WIN32 ) FIND_PATH(SQLITE_INCLUDE_DIR NAMES sqlite3.h PATHS - ${SQLITE_INCLUDE_DIRS} + ${PC_SQLITE_INCLUDEDIR} + ${PC_SQLITE_INCLUDE_DIRS} ) FIND_LIBRARY(SQLITE_LIBRARIES NAMES sqlite3 PATHS - ${SQLITE_LIBRARY_DIRS} + ${PC_SQLITE_LIBDIR} + ${PC_SQLITE_LIBRARY_DIRS} ) include(FindPackageHandleStandardArgs) -- cgit v1.2.1 From 87c903a8e853eec433860818a01040da8d1c5f1a Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Sun, 4 Jan 2009 15:39:53 +0000 Subject: -add missing copyright notices, I hope I got it right -also a few empty lines here and there to make it look nicer Alex svn path=/trunk/KDE/kdelibs/; revision=905547 --- modules/FindSqlite.cmake | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/FindSqlite.cmake') diff --git a/modules/FindSqlite.cmake b/modules/FindSqlite.cmake index d010719f..2fa76330 100644 --- a/modules/FindSqlite.cmake +++ b/modules/FindSqlite.cmake @@ -10,6 +10,11 @@ # +# Copyright (c) 2008, Gilles Caulier, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + if ( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES ) # in cache already SET(Sqlite_FIND_QUIETLY TRUE) -- cgit v1.2.1 From ac954219018fac1c1cae99b6e69be9438e452233 Mon Sep 17 00:00:00 2001 From: David Jarvie Date: Wed, 11 Mar 2009 22:39:22 +0000 Subject: Suppress 'not found' messages from pkgconfig when the module subsequently attempts to locate the package by other means. svn path=/trunk/KDE/kdelibs/; revision=938476 --- modules/FindSqlite.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/FindSqlite.cmake') diff --git a/modules/FindSqlite.cmake b/modules/FindSqlite.cmake index 2fa76330..dc36457b 100644 --- a/modules/FindSqlite.cmake +++ b/modules/FindSqlite.cmake @@ -25,7 +25,7 @@ endif ( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES ) if( NOT WIN32 ) find_package(PkgConfig) - pkg_check_modules(PC_SQLITE sqlite3) + pkg_check_modules(PC_SQLITE QUIET sqlite3) set(SQLITE_DEFINITIONS ${PC_SQLITE_CFLAGS_OTHER}) endif( NOT WIN32 ) -- cgit v1.2.1 From eb2dd953289c2cf3151b1badda8afe6e5458024d Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Sun, 26 Sep 2010 16:38:25 +0000 Subject: -consistent upper/lowercasing -remove the unnecessary if(already found) set(QUIET TRUE), since this is already handled by find_package_handle_standard_args() Alex svn path=/trunk/KDE/kdelibs/; revision=1179961 --- modules/FindSqlite.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/FindSqlite.cmake') diff --git a/modules/FindSqlite.cmake b/modules/FindSqlite.cmake index dc36457b..c4f2e90a 100644 --- a/modules/FindSqlite.cmake +++ b/modules/FindSqlite.cmake @@ -30,21 +30,21 @@ if( NOT WIN32 ) set(SQLITE_DEFINITIONS ${PC_SQLITE_CFLAGS_OTHER}) endif( NOT WIN32 ) -FIND_PATH(SQLITE_INCLUDE_DIR NAMES sqlite3.h +find_path(SQLITE_INCLUDE_DIR NAMES sqlite3.h PATHS ${PC_SQLITE_INCLUDEDIR} ${PC_SQLITE_INCLUDE_DIRS} ) -FIND_LIBRARY(SQLITE_LIBRARIES NAMES sqlite3 +find_library(SQLITE_LIBRARIES NAMES sqlite3 PATHS ${PC_SQLITE_LIBDIR} ${PC_SQLITE_LIBRARY_DIRS} ) include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sqlite DEFAULT_MSG SQLITE_INCLUDE_DIR SQLITE_LIBRARIES ) +find_package_handle_standard_args(Sqlite DEFAULT_MSG SQLITE_INCLUDE_DIR SQLITE_LIBRARIES ) # show the SQLITE_INCLUDE_DIR and SQLITE_LIBRARIES variables only in the advanced view -MARK_AS_ADVANCED(SQLITE_INCLUDE_DIR SQLITE_LIBRARIES ) +mark_as_advanced(SQLITE_INCLUDE_DIR SQLITE_LIBRARIES ) -- cgit v1.2.1