File tree Expand file tree Collapse file tree 9 files changed +44
-32
lines changed Expand file tree Collapse file tree 9 files changed +44
-32
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,7 @@ endif()
11
11
12
12
project (daggy_dev )
13
13
14
- option (CONAN_BUILD "build with conan" ON )
15
- add_definitions (-DCONAN_BUILD )
16
- option (PACKAGE_DEPS "include daggy deps into package" ON )
14
+ set (PORTABLE_BUILD ON )
17
15
18
16
include (CTest )
19
17
add_subdirectory (src )
Original file line number Diff line number Diff line change @@ -63,10 +63,9 @@ def config_options(self):
63
63
if self .settings .os == "Windows" :
64
64
del self .options .fPIC
65
65
66
- self .options ["qt" ].shared = True
67
-
68
- if self .settings .os == "Windows" :
69
- self .options ["libssh2" ].shared = True
66
+ self .options ["qt" ].shared = self .options .shared
67
+ self .options ["libssh2" ].shared = self .options .shared
68
+ self .options ["yaml-cpp" ].shared = self .options .shared
70
69
71
70
def build_requirements (self ):
72
71
self .tool_requires ("cmake/3.30.1" )
@@ -109,10 +108,11 @@ def generate(self):
109
108
tc .cache_variables ["YAML_SUPPORT" ] = True
110
109
tc .cache_variables ["CONSOLE" ] = True
111
110
tc .cache_variables ["PCAPNG_SUPPORT" ] = False
112
- tc .cache_variables ["PACKAGE_DEPS " ] = True
111
+ tc .cache_variables ["PORTABLE_BUILD " ] = True
113
112
tc .cache_variables ["BUILD_TESTING" ] = True
114
113
tc .cache_variables ["CONAN_BUILD" ] = True
115
114
tc .cache_variables ["VERSION" ] = GitVersion ().version
115
+ tc .cache_variables ["VERSION_EXTENDED" ] = GitVersion ().extended
116
116
117
117
if self .options .shared :
118
118
tc .cache_variables ["CMAKE_C_VISIBILITY_PRESET" ] = "hidden"
Original file line number Diff line number Diff line change @@ -58,16 +58,23 @@ def branch(self):
58
58
stream = os .popen ("git branch --show-current" )
59
59
return stream .read ().strip ()
60
60
61
+ @property
62
+ def short (self ):
63
+ stream = os .popen ("git rev-parse --short=6 HEAD" )
64
+ return stream .read ().strip ()
65
+
61
66
@property
62
67
def full (self ):
63
- return f"{ self .version } -{ self .branch } "
68
+ return f"{ self .version } -{ self .short } "
69
+
64
70
65
71
@property
66
- def standard (self ):
67
- standard = f"{ self .version } -{ self .branch } "
68
- if self .branch == self .default_branch or re .match ("release/.*" , self .branch ):
69
- standard = f"{ self .version } "
70
- return standard
72
+ def extended (self ):
73
+ if self .build == 0 :
74
+ extended = f"{ self .version } "
75
+ else :
76
+ extended = f"{ self .version } -{ self .short } "
77
+ return extended
71
78
72
79
@property
73
80
def commit (self ):
@@ -82,7 +89,7 @@ def __str__(self):
82
89
Full: { self .full }
83
90
Branch: { self .branch }
84
91
Build: { self .build }
85
- Standard : { self .standard }
92
+ Extended : { self .extended }
86
93
Commit: { self .commit }
87
94
"""
88
95
Original file line number Diff line number Diff line change @@ -18,10 +18,23 @@ include_directories(${CMAKE_BINARY_EXPORTS_DIR})
18
18
set (PROJECT_VENDOR synacker )
19
19
set (PROJECT_COPYRIGTH "Copyright \\ 251 2025 Mikhail Milovidov. Some Rights Reserved" )
20
20
21
+ option (PORTABLE_BUILD "portable install packages" OFF )
22
+ option (APPONLY_BUILD "build only application with static deps linkage" OFF )
23
+ option (CONAN_BUILD "build with conan specific changes" OFF )
24
+
21
25
option (SSH2_SUPPORT "ssh2 data provider support" ON )
22
26
option (YAML_SUPPORT "yaml data sources support" ON )
23
27
option (CONSOLE "daggy console application" ON )
24
- option (BUILD_SHARED_LIBS ON )
28
+
29
+ if (APPONLY_BUILD )
30
+ set (BUILD_SHARED_LIBS OFF )
31
+ set (CONSOLE ON )
32
+ endif ()
33
+
34
+ if (PORTABLE_BUILD )
35
+ set (CONAN_BUILD ON )
36
+ set (BUILD_SHARED_LIBS ON )
37
+ endif ()
25
38
26
39
if (SSH2_SUPPORT )
27
40
add_definitions (-DSSH2_SUPPORT )
@@ -31,14 +44,9 @@ if(YAML_SUPPORT)
31
44
add_definitions (-DYAML_SUPPORT )
32
45
endif ()
33
46
34
- if (CONAN_BUILD )
35
- add_definitions (-DCONAN_BUILD )
36
- endif ()
37
-
38
47
include_directories (${CMAKE_CURRENT_SOURCE_DIR} )
39
48
40
49
include (compiler )
41
-
42
50
include (CTest )
43
51
44
52
add_subdirectory (DaggyCore )
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ set(TARGET DaggyCore)
3
3
find_package (Qt6 COMPONENTS Core Network REQUIRED )
4
4
add_library (${TARGET} )
5
5
include (rpath_lib )
6
-
7
6
set_target_properties (${TARGET} PROPERTIES AUTOMOC ON )
8
7
9
8
target_sources (${TARGET}
Original file line number Diff line number Diff line change @@ -60,9 +60,8 @@ set(CPACK_IFW_PACKAGE_STYLE_SHEET ${CMAKE_CURRENT_LIST_DIR}/installer.qss)
60
60
set (CPACK_IFW_PACKAGE_TITLE_COLOR "#007A5C" )
61
61
set (CPACK_IFW_PACKAGE_NAME ${CPACK_PACKAGE_NAME} )
62
62
63
- if (PACKAGE_DEPS )
64
- include (package_deps )
65
- endif ()
63
+
64
+ include (package_deps )
66
65
67
66
IF (${CPACK_SYSTEM_NAME} MATCHES Windows )
68
67
IF (CMAKE_CL_64 )
Original file line number Diff line number Diff line change 1
- if (PACKAGE_DEPS )
1
+ if (PORTABLE_BUILD AND CONAN_BUILD )
2
2
install (TARGETS ${TARGET}
3
3
RUNTIME_DEPENDENCY_SET ${TARGET} _deps
4
4
)
@@ -13,5 +13,6 @@ if (PACKAGE_DEPS)
13
13
[=[.*system32\/.*\.dll]=]
14
14
[=[^\/(lib|usr\/lib|usr\/local\/lib\/lib64)]=]
15
15
DIRECTORIES ${CONAN_RUNTIME_LIB_DIRS} ${CONAN_LIB_DIRS}
16
+ DESTINATION ${CMAKE_INSTALL_LIBDIR} /${PROJECT_NAME}
16
17
)
17
18
endif ()
Original file line number Diff line number Diff line change 1
- if (CONAN_BUILD )
1
+ if (PORTABLE_BUILD )
2
2
if (APPLE )
3
- set_target_properties (${TARGET} PROPERTIES INSTALL_RPATH "@executable_path/../${CMAKE_INSTALL_LIBDIR} " )
3
+ set_target_properties (${TARGET} PROPERTIES INSTALL_RPATH "@executable_path/../${CMAKE_INSTALL_LIBDIR} ;@executable_path/../ ${CMAKE_INSTALL_LIBDIR} / ${PROJECT_NAME} " )
4
4
elseif (UNIX )
5
- set_target_properties (${TARGET} PROPERTIES INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR} " )
5
+ set_target_properties (${TARGET} PROPERTIES INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR} ;$ORIGIN/../ ${CMAKE_INSTALL_LIBDIR} / ${PROJECT_NAME} " )
6
6
endif ()
7
7
endif ()
Original file line number Diff line number Diff line change 1
- if (CONAN_BUILD )
1
+ if (PORTABLE_BUILD )
2
2
if (APPLE )
3
- set_target_properties (${TARGET} PROPERTIES INSTALL_RPATH "@loader_path" )
3
+ set_target_properties (${TARGET} PROPERTIES INSTALL_RPATH "@loader_path/ ${PROJECT_NAME} " )
4
4
elseif (UNIX )
5
- set_target_properties (${TARGET} PROPERTIES INSTALL_RPATH "$ORIGIN" )
5
+ set_target_properties (${TARGET} PROPERTIES INSTALL_RPATH "$ORIGIN/ ${PROJECT_NAME} " )
6
6
endif ()
7
7
endif ()
You can’t perform that action at this time.
0 commit comments