OS/2, eCS & ArcaOS - Technical > Programming

CMake

<< < (3/3)

Dave Yeo:
Part of Qt, 5&6, I think the webengine. Paul might have the best port, here's one.
May be incomplete

david.oakford:
Has anyone built a qt5 application using cmake?  This is what I tried. I builds but doesn't run. Any suggestions?

qmain.cpp:

#include <QtWidgets/QApplication>
#include <QtWidgets/QLabel>
int main(int argc, char* argv[]) {
  QApplication a(argc, argv);
  QLabel l("Hello World");
  l.show();
  return a.exec();
}

CMakeLists.txt:

cmake_minimum_required(VERSION 3.20)
project(qmain)
add_executable(qmain qmain.cpp)
target_include_directories(qmain PRIVATE "C:\\usr\\include\\qt5")
target_link_libraries(qmain PRIVATE Qt5Widgets
                            PRIVATE Qt5Core
)
if(OS2)
  set_target_properties(qmain PROPERTIES
    OS2_DEF_VENDOR "oakford"
    OS2_DEF_PATCH "${VERSION_PATCH}"
    OS2_DEF_VERSION "${VERSION}"
    OS2_DEF_EXEType "WINDOWAPI"
  )
endif()

Jochen Schäfer:
Most likely you are missing libcx:

--- Code: ---set(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -lcx")
--- End code ---

If you want to test and get some output on the shell, set the Exe type to WINDOWCOMPAT.
For the app icon to show in PM, you need to set the exe type to WINDOWAPI. The console output then isn't shown, but can be captured like this:

--- Code: ---app -someparameter | less
--- End code ---

My Qt5 ports are here:
https://github.com/josch1710/FeatherNotes
https://github.com/josch1710/FeatherPad

david.oakford:
Jochen,
Thanks so much.  Worked like a charm.  I'll take a look later at your ports.
David

Navigation

[0] Message Index

[*] Previous page

Go to full version