commit something which idk when i write them

This commit is contained in:
2026-04-21 22:33:21 +08:00
parent 5c18e2ccbc
commit d3fd3c2b0d
6 changed files with 25 additions and 19 deletions

View File

@@ -1,15 +1,23 @@
if (WIN32)
# In Windows, we use custom way to import SQLite
# In Windows, we use custom way to import SQLite.
# Before using this CMake file in Windows, you should do following steps first.
# 1. Get SQLite SDK (amalgamation) and binaries (sqlite-dll) from http://www.sqlite.org/
# 2. Extract SQLite SDK and binaries to your preferred directory.
# 3. Open Developer Command Prompt for Visual Studio (embedded with Visual Studio installation)
# 4. Use `cd` command to switch work directory to the directory where you extract binaries.
# 5. Execute `lib /DEF:sqlite3.def /OUT:sqlite3.lib /MACHINE:x86` (`x86` is the architecture of your SQLite3, you may change it according to your requirement).
# 6. Now you have a generated LIB file for MSVC linking.
# Check variables# Check YYCC path variable
# Check SQLite path variable
if (NOT DEFINED SQLITE_AMALGAMATION_PATH)
message(FATAL_ERROR "You must set SQLITE_AMALGAMATION_PATH variable to the header of SQLite library.")
message(FATAL_ERROR "You must set SQLITE_AMALGAMATION_PATH to the directory where the SQLite3 header file locate.")
endif()
if (NOT DEFINED SQLITE_DLL_PATH)
message(FATAL_ERROR "You must set SQLITE_DLL_PATH variable the directory containing generated linking LIB file.")
message(FATAL_ERROR "You must set SQLITE_DLL_PATH to the directory where the generated SQLite3 LIB file locate for linking.")
endif()
# Add imported library
add_library(SQLite3 INTERFACE IMPORTED)
# Add alias for it to let it has the same behavior with CMake imported SQLite3.
add_library(SQLite3::SQLite3 ALIAS SQLite3)
# Setup header files
set_target_properties(SQLite3 PROPERTIES
@@ -22,6 +30,6 @@ if (WIN32)
"${SQLITE_DLL_PATH}/sqlite3.lib"
)
else ()
# In non-Windows, we import SQLite from CMake
# In non-Windows, we simply import SQLite3 from CMake preset.
find_package(SQLite3 REQUIRED)
endif ()

View File

@@ -1,9 +1,15 @@
# Check YYCC path variable
# Check YYCC path environment variable
if (NOT DEFINED YYCC_PATH)
message(FATAL_ERROR "You must set YYCC_PATH variable to one of CMake distribution of YYCC installation path.")
message(FATAL_ERROR "You must set YYCC_PATH variable to one of YYCC CMake distribution installation path.")
endif()
# Find YYCC library
find_package(YYCCommonplace REQUIRED
HINTS ${YYCC_PATH} NO_DEFAULT_PATH
)
# It will produce YYCC::YYCCommonplace target for including and linking.
#
# Please note we MUST set CMake variable YYCCommonplace_ROOT to make sure CMake can found YYCC in out given path.
# The cache status of YYCCommonplace_ROOT is doesn't matter.
# CMake will throw error if we use HINTS feature in find_package to find YYCC.
set(YYCCommonplace_ROOT ${YYCC_PATH} CACHE PATH
"The path to YYCC CMake distribution installation path.")
find_package(YYCCommonplace REQUIRED)