1
0
mirror of https://github.com/EduApps-CDG/OpenDX synced 2024-12-30 09:45:37 +01:00

Fixed ui file inclusion (wait for #embed)

This commit is contained in:
Eduardo P. Gomez 2023-09-21 04:45:39 -03:00
parent dc8c1d600a
commit 46d21bf5c2
7 changed files with 15 additions and 12 deletions

View File

@ -37,7 +37,7 @@
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cppStandard": "gnu++20",
"cppStandard": "gnu++23",
"intelliSenseMode": "linux-gcc-x64",
"cStandard": "gnu23",
"compileCommands": "${workspaceFolder}/build/compile_commands.json"

View File

@ -54,6 +54,7 @@
"stdexcept": "cpp",
"streambuf": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp"
"typeinfo": "cpp",
"*.ui": "cpp"
}
}

View File

@ -24,6 +24,10 @@ set(CPACK_DEBIAN_PACKAGE_DEPENDS "libgtk-4-1")
include(CPack)
install(DIRECTORY ${CMAKE_BINARY_DIR}/root/ DESTINATION /)
#C/C++ flags
set(CMAKE_C_STANDARD 23)
set(CMAKE_CXX_STANDARD 23)
find_package(PkgConfig)
pkg_check_modules(PC_ QUIET )
set(_DEFINITIONS ${PC__CFLAGS_OTHER})
@ -37,7 +41,6 @@ find_library(_LIBRARY NAMES
set(_LIBRARIES ${_LIBRARY} )
set(_INCLUDE_DIRS ${_INCLUDE_DIR} )
set(CMAKE_CXX_STANDARD 20)
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set _FOUND to TRUE

View File

@ -9,9 +9,4 @@
* it means that every time it's called
* the file content will be included in the code
*/
#define GetFileContent(file_path) []() -> std::string { \
std::ifstream file(file_path); \
std::stringstream buffer; \
buffer << file.rdbuf(); \
return buffer.str(); \
}()
#define GetFileContent(file_path) #file_path

View File

@ -1,7 +1,8 @@
#pragma once
#include <preprocessor/GetFileContent.hpp>
#include <string>
namespace MainWindow {
const std::string ui = GetFileContent(PROJECT_SOURCE_DIR "/tools/dxdiag/layout/MainWindow.ui");
const std::string ui =
#include "MainWindow.ui"
;
}

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
R"XXX(<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<object class="GtkWindow" id="main_window">
@ -398,3 +398,4 @@ If you know what area is causing the problem, click on the apropriate tab above.
</property>
</object>
</interface>
)XXX"

View File

@ -2,6 +2,8 @@
#include <gtk/gtk.h>
#include <unistd.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <cstdio>