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