Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 29 additions & 13 deletions report/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ set(GITHUB "https://github.com/" CACHE STRING "github base url")
include(FetchContent)
include(CTest)

FetchContent_Declare(
cpm-cmake
GIT_REPOSITORY ${GITHUB}cpm-cmake/CPM.cmake.git
GIT_SHALLOW True
GIT_TAG v0.31.1
# download CPM.cmake
file(
DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/v0.40.2/CPM.cmake
${CMAKE_CURRENT_BINARY_DIR}/cmake/CPM.cmake
)

FetchContent_MakeAvailable(cpm-cmake)
include(${cpm-cmake_SOURCE_DIR}/cmake/CPM.cmake)
include(${CMAKE_CURRENT_BINARY_DIR}/cmake/CPM.cmake)

cpmaddpackage("${GITHUB}TheLartians/PackageProject.cmake.git@1.4.1")

Expand All @@ -27,39 +25,58 @@ cpmaddpackage(
GIT_TAG main
)

# upstream set INSTALL_NAME_DIR wrong !
if (APPLE)
set_target_properties(
systemc
PROPERTIES
INSTALL_NAME_DIR "@rpath"
)
endif()

cpmaddpackage(
NAME SystemCCCI
GIT_REPOSITORY ${GITHUB}accellera-official/cci.git
GIT_SHALLOW True
GIT_TAG main
)

# upstream set INSTALL_NAME_DIR wrong !
if (APPLE)
set_target_properties(
cci
PROPERTIES
INSTALL_NAME_DIR "@rpath"
)
endif()


set(WITH_FMT "true" CACHE STRING "Include FMT library")

if(WITH_FMT)
cpmaddpackage(
NAME fmt
GIT_REPOSITORY ${GITHUB}fmtlib/fmt.git
GIT_SHALLOW True
GIT_TAG 9.1.0
GIT_TAG 11.0.2
OPTIONS FMT_INSTALL "" ON
)
endif()

FetchContent_Declare(
spdlog_git
GIT_REPOSITORY "https://github.com/gabime/spdlog.git"
GIT_TAG "v1.9.2"
GIT_TAG "v1.15.0"
GIT_SHALLOW ON
)
FetchContent_Populate(spdlog_git)
FetchContent_MakeAvailable(spdlog_git)
FetchContent_GetProperties(
spdlog_git
SOURCE_DIR spdlog_git_SRC_DIR
POPULATED spdlog_git_FOUND
)

add_library(${PROJECT_NAME} src/report.cpp src/logger.cpp)
add_library(${PROJECT_NAME} src/sc_report.cpp src/logger.cpp)
target_include_directories(
${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
Expand All @@ -73,7 +90,6 @@ endif()
target_include_directories(${PROJECT_NAME} PRIVATE ${spdlog_git_SRC_DIR}/include)

if(TARGET SystemC::cci)
target_compile_definitions(${PROJECT_NAME} PRIVATE HAS_CCI)
target_link_libraries(${PROJECT_NAME} PUBLIC SystemC::cci)
endif()

Expand Down
2 changes: 1 addition & 1 deletion report/include/scp/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#ifndef _SCP_LOGGER_H_
#define _SCP_LOGGER_H_

#include "report.h"
#include "sc_report.h"

/** \ingroup scp-report
* @{
Expand Down
Loading