Changeset View
Changeset View
Standalone View
Standalone View
data/CMakeLists.txt
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | 58 | else() | |||
---|---|---|---|---|---|
60 | install (FILES ${defs} DESTINATION share/org.kde.syntax-highlighting/syntax) | 60 | install (FILES ${defs} DESTINATION share/org.kde.syntax-highlighting/syntax) | ||
61 | 61 | | |||
62 | # object library to make cross-folder dependencies work, only themes | 62 | # object library to make cross-folder dependencies work, only themes | ||
63 | add_library(SyntaxHighlightingData OBJECT ${themes_QRC}) | 63 | add_library(SyntaxHighlightingData OBJECT ${themes_QRC}) | ||
64 | endif() | 64 | endif() | ||
65 | 65 | | |||
66 | # set PIC to allow use in static and shared libs | 66 | # set PIC to allow use in static and shared libs | ||
67 | set_property(TARGET SyntaxHighlightingData PROPERTY POSITION_INDEPENDENT_CODE 1) | 67 | set_property(TARGET SyntaxHighlightingData PROPERTY POSITION_INDEPENDENT_CODE 1) | ||
68 | target_link_libraries(SyntaxHighlightingData PRIVATE Qt5::Core) | ||||
davschul: This seems like an overkill, but I'm new to CMAKE and it seems that this was the only way to… | |||||
This is causing a build issue (at least) with CMake 3.10:
OBJECT targets must not link to anything [1]
The CMake doc < 3.11 also mentions "Object libraries cannot be linked." [1] https://cmake.org/cmake/help/v3.14/command/add_library.html#object-libraries krop: This is causing a build issue (at least) with CMake 3.10:
> CMake Error at data/CMakeLists.txt… |
This seems like an overkill, but I'm new to CMAKE and it seems that this was the only way to get the -DQT_NAMESPACE= option added to the compiler command for the qrc_syntax-data.cpp and qrc_theme-data.cpp. Is there a simpler solution to achieve this?