there’s prob an easy answer to this but i’m tired of bangin my head on the same wall.
here’s my dirs:
~/src/pcheetah has a dir for each qt c++ executable
~/src/pcheetah/initme/main.cpp …etc
~/src/pcheetah/pcheetah/main.cpp my top level executable that runs the others
~/src/stv/os.h
~/src/stv/os.cpp …common classes, etc etc
now i’m pretty new to linux. I just made a softlink in each dir (~/src/pcheetah/initme/stv → which points to ~/src/stv)
so my manifest file, build dir and repo dir are in ~/src/pcheetah - named _app, _repo, _mani (a json file)
_mani has:
{
"__cli": 'flatpak-builder --repo=_repo --subject="pcheetah `date`" --ccache --force-clean _app _mani',
"app-id": "app.shazel.pcheetah",
"sdk": "org.kde.Sdk",
"runtime": "org.kde.Platform",
"runtime-version": "6.6",
"command": "pcheetah",
"modules": [
{
"name": "initme",
"buildsystem": "cmake-ninja",
"config-opts": ["-DCMAKE_BUILD_TYPE=RelWithDebInfo"],
"sources": [{ "type": "dir", "path": "initme" }, { "type": "dir", "path": "initme/stv" }]
},
{
"name": "pcheetah",
"buildsystem": "cmake-ninja",
"config-opts": ["-DCMAKE_BUILD_TYPE=RelWithDebInfo"],
"sources": [{ "type": "dir", "path": "pcheetah" }]
}
],
"finish-args": [
"--share=ipc",
"--socket=x11",
"--socket=wayland",
"--filesystem=host",
"--device=dri"
]
}
And i kick flatpak-builder with:
flatpak-builder --repo=_repo --subject=“pcheetah date
” --ccache --force-clean _app _mani -v
Here’s my CMakeLists.txt for initme
cmake_minimum_required(VERSION 3.5)
project(initme VERSION 0.1 LANGUAGES CXX)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Widgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
set(PROJECT_SOURCES
initme.cpp
initme.h
initme.ui
stv/os.cpp
stv/ui.cpp
)
qt_add_executable(initme rc/rc.qrc
MANUAL_FINALIZATION
${PROJECT_SOURCES}
)
target_include_directories(initme PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}:stv")
target_link_libraries(initme PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
install(TARGETS initme
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
qt_finalize_executable(initme)
And this initme (and pcheetah and all of em) compile just fine in qtcreator.
But ole flatpak-builder gives me:
(a buncha stuff that looks totally great but then)
-- Configuring done (1.5s)
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreMacros.cmake:603 (add_executable):
Cannot find source file:
stv/os.cpp
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm
.ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90
.f95 .f03 .hip .ispc
Call Stack (most recent call first):
/usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreMacros.cmake:564 (_qt_internal_create_executable)
/usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreMacros.cmake:777 (qt6_add_executable)
CMakeLists.txt:23 (qt_add_executable)
-- Generating done (0.0s)
CMake Generate step failed. Build files cannot be regenerated correctly.
Error: module initme: Child process exited with code 1
FB: Unmounting read-only fs: fusermount -uz /home/sh/src/pcheetah/.flatpak-builder/rofiles/rofiles-diXdns
So the dang thing ain’t finding my stv dir
I’ve tried using relative path …/…/stv/whatev.cpp
So cmake within qtcreator is ok with everything but not cmake within flatpak-builder…
Well, techically, qtcreator compiles just fine, but the executable won’t find the flatpak runtime shared libs.
If somebody can fill me in about the PROPER way to get flatpak-builder / cmake able to find my stv dir… Pleeeease
…Steve