File tree Expand file tree Collapse file tree 7 files changed +26
-6
lines changed
debuginterface/debuginterfaceclient Expand file tree Collapse file tree 7 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 23
23
- macos-latest
24
24
build_type :
25
25
- Debug
26
+ lib_type :
27
+ - Shared
28
+ - Static
26
29
config :
27
30
- qt_version : 6.6.2
28
31
qt_modules : qtscxml
68
71
-DBUILD_TESTS=${{ matrix.build_type == 'Debug' }}
69
72
-DBUILD_EXAMPLES=ON
70
73
-DBUILD_DOCS=${{ matrix.build_type == 'Debug' && runner.os == 'Linux' }}
74
+ -DBUILD_STATIC=${{ matrix.lib_type == 'Static' }}
71
75
-DWITH_INTERNAL_GRAPHVIZ=OFF
72
76
73
77
- name : Build Project
Original file line number Diff line number Diff line change 25
25
build_type :
26
26
- Debug
27
27
- Release
28
+ lib_type :
29
+ - Shared
30
+ - Static
28
31
config :
29
32
- qt_version : 5.15.2
30
33
qt_arch : win64_msvc2019_64
91
94
-DBUILD_TESTS=${{ matrix.build_type == 'Debug' }}
92
95
-DBUILD_EXAMPLES=ON
93
96
-DBUILD_DOCS=${{ matrix.build_type == 'Debug' && runner.os == 'Linux' }}
97
+ -DBUILD_STATIC=${{ matrix.lib_type == 'Static' }}
94
98
95
99
- name : Build Project
96
100
run : cmake --build ./build
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ Version 2.0.0: (unreleased):
7
7
* Use official Graphviz from upstream with -DWITH_INTERNAL_GRAPHVIZ=True
8
8
(Bad side-effect: allows dynamic builds only)
9
9
* Fixed build with more recent graphviz versions
10
+ * Buildsystem: new Option BUILD_STATIC to create static libraries
10
11
11
12
Version 1.2.8:
12
13
--------------
Original file line number Diff line number Diff line change 45
45
# Note: disabling tests also disables building the kdstatemachineeditor test application.
46
46
# Default=True
47
47
#
48
+ # -DBUILD_STATIC=[true|false]
49
+ # Build static libraries
50
+ # Default=false
48
51
49
52
cmake_minimum_required (VERSION 3.16 )
50
53
@@ -76,6 +79,13 @@ else()
76
79
option (BUILD_TESTS "Build the test harness" ON )
77
80
endif ()
78
81
option (BUILD_QT6 "Build against Qt 6" OFF )
82
+ option (BUILD_STATIC "Build statically" OFF )
83
+
84
+ if (BUILD_STATIC )
85
+ set (BUILD_LIBRARY_MODE "STATIC" )
86
+ else ()
87
+ set (BUILD_LIBRARY_MODE "SHARED" )
88
+ endif ()
79
89
80
90
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake" )
81
91
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake/ECM/modules" )
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ if(GRAPHVIZ_FOUND)
77
77
endif ()
78
78
endif ()
79
79
80
- add_library (kdstatemachineeditor_core SHARED ${LIB_SRCS} )
80
+ add_library (kdstatemachineeditor_core ${BUILD_LIBRARY_MODE} ${LIB_SRCS} )
81
81
add_library (KDSME::Core ALIAS kdstatemachineeditor_core )
82
82
target_link_libraries (
83
83
kdstatemachineeditor_core
@@ -159,7 +159,7 @@ install(
159
159
EXPORT KDSME_TARGETS
160
160
${INSTALL_TARGETS_DEFAULT_ARGS}
161
161
)
162
- if (MSVC )
162
+ if (MSVC AND NOT BUILD_STATIC )
163
163
install (
164
164
FILES "$<TARGET_PDB_FILE_DIR:kdstatemachineeditor_core>/$<TARGET_PDB_FILE_NAME:kdstatemachineeditor_core>"
165
165
DESTINATION ${BIN_INSTALL_DIR}
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ if(NOT BUILD_QT6)
17
17
qt5_generate_repc (DEBUGINTERFACECLIENT_SRCS ../debuginterface.rep REPLICA )
18
18
endif ()
19
19
20
- add_library (kdstatemachineeditor_debuginterfaceclient SHARED ${DEBUGINTERFACECLIENT_SRCS} )
20
+ add_library (kdstatemachineeditor_debuginterfaceclient ${BUILD_LIBRARY_MODE} ${DEBUGINTERFACECLIENT_SRCS} )
21
21
22
22
if (BUILD_QT6 )
23
23
qt6_add_repc_replicas (kdstatemachineeditor_debuginterfaceclient ../debuginterface.rep )
@@ -82,7 +82,7 @@ install(
82
82
EXPORT KDSME_TARGETS
83
83
${INSTALL_TARGETS_DEFAULT_ARGS}
84
84
)
85
- if (MSVC )
85
+ if (MSVC AND NOT BUILD_STATIC )
86
86
# cmake-lint: disable=C0301
87
87
install (
88
88
FILES
Original file line number Diff line number Diff line change 16
16
file (GLOB_RECURSE QML_JS_FILES *.qml *.js )
17
17
18
18
add_library (
19
- kdstatemachineeditor_view SHARED
19
+ kdstatemachineeditor_view
20
+ ${BUILD_LIBRARY_MODE}
20
21
command /command.cpp
21
22
command /commandfactory.cpp
22
23
command /createelementcommand.cpp
@@ -97,7 +98,7 @@ install(
97
98
EXPORT KDSME_TARGETS
98
99
${INSTALL_TARGETS_DEFAULT_ARGS}
99
100
)
100
- if (MSVC )
101
+ if (MSVC AND NOT BUILD_STATIC )
101
102
install (
102
103
FILES "$<TARGET_PDB_FILE_DIR:kdstatemachineeditor_view>/$<TARGET_PDB_FILE_NAME:kdstatemachineeditor_view>"
103
104
DESTINATION ${BIN_INSTALL_DIR}
You can’t perform that action at this time.
0 commit comments