This commit is contained in:
duanshengchao 2024-07-24 10:15:29 +08:00
parent be2db39352
commit 8ddb353c9d
1 changed files with 43 additions and 4 deletions

View File

@ -9,6 +9,8 @@ find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets REQUIRED)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
#ui.h
set(CMAKE_AUTOUIC_SEARCH_PATHS "ui")
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
set(pd_PlatformDir "x86")
@ -26,11 +28,48 @@ else()
endif()
endif()
add_executable(PowerDesigner WIN32
main.cpp
mainwindow.cpp
mainwindow.ui
set(H_HEADER_FILES
include/mainwindow.h
)
set(CPP_SOURCE_FILES
source/main.cpp
source/mainwindow.cpp
)
set(UI_FILES
ui/mainwindow.ui
)
#
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(PowerDesigner
MANUAL_FINALIZATION
${H_HEADER_FILES}
${CPP_SOURCE_FILES}
${UI_FILES}
resource/PowerDesigner.qrc
)
else()
if(ANDROID)
add_library(PowerDesigner SHARED
${H_HEADER_FILES}
${CPP_SOURCE_FILES}
${UI_FILES}
resource/PowerDesigner.qrc
)
else()
add_executable(PowerDesigner WIN32
${H_HEADER_FILES}
${CPP_SOURCE_FILES}
${UI_FILES}
resource/PowerDesigner.qrc
)
endif()
endif()
include_directories(include)
target_include_directories(PowerDesigner PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../src")
target_link_libraries(PowerDesigner PRIVATE qt${QT_VERSION_MAJOR}advanceddocking)
target_link_libraries(PowerDesigner PUBLIC Qt${QT_VERSION_MAJOR}::Core