From 8d4dcfddd3f9c45e52ae787b39d5e37052755508 Mon Sep 17 00:00:00 2001 From: Derek Christ Date: Thu, 2 Nov 2023 10:16:53 +0100 Subject: [PATCH] Introduce CMake option to build with external SystemC --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cc66e4b..82db41a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,6 +94,7 @@ option(DRAMSYS_VERBOSE_CMAKE_OUTPUT "Show detailed CMake output" OFF) option(DRAMSYS_BUILD_CLI "Build DRAMSys Command Line Tool" ON) option(DRAMSYS_WITH_DRAMPOWER "Build with DRAMPower support enabled." OFF) option(DRAMSYS_ENABLE_EXTENSIONS "Enable proprietary DRAMSys extensions." OFF) +option(DRAMSYS_USE_EXTERNAL_SYSTEMC "Use an external SystemC installation." OFF) ############################################### ### Library Settings ### @@ -125,12 +126,15 @@ if(DRAMSYS_BUILD_TESTS) endif() ### SystemC ### -list(APPEND CMAKE_PREFIX_PATH $ENV{SYSTEMC_HOME}) +if (DRAMSYS_USE_EXTERNAL_SYSTEMC) + list(APPEND CMAKE_PREFIX_PATH $ENV{SYSTEMC_HOME} /opt/systemc) + find_package(systemc NAMES SystemCLanguage) +endif() + FetchContent_Declare( systemc GIT_REPOSITORY https://github.com/accellera-official/systemc.git - GIT_TAG 2.3.4 - FIND_PACKAGE_ARGS NAMES SystemCLanguage) + GIT_TAG 2.3.4) set(DISABLE_COPYRIGHT_MESSAGE True)