kgg-dec/cmake/FindWinSQLite3.cmake

22 lines
871 B
CMake

set(WinSQLite3_Found FALSE)
if (MSVC AND USE_WIN_SQLITE3)
set(ProgramFiles_x86 "$ENV{ProgramFiles\(x86\)}")
file(GLOB WindowsKitLibs "${ProgramFiles_x86}/Windows Kits/10/Lib/10.0.*/um/${CMAKE_VS_PLATFORM_NAME}")
find_library(LibWinSQLite3 WinSQLite3 PATHS ${WindowsKitLibs})
if (LibWinSQLite3)
set(WinSQLite3_Found TRUE)
get_filename_component(WindowsKitVersion "${LibWinSQLite3}/../../.." ABSOLUTE)
get_filename_component(WindowsKitVersion ${WindowsKitVersion} NAME)
set(WindowsKitInclude "${ProgramFiles_x86}/Windows Kits/10/Include/${WindowsKitVersion}/um")
message("Using WinSQLite3 from Windows SDK (${WindowsKitVersion}).")
endif ()
endif ()
if (NOT WinSQLite3_Found AND USE_SYSTEM_SQLITE3)
find_package(SQLite3)
if (SQLite3_FOUND)
message("Using existing SQLite3.")
endif()
endif()