update
parent
b2bfdd17da
commit
32c0b4ccd6
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue