Skip to content

Commit e001fb0

Browse files
authored
Build qwt as a static library. (#9939)
- As it turns out there is no need to have it as a shared library and install it as long as `libOMPlotLib` is a shared lib. - It is also renamed to `omqwt` just to be consistent with the Makefiles build. - Fixes #9925.
1 parent 917eecb commit e001fb0

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

OMPlot/OMPlot/OMPlotGUI/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ target_include_directories(OMPlotLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
3636

3737
target_link_libraries(OMPlotLib PUBLIC Qt5::Widgets)
3838
target_link_libraries(OMPlotLib PUBLIC Qt5::PrintSupport)
39-
target_link_libraries(OMPlotLib PUBLIC qwt)
39+
target_link_libraries(OMPlotLib PUBLIC omqwt)
4040
target_link_libraries(OMPlotLib PUBLIC omc::simrt::runtime)
4141

4242

OMPlot/qwt/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# qwt 6.1.5 and OpenModelica
33

44
cmake_minimum_required (VERSION 3.14)
5-
project (qwt VERSION 6.1.5 LANGUAGES CXX)
5+
project (omqwt VERSION 6.1.5 LANGUAGES CXX)
66

77
option (QWT_WITH_PLOT "Whether to build plot" ON)
88
option (QWT_WITH_SVG "Whether to build svg" ON)

OMPlot/qwt/src/CMakeLists.txt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,22 +214,22 @@ if (QWT_WITH_WIDGETS)
214214
qwt_wheel.cpp)
215215
endif ()
216216

217-
add_library(qwt SHARED ${QWT_HEADERS} ${QWT_SOURCES})
217+
add_library(omqwt STATIC ${QWT_HEADERS} ${QWT_SOURCES})
218218

219-
target_compile_definitions(qwt
219+
target_compile_definitions(omqwt
220220
PUBLIC
221221
$<$<BOOL:MSVC>:QWT_DLL>
222222
PRIVATE
223223
$<$<BOOL:MSVC>:QWT_MAKEDLL>
224224
)
225225

226-
target_include_directories(qwt
226+
target_include_directories(omqwt
227227
PUBLIC
228228
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
229229
$<INSTALL_INTERFACE:include>)
230230

231231
if (USE_QT6)
232-
target_link_libraries(qwt
232+
target_link_libraries(omqwt
233233
PUBLIC
234234
Qt6::Core
235235
Qt6::OpenGL
@@ -239,7 +239,7 @@ if (USE_QT6)
239239
Qt6::PrintSupport
240240
Qt6::Svg)
241241
else ()
242-
target_link_libraries(qwt
242+
target_link_libraries(omqwt
243243
PUBLIC
244244
Qt5::Core
245245
Qt5::OpenGL
@@ -249,10 +249,8 @@ else ()
249249
Qt5::Svg)
250250
endif ()
251251

252-
set_target_properties(qwt PROPERTIES
252+
set_target_properties(omqwt PROPERTIES
253253
VERSION ${QWT_VERSION}
254254
SOVERSION ${QWT_VER_MAJ}
255255
AUTOMOC ON)
256-
target_compile_definitions(qwt PRIVATE QWT_MOC_INCLUDE)
257-
258-
install (TARGETS qwt)
256+
target_compile_definitions(omqwt PRIVATE QWT_MOC_INCLUDE)

0 commit comments

Comments
 (0)