From 32c0b4ccd6bb0f7ed1bba25ecab84e74e5ee79d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A?= Date: Sat, 1 Apr 2023 21:37:07 +0800 Subject: [PATCH] update --- .DS_Store | Bin 0 -> 6148 bytes src/CMakeLists.txt | 4 +++- src/build_macos.cmake | 27 +++++++++++---------------- src/macos_install.sh | 0 4 files changed, 14 insertions(+), 17 deletions(-) create mode 100644 .DS_Store mode change 100644 => 100755 src/macos_install.sh diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5172429f264de2441865cb4700216d4256da9242 GIT binary patch literal 6148 zcmeH~J!%6%427R!7lt%jx}3%b$PET#pTHLgIFQEJ;E>dF^gR7ES*H$5cmnB-G%I%Z zD|S`@Z2$T80!#olbXV*=%*>dt@PRwdU#I)^a=X5>;#J@&VrHyNnC;iLL0pQvfVyTmjO&;ssLc!1UOG})p;=82 zR;?Ceh}WZ?+UmMqI#RP8R>OzYoz15hnq@nzF`-!xQ4j$Um=RcIKKc27r2jVm&svm< zfC&6E0=7P!4tu^-ovjbA=k?dB`g+i*aXG_}p8zI)6mRKa+;6_1_R^8c3Qa!(fk8n8 H{*=HsM+*^= literal 0 HcmV?d00001 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 201b8ba..bde9938 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,7 +8,7 @@ set(CMAKE_AUTOUIC ON) find_package(Qt6 COMPONENTS Core Quick Svg REQUIRED) set(QT_INSTALL_QML ${Qt6Core_DIR}/../../../qml) set(TARGET_TYPE SHARED) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/FluentUI) + set(TARGET_RESOURCES res.qrc) set(TARGET_SOURCES Def.cpp @@ -46,6 +46,8 @@ endif() add_library(${PROJECT_NAME} ${TARGET_TYPE} ${TARGET_SOURCES} ${TARGET_HEADERS} ${TARGET_RESOURCES}) +set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/FluentUI) + target_compile_definitions(${PROJECT_NAME} PRIVATE VERSION_IN=\\\"1.0.0\\\" URI_STR=\\\"FluentUI\\\") if(WIN32) diff --git a/src/build_macos.cmake b/src/build_macos.cmake index 93fe68a..254942a 100644 --- a/src/build_macos.cmake +++ b/src/build_macos.cmake @@ -1,37 +1,32 @@ -set(OUTP "${CMAKE_CURRENT_BINARY_DIR}/../bin/FluentUI/") +set(OUTP ${CMAKE_BINARY_DIR}/bin/FluentUI/) add_definitions(-DMACOS) -# Set DESTDIR to the output directory set(CMAKE_INSTALL_PREFIX ${OUTP}) set(CMAKE_INSTALL_DESTDIR ${OUTP}) -# Add the current source directory to the include path include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -# Set MOC options set(QMAKE_MOC_OPTIONS -Muri=${uri}) -# Set pre-link commands add_custom_command( - TARGET ${PROJECT_NAME} PRE_LINK + TARGET ${PROJECT_NAME} POST_BUILD COMMAND chmod -R 777 ${CMAKE_CURRENT_SOURCE_DIR}/macos_install.sh +) + +add_custom_command( + TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/macos_install.sh PRESET ${CMAKE_CURRENT_SOURCE_DIR}/ ${OUTP} ) -# Set post-link commands for shared library -if(BUILD_SHARED_LIBS) - # Set INST_QMLPATH variable - set(INST_QMLPATH "${QT_INSTALL_QML}/${uri}" REPLACE "\\" "/") - # Set post-link command + +if(${TARGET_TYPE} STREQUAL "SHARED") + + set(INST_QMLPATH ${QT_INSTALL_QML}/FluentUI) add_custom_command( - TARGET ${PROJECT_NAME} POST_LINK + TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/macos_install.sh INSTALL ${CMAKE_CURRENT_SOURCE_DIR}/ ${OUTP} ${INST_QMLPATH} ) - # Include dev.pri if it exists - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../../dev.pri) - include(${CMAKE_CURRENT_SOURCE_DIR}/../../dev.pri) - endif() endif() diff --git a/src/macos_install.sh b/src/macos_install.sh old mode 100644 new mode 100755