Copying Fonts/Assets/Icons folders to build dir.
fonts ----> app_build/ assets ---> app_build/examples/ icons ----> app_build/components/
This commit is contained in:
parent
f1f696c5dc
commit
5b1269dcfa
|
@ -12,18 +12,10 @@ set(CMAKE_CXX_STANDARD 11)
|
|||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Gui REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core5Compat REQUIRED)
|
||||
|
||||
add_subdirectory(components)
|
||||
add_subdirectory(examples)
|
||||
|
||||
#set(PROJECT_SOURCES
|
||||
|
||||
#)
|
||||
|
||||
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
||||
# qt_add_executable(QtMaterialWidgets
|
||||
# MANUAL_FINALIZATION
|
||||
|
@ -35,9 +27,7 @@ if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
|||
# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
|
||||
else()
|
||||
if(ANDROID)
|
||||
add_library(QtMaterialWidgets SHARED
|
||||
${PROJECT_SOURCES}
|
||||
)
|
||||
add_library(QtMaterialWidgets SHARED ${PROJECT_SOURCES})
|
||||
# Define properties for Android with Qt 5 after find_package() calls as:
|
||||
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
|
||||
else()
|
||||
|
@ -47,10 +37,6 @@ else()
|
|||
endif()
|
||||
endif()
|
||||
|
||||
#target_link_libraries(QtMaterialWidgets PRIVATE Qt${QT_VERSION_MAJOR}::Core)
|
||||
#target_link_libraries(QtMaterialWidgets PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
|
||||
#target_link_libraries(QtMaterialWidgets PRIVATE Qt${QT_VERSION_MAJOR}::Core5Compat)
|
||||
|
||||
|
||||
#set_target_properties(QtMaterialWidgets PROPERTIES
|
||||
# MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
|
||||
|
@ -60,7 +46,7 @@ endif()
|
|||
# WIN32_EXECUTABLE TRUE
|
||||
#)
|
||||
|
||||
#file(COPY assets DESTINATION ${CMAKE_BINARY_DIR})
|
||||
file(COPY fonts DESTINATION ${CMAKE_BINARY_DIR})
|
||||
|
||||
if(QT_VERSION_MAJOR EQUAL 6)
|
||||
# qt_finalize_executable(QtMaterialWidgets)
|
||||
|
|
|
@ -21,6 +21,7 @@ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS StateMachine REQUIRED)
|
|||
# Create a library called "components" which includes the source file "*.cpp".
|
||||
# The extension is already found. Any number of sources could be listed here.
|
||||
set(PROJECT_SOURCES
|
||||
# sources
|
||||
avatar.cpp
|
||||
lib/style.cpp
|
||||
lib/theme.cpp
|
||||
|
@ -68,6 +69,7 @@ set(PROJECT_SOURCES
|
|||
menu_internal.cpp
|
||||
list.cpp
|
||||
listitem.cpp
|
||||
# headers
|
||||
avatar_p.h
|
||||
avatar.h
|
||||
lib/style_p.h
|
||||
|
@ -169,11 +171,10 @@ target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::Gui)
|
|||
target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::Core5Compat)
|
||||
target_link_libraries(components PRIVATE Qt${QT_VERSION_MAJOR}::StateMachine)
|
||||
|
||||
# Make sure the compiler can find include files for our components library
|
||||
# Make sure the compiler can find include files for our 'components' library
|
||||
# when other libraries or executables link to components
|
||||
target_include_directories (components PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
|
||||
set_target_properties(components PROPERTIES
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
|
||||
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
||||
|
@ -182,7 +183,7 @@ set_target_properties(components PROPERTIES
|
|||
WIN32_EXECUTABLE TRUE
|
||||
)
|
||||
|
||||
file(COPY icons DESTINATION ${CMAKE_BINARY_DIR})
|
||||
file(COPY icons DESTINATION ${CMAKE_BINARY_DIR}/components)
|
||||
|
||||
if(QT_VERSION_MAJOR EQUAL 6)
|
||||
# qt_finalize_executable(components)
|
||||
|
|
|
@ -90,25 +90,18 @@ set(PROJECT_SOURCES
|
|||
)
|
||||
|
||||
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
||||
qt_add_executable(examples
|
||||
MANUAL_FINALIZATION
|
||||
${PROJECT_SOURCES}
|
||||
)
|
||||
qt_add_executable(examples MANUAL_FINALIZATION ${PROJECT_SOURCES})
|
||||
# Define target properties for Android with Qt 6 as:
|
||||
# set_property(TARGET examples APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/android)
|
||||
# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
|
||||
else()
|
||||
if(ANDROID)
|
||||
add_library(examples SHARED
|
||||
${PROJECT_SOURCES}
|
||||
)
|
||||
add_library(examples SHARED ${PROJECT_SOURCES})
|
||||
# Define properties for Android with Qt 5 after find_package() calls as:
|
||||
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
|
||||
else()
|
||||
add_executable(examples
|
||||
${PROJECT_SOURCES}
|
||||
)
|
||||
add_executable(examples ${PROJECT_SOURCES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -133,7 +126,7 @@ set_target_properties(examples PROPERTIES
|
|||
WIN32_EXECUTABLE TRUE
|
||||
)
|
||||
|
||||
file(COPY assets DESTINATION ${CMAKE_BINARY_DIR})
|
||||
file(COPY assets DESTINATION ${CMAKE_BINARY_DIR}/examples)
|
||||
|
||||
if(QT_VERSION_MAJOR EQUAL 6)
|
||||
qt_finalize_executable(examples)
|
||||
|
|
Loading…
Reference in New Issue