build: re-add support for legacy SystemC installations

This commit is contained in:
2025-10-30 17:01:59 +01:00
parent a10841cdbb
commit 14916d75ba
2 changed files with 58 additions and 1 deletions

View File

@@ -67,6 +67,7 @@ option(DRAMSYS_BUILD_BENCHMARKS "Build DRAMSys benchmarks" OFF)
option(DRAMSYS_BUILD_CLI "Build DRAMSys Command Line Tool" ${PROJECT_IS_TOP_LEVEL})
option(DRAMSYS_BUILD_TOOLS "Build DRAMSys Tools" OFF)
option(DRAMSYS_BUILD_TRACE_ANALYZER "Build DRAMSys Trace Analyzer" OFF)
option(DRAMSYS_USE_LEGACY_SYSTEMC_INSTALLATION "Use SystemC installed with autotools (set SYSTEMC_HOME)" OFF)
# Use sane defaults for FetchContent:
# In case we are the top-level project, get everything by default
@@ -144,7 +145,17 @@ if (DRAMSYS_USE_FETCH_CONTENT)
endif()
endif()
find_package(SystemCLanguage REQUIRED)
# Special handling of SystemC:
# Normally, we require the user to have SystemC installed by CMake
# However, there are some cases where SystemC is still installed by autotools
# In this case, try to find SystemC using FindSystemC and SYSTEMC_HOME
if (DRAMSYS_USE_LEGACY_SYSTEMC_INSTALLATION)
message(STATUS "Using legacy SystemC installed with autotools")
find_package(SystemC MODULE REQUIRED)
else()
find_package(SystemCLanguage REQUIRED)
endif()
find_package(SQLite3 REQUIRED)
find_package(DRAMUtils REQUIRED)
find_package(DRAMPower REQUIRED)