Skip to content

Commit

Permalink
Refactor dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Morten Borup Petersen committed Jan 6, 2025
1 parent b30b76d commit 9781418
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 22 deletions.
15 changes: 7 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,6 @@ qt6_add_resources(FONTS_SRC ${CMAKE_SOURCE_DIR}/resources/fonts/fonts.qrc)
## Library setup
######################################################################

# Header-only libraries used in the project must be included from top CMakeLists.txt file
include_directories(${RIPES_LIB} SYSTEM PUBLIC external/VSRTL/external/cereal/include)
include_directories(${RIPES_LIB} PUBLIC external/VSRTL/external)
include_directories(SYSTEM external/ELFIO)
include_directories(SYSTEM external/VSRTL/external/Signals)
include_directories(external/libelfin_cmake)
include_directories(external)

option(RIPES_BUILD_VERILATOR_PROCESSORS "Build verilator processors" OFF)
if(RIPES_BUILD_VERILATOR_PROCESSORS)
if(NOT DEFINED ENV{VERILATOR_ROOT})
Expand All @@ -103,6 +95,13 @@ elseif(${WIN32})
set(SYSTEM_FLAGS WIN32)
endif()


include(FetchContent)

# libelfin



add_subdirectory(external)

# Fix the name of the ripes library.
Expand Down
29 changes: 25 additions & 4 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,40 @@
cmake_minimum_required(VERSION 3.9)

######################################################################
## External project subdirectories
######################################################################

include(FetchContent)

# Fancy tab bar
add_subdirectory(fancytabbar)

# VSRTL
add_subdirectory(VSRTL)
set(VSRTL_BUILD_APP OFF)
set(VSRTL_BUILD_TESTS OFF)
FetchContent_Declare(
VSRTL
GIT_REPOSITORY https://github.com/mortbopet/VSRTL.git
GIT_TAG master
)

FetchContent_MakeAvailable(VSRTL)

# libelfin
FetchContent_Declare(
libelfin
GIT_REPOSITORY https://github.com/mortbopet/libelfin.git
GIT_TAG 93a424940dc6e721818c5634b1876c8800e3f980
)
FetchContent_MakeAvailable(libelfin)

add_subdirectory(libelfin)
# Make autoMOC and autoUIC happy about the generated libelfin files
set(libelfin_src "${CMAKE_CURRENT_BINARY_DIR}/libelfin")
set_property(SOURCE "${libelfin_src}/elf_to_string.cc" PROPERTY SKIP_AUTOGEN ON)
set_property(SOURCE "${libelfin_src}/dwarf_to_string.cc" PROPERTY SKIP_AUTOGEN ON)

# ELFIO
FetchContent_Declare(
ELFIO
GIT_REPOSITORY https://github.com/serge1/ELFIO.git
GIT_TAG 79fcd11595d0793dec593e9072e36c7923c57c1a
)
FetchContent_MakeAvailable(ELFIO)
11 changes: 5 additions & 6 deletions external/fancytabbar/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

file(GLOB LIB_SOURCES *.cpp graphics/*.cpp)
file(GLOB LIB_HEADERS *.h graphics/*.h)
file(GLOB LIB_UIS *.ui)
file(GLOB LIB_SOURCES src/*.cpp)
file(GLOB LIB_HEADERS include/fancytabbar/*.h)

set(FANCYTABBAR_LIB fancytabbar_lib)
add_library(${FANCYTABBAR_LIB} STATIC ${LIB_SOURCES} ${LIB_HEADERS} ${LIB_UIS})
target_link_libraries(${FANCYTABBAR_LIB} Qt6::Core Qt6::Widgets)
add_library(fancytabbar STATIC ${LIB_SOURCES})
target_link_libraries(fancytabbar Qt6::Core Qt6::Widgets)
target_include_directories(fancytabbar PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "fancytab.h"
#include "fancytabbar/fancytab.h"

#include <QDebug>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "fancytabbar.h"
#include "fancytabbar/fancytabbar.h"

#include <QDebug>
#include <QLinearGradient>
Expand Down
6 changes: 4 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ add_subdirectory(cli)
# Also link Qt and VSRTL libraries.
target_link_libraries(${RIPES_LIB} PUBLIC
fancytabbar_lib
${VSRTL_GRAPHICS_LIB}
elfio::elfio
vsrtl::vsrtl
Qt6::Charts
dwarf++)
dwarf++
)

2 changes: 2 additions & 0 deletions src/isa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ target_sources(isa_lib
mipsisainfo_common.h mipsisainfo_common.cpp
mips32isainfo.h
)

target_link_libraries(isa_lib PUBLIC elfio::elfio vsrtl::vsrtl Signals::Signals)

0 comments on commit 9781418

Please sign in to comment.