diff --git a/lib/sqlite3/CMakeLists.txt b/lib/sqlite3/CMakeLists.txt index aa826f33..77731c32 100644 --- a/lib/sqlite3/CMakeLists.txt +++ b/lib/sqlite3/CMakeLists.txt @@ -4,11 +4,8 @@ project(sqlite3 VERSION 3.40.1) - FetchContent_Declare(sqlite3 URL "https://www.sqlite.org/2022/sqlite-amalgamation-3400100.zip") -if (NOT sqlite3_POPULATED) - FetchContent_Populate(sqlite3) -endif() +FetchContent_MakeAvailable(sqlite3) add_library(${PROJECT_NAME}) target_sources(${PROJECT_NAME} PRIVATE ${sqlite3_SOURCE_DIR}/sqlite3.c ${sqlite3_SOURCE_DIR}/sqlite3.h ${sqlite3_SOURCE_DIR}/sqlite3ext.h ) @@ -21,4 +18,5 @@ set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER lib) target_compile_definitions(${PROJECT_NAME} PUBLIC SQLITE_ENABLE_RTREE SQLITE_OMIT_LOAD_EXTENSION) -add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) \ No newline at end of file +# Use the same name as the FindSQLite3 script of CMake uses +add_library(SQLite::SQLite3 ALIAS ${PROJECT_NAME}) diff --git a/src/libdramsys/CMakeLists.txt b/src/libdramsys/CMakeLists.txt index ed0d2c7d..e002b137 100644 --- a/src/libdramsys/CMakeLists.txt +++ b/src/libdramsys/CMakeLists.txt @@ -102,7 +102,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC SystemC::systemc DRAMSys::config - sqlite3::sqlite3 + SQLite::SQLite3 ) if (DRAMSYS_WITH_DRAMPOWER)