risc-v-tlm/CMakeLists.txt

48 lines
1.4 KiB
CMake
Raw Normal View History

2021-04-26 00:58:22 +08:00
## This project requires systemC to be compiled with cmake using C++17:
## cd <systemc directory>
## mkdir build
## cd build
## cmake ../ -DCMAKE_CXX_STANDARD=17
## make
cmake_minimum_required(VERSION 3.1)
project(RISCV_TLM)
# specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_C_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)
2021-11-26 06:41:54 +08:00
set(CMAKE_PREFIX_PATH ../systemc-2.3.3/build/)
2021-11-26 08:05:08 +08:00
set(CMAKE_PREFIX_PATH ../spdlog/build/)
2021-11-26 06:25:52 +08:00
2021-04-26 00:58:22 +08:00
add_compile_options(-O3 -g -Wall -Wextra -Wunused-function -Wpedantic)
include_directories(./inc/)
file(GLOB SRC "./src/*.cpp")
find_package(SystemCLanguage CONFIG REQUIRED)
set (CMAKE_CXX_STANDARD ${SystemC_CXX_STANDARD})
2021-11-25 21:20:58 +08:00
find_package(spdlog CONFIG REQUIRED)
2021-04-26 00:58:22 +08:00
add_executable(RISCV_TLM ${SRC} )
target_link_libraries(RISCV_TLM SystemC::systemc)
2021-11-25 21:20:58 +08:00
target_link_libraries(RISCV_TLM spdlog::spdlog)
2021-04-26 00:58:22 +08:00
option(BUILD_DOC "Build documentation" ON)
find_package(Doxygen)
if (DOXYGEN_FOUND)
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile)
set(DOXYGEN_OUT ${CMAKE_CURRENT_SOURCE_DIR}/doc)
message("Doxygen build started")
add_custom_target( doc
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_IN}
WORKING_DIRECTORY ${DOXYGEN_OUT}
COMMENT "Generating API documentation with Doxygen"
VERBATIM )
else (DOXYGEN_FOUND)
message("Doxygen need to be installed to generate the doxygen documentation")
endif (DOXYGEN_FOUND)