Thanks so much!
I have downloaded your example and started exploring how it works. I made it work by starting from a "CMakeLists.txt" created by Qt Creator. It seems to work. But I need to learn cmake, so I thank you for your example. After 30 years of programming with qmake, it takes some time to learn new things.
Create a *.so or a *.dll file
Qt5
else()
# add_executable(myProgram
# Changed to
add_library(myLib SHARED
${PROJECT_SOURCES}
)
Qt6
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
# qt_add_executable(myProgram
# Changed to
add_library(myLib SHARED
MANUAL_FINALIZATION
${PROJECT_SOURCES}
Use the library file (Only tested with Qt6 and Windows)
target_link_libraries (myTestProgram PRIVATE $ {PROJECT_SOURCE_DIR} /lib/myLib.dll)
Or include the library file in a project that uses qmake
win32:CONFIG(release, debug|release): LIBS += -L../lib/ -ldownloadunpack # Release
else:win32:CONFIG(debug, debug|release): LIBS += -L../lib/ -ldownloadunpackd # Debug
unix:LIBS += -ldownloadunpack