This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Threadweaver example HelloInternet

Tags: None
(comma "," separated)
gzmorell
Registered Member
Posts
7
Karma
0
OS

Threadweaver example HelloInternet

Thu Oct 22, 2015 3:17 pm
Hi,
I have been tried to compile the HelloInternet example that comes with ThreadWeaver (it is in the repository).
I have modified the CMakeLists.txt in order to use the KF5 libraries installed in Arch Linux.
I have the following error:
In file included from /usr/include/KF5/ThreadWeaver/ThreadWeaver/Exception:1:0,
from /home/gzmorell/Develop/Kde/Learn/threadweaver/HelloInternet/ViewController.cpp:12:
/usr/include/KF5/ThreadWeaver/threadweaver/exception.h:34:33: error fatal: threadweaver_export.h: No existe el fichero o el directorio

which indicates that "threadweaver_export.h" is not found.
I have found that file "exception.h" have the next include:
#include <threadweaver_export.h>

Changing it to :
#include "threadweaver_export.h"

The problem is solved.
Is this a bug in the "exception.h" header or is there any way to include the location of "threadweaver_export.h" in CMakeLists.txt?

CMakeLists.txt
Code: Select all
cmake_minimum_required(VERSION 2.8.22)

project(ThreadWeaver_HelloInternet)

find_package(ECM 5.15.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
include(FeatureSummary)

# Tell CMake we will be using C++ 11:
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" AND NOT WIN32)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif()

# Find Qt modules
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
    Core    # QCommandLineParser, QStringLiteral
    Network
    Xml
    Widgets # QApplication
)

# Find KDE modules
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
    CoreAddons      # KAboutData
    I18n            # KLocalizedString
    WidgetsAddons   # KMessageBox
    ThreadWeaver
)

# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed
set(CMAKE_AUTOMOC ON)
QT5_ADD_RESOURCES(helloInternet_RESOURCES_RCC HelloInternetResources.qrc)
# Add the SequenceDemo executable and link the ThreadWeaver framework:
add_executable(ThreadWeaver_HelloInternet
    main.cpp
    MainWidget.cpp
    ViewController.cpp
    ${helloInternet_RESOURCES_RCC}
)

kde_enable_exceptions()
qt5_use_modules(ThreadWeaver_HelloInternet Core Network Xml Widgets)
target_link_libraries(ThreadWeaver_HelloInternet KF5::ThreadWeaver)



Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]