代码拉取完成,页面将自动刷新
cmake_minimum_required(VERSION 3.5)
project(mnsui VERSION 0.1)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
### set Qt6_DIR to your Qt installation path
# set(Qt6_DIR /home/mycat/Qt/6.6.2/gcc_64/lib/cmake/Qt6)
# set(Qt6_DIR /Users/stonego/Qt/6.6.2/macos/lib/cmake/Qt6)
### set MU to your application installation path
# set (MU /usr/local)
# set (MU /ssd1/mycat/usr)
# set (MU /Users/stonego/usr)
set(MY_INSTALL_LIBDIR, ${MU}/lib)
set(MY_INSTALL_BINDIR, ${MU}/bin)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Charts)
IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
MESSAGE(STATUS "current platform: Linux ")
add_definitions(-D_LINUX_)
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")
MESSAGE(STATUS "current platform: Windows")
add_definitions(-D_MSWIN_)
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
MESSAGE(STATUS "current platform: Mac OS X")
add_definitions(-D_MACOS_)
ELSE ()
MESSAGE(STATUS "other platform: ${CMAKE_SYSTEM_NAME}")
add_definitions(-D_OTHER_)
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")
qt_standard_project_setup()
include(GNUInstallDirs)
include_directories(
include
)
link_directories(
/usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
/lib
/lib64
${MU}/lib
${MU}/lib64
)
#configuration types
SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
IF(DEFINED CMAKE_BUILD_TYPE AND CMAKE_VERSION VERSION_GREATER "2.8")
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES})
ENDIF()
set(SOURCE_CODE
src/datachart.h
src/mainwidget.h
src/renderarea.h
src/ticker.h
src/udps.h
src/datachart.cpp
src/main.cpp
src/mainwidget.cpp
src/renderarea.cpp
src/ticker.c
src/udps.cpp
)
IF (CMAKE_BUILD_TYPE MATCHES Debug)
set(MNSUI mnsuid)
qt_add_executable(${MNSUI}
${SOURCE_CODE}
)
message("Debug build mnsuid")
set(CMAKE_C_FLAGS_DEBUG "-Wall -g")
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g")
set(CMAKE_DEBUG_POSTFIX "d")
add_definitions(-DSTONE_DEBUG=1)
set_target_properties(${MNSUI} PROPERTIES
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)
target_link_libraries(${MNSUI} PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Widgets
Qt6::Charts
)
target_link_libraries(${MNSUI} PRIVATE mttraded)
install(TARGETS ${MNSUI}
BUNDLE DESTINATION .
LIBRARY DESTINATION ${MY_INSTALL_LIBDIR}
RUNTIME DESTINATION ${MY_INSTALL_BINDIR}
)
ENDIF ()
IF (CMAKE_BUILD_TYPE MATCHES Release)
set(MNSUI mnsui)
qt_add_executable(${MNSUI}
${SOURCE_CODE}
)
message("Release build mnsui")
set(CMAKE_C_FLAGS "-Wall -pipe -m64 -O3 -flto=auto -ffast-math -march=native -funroll-loops -fomit-frame-pointer")
set(CMAKE_CXX_FLAGS "-Wall -pipe -m64 -O3 -flto=auto -ffast-math -march=native -funroll-loops -fomit-frame-pointer")
add_definitions(-DSTONE_DEBUG=0)
set_target_properties(${MNSUI} PROPERTIES
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)
target_link_libraries(${MNSUI} PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Widgets
Qt6::Charts
)
target_link_libraries(${MNSUI} PRIVATE mttrade)
install(TARGETS ${MNSUI}
BUNDLE DESTINATION .
LIBRARY DESTINATION ${MY_INSTALL_LIBDIR}
RUNTIME DESTINATION ${MY_INSTALL_BINDIR}
)
ENDIF () # Release Version
if(QT_VERSION_MAJOR EQUAL 6)
qt_finalize_executable(mnsui)
endif()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。