FIND_PATH(SQLITE3_INCLUDE_DIR sqlite3.h)

FIND_LIBRARY(SQLITE3_LIBRARY_RELEASE NAMES sqlite3)

if (SQLITE3_LIBRARY_RELEASE)
	list(APPEND SQLITE3_LIBRARY optimized ${SQLITE3_LIBRARY_RELEASE})
endif()

FIND_LIBRARY(SQLITE3_LIBRARY_DEBUG NAMES sqlite3_d)

if (SQLITE3_LIBRARY_DEBUG)
	list(APPEND SQLITE3_LIBRARY debug ${SQLITE3_LIBRARY_DEBUG})
else()
	if(NOT WIN32)
		list(APPEND SQLITE3_LIBRARY debug ${SQLITE3_LIBRARY_RELEASE})
	endif()
endif()

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sqlite3 DEFAULT_MSG SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR)
MARK_AS_ADVANCED(SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR)
