Skip to content

Commit 8c3783f

Browse files
mortbopetMorten Borup Petersen
andcommitted
CMake and dependencies refactor (#395)
* Refactor dependencies * Work * remove libelfin * work * Works! * format * format CI * sudo --------- Co-authored-by: Morten Borup Petersen <[email protected]>
1 parent 720066f commit 8c3783f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+389
-265
lines changed

CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,6 @@ qt6_add_resources(FONTS_SRC ${CMAKE_SOURCE_DIR}/resources/fonts/fonts.qrc)
7171
## Library setup
7272
######################################################################
7373

74-
# Header-only libraries used in the project must be included from top CMakeLists.txt file
75-
include_directories(${RIPES_LIB} SYSTEM PUBLIC external/VSRTL/external/cereal/include)
76-
include_directories(${RIPES_LIB} PUBLIC external/VSRTL/external)
77-
include_directories(SYSTEM external/ELFIO)
78-
include_directories(SYSTEM external/VSRTL/external/Signals)
79-
include_directories(external/libelfin_cmake)
80-
include_directories(external)
81-
8274
option(RIPES_BUILD_VERILATOR_PROCESSORS "Build verilator processors" OFF)
8375
if(RIPES_BUILD_VERILATOR_PROCESSORS)
8476
if(NOT DEFINED ENV{VERILATOR_ROOT})

external/CMakeLists.txt

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,36 @@
1-
cmake_minimum_required(VERSION 3.9)
2-
31
######################################################################
42
## External project subdirectories
53
######################################################################
64

5+
include(FetchContent)
6+
77
# Fancy tab bar
88
add_subdirectory(fancytabbar)
99

1010
# VSRTL
11-
add_subdirectory(VSRTL)
1211
set(VSRTL_BUILD_APP OFF)
1312
set(VSRTL_BUILD_TESTS OFF)
13+
add_subdirectory(VSRTL)
14+
15+
# libelfin
16+
FetchContent_Declare(
17+
libelfin
18+
SYSTEM
19+
GIT_REPOSITORY https://github.com/mortbopet/libelfin.git
20+
GIT_TAG 93a424940dc6e721818c5634b1876c8800e3f980
21+
)
22+
FetchContent_MakeAvailable(libelfin)
1423

15-
add_subdirectory(libelfin)
1624
# Make autoMOC and autoUIC happy about the generated libelfin files
1725
set(libelfin_src "${CMAKE_CURRENT_BINARY_DIR}/libelfin")
1826
set_property(SOURCE "${libelfin_src}/elf_to_string.cc" PROPERTY SKIP_AUTOGEN ON)
1927
set_property(SOURCE "${libelfin_src}/dwarf_to_string.cc" PROPERTY SKIP_AUTOGEN ON)
28+
29+
# ELFIO
30+
FetchContent_Declare(
31+
ELFIO
32+
SYSTEM
33+
GIT_REPOSITORY https://github.com/serge1/ELFIO.git
34+
GIT_TAG 79fcd11595d0793dec593e9072e36c7923c57c1a
35+
)
36+
FetchContent_MakeAvailable(ELFIO)

external/ELFIO

Submodule ELFIO deleted from 79fcd11

external/VSRTL

Submodule VSRTL updated 173 files

external/fancytabbar/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
88
set(CMAKE_AUTOUIC ON)
99
set(CMAKE_AUTORCC ON)
1010

11-
file(GLOB LIB_SOURCES *.cpp graphics/*.cpp)
12-
file(GLOB LIB_HEADERS *.h graphics/*.h)
13-
file(GLOB LIB_UIS *.ui)
11+
file(GLOB LIB_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
12+
file(GLOB LIB_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/fancytabbar/*.h)
1413

15-
set(FANCYTABBAR_LIB fancytabbar_lib)
16-
add_library(${FANCYTABBAR_LIB} STATIC ${LIB_SOURCES} ${LIB_HEADERS} ${LIB_UIS})
17-
target_link_libraries(${FANCYTABBAR_LIB} Qt6::Core Qt6::Widgets)
14+
add_library(fancytabbar STATIC ${LIB_SOURCES} ${LIB_HEADERS})
15+
add_library(fancytabbar::fancytabbar ALIAS fancytabbar)
16+
target_link_libraries(fancytabbar Qt6::Core Qt6::Widgets)
17+
target_include_directories(fancytabbar PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)

external/fancytabbar/fancytab.cpp

Lines changed: 0 additions & 8 deletions
This file was deleted.

external/fancytabbar/fancytabbar.h renamed to external/fancytabbar/include/fancytabbar/fancytabbar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <QVector>
66
#include <QWidget>
77

8-
#include "fancytab.h"
8+
#include "fancytabbar/fancytab.h"
99

1010
/*!
1111
* \brief Goal of this class is TabBar similar to QtCreator left TabBarr.

external/fancytabbar/src/fancytab.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include "fancytabbar/fancytab.h"
2+
3+
#include <QDebug>
4+
5+
FancyTab::FancyTab(const QIcon &icon, QString text) {
6+
m_icon = icon;
7+
m_text = text;
8+
}

external/fancytabbar/fancytabbar.cpp renamed to external/fancytabbar/src/fancytabbar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "fancytabbar.h"
1+
#include "fancytabbar/fancytabbar.h"
22

33
#include <QDebug>
44
#include <QLinearGradient>

0 commit comments

Comments
 (0)