0 Star 0 Fork 2

StoneGo/mnsui

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt-win 3.42 KB
一键复制 编辑 原始数据 按行查看 历史
StoneGo 提交于 2024-03-01 19:49 . build for windows
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()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/stonego/mnsui.git
git@gitee.com:stonego/mnsui.git
stonego
mnsui
mnsui
master

搜索帮助