@@ -69,13 +69,31 @@ set(CMAKE_PREFIX_PATH
69
69
"${CMAKE_PREFIX_PATH} "
70
70
)
71
71
72
+
73
+
72
74
add_definitions (-DQT_NO_KEYWORDS)
73
- find_package (Qt5 REQUIRED Core Network)
74
- set (Qt5_INCLUDES ${Qt5_INCLUDES} ${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} )
75
- set (Qt5_LIBRARIES ${Qt5_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Network_LIBRARIES} )
75
+ add_definitions (-DQT_DISABLE_DEPRECATED_BEFORE=0)
76
+ if (NOT (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" ))
77
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DQT_DEPRECATED_WARNINGS" )
78
+ else ()
79
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_COMPILING_QSTRING_COMPAT_CPP -D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS" )
80
+ endif ()
76
81
77
- include_directories (${Qt5_INCLUDES} )
78
- set (QT_LIBRARIES "${Qt5_LIBRARIES} " )
82
+ set (CMAKE_INCLUDE_CURRENT_DIR ON )
83
+ set (CMAKE_AUTOMOC ON )
84
+ find_package (Qt5 REQUIRED COMPONENTS Core Network)
85
+ set (Qt5_LIBRARIES Qt5::Core Qt5::Network )
86
+ message ("Found Qt5 ${Qt5Core_VERSION} " )
87
+
88
+ message ("\n\n\n {Qt5_LIBRARIES}=${Qt5_LIBRARIES} " )
89
+
90
+ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" )
91
+ get_target_property (QtCore_location Qt5::Core LOCATION )
92
+ get_target_property (QtNetwork_location Qt5::Network LOCATION )
93
+ install (FILES ${QtCore_location}
94
+ ${QtNetwork_location}
95
+ DESTINATION ${LIB_INSTALL_DIR} )
96
+ endif ()
79
97
80
98
add_subdirectory (src)
81
99
#add_subdirectory(test)
@@ -95,6 +113,15 @@ add_subdirectory(src)
95
113
#endif(DOXYGEN_FOUND)
96
114
97
115
########### packaging ###############
116
+ # Specify additional runtime libraries that may not be detected. After
117
+ # inclusion any detected libraries will be appended to this.
118
+ set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
119
+ ${QtCore_location}
120
+ ${QtNetwork_location}
121
+ )
122
+
123
+ set (CMAKE_INSTALL_DEBUG_LIBRARIES TRUE )
124
+ set (MAKE_INSTALL_UCRT_LIBRARIES TRUE )
98
125
INCLUDE (InstallRequiredSystemLibraries)
99
126
100
127
if (NOT DEFINED VERSION_RELEASE)
0 commit comments