status-desktop/app/CMakeLists.txt

87 lines
2.8 KiB
CMake
Raw Normal View History

chore(CPP): Basic project configuration setup using Qt6 Considerations - Use versioned files. Versioned Qt CMake APIs are disabled to force explicit calls and say that we don't support older `QT`s - Don't use blobbing. Use `target_sources` and `qt_target_qml_sources` - Distribute `CMake` definitions closer to the context: main folders with their own `CMakeLists.txt` - Everything in libraries under `Status` namespace for cleaner code. - Includes are exposed with Module folder externally and without prefix internally - File/Folders name matches definitions they contain for uniformity that leads to cleaner code - All source files (cpp, qml, js ...) have to be added to one of the CMakeLists.txt files to be tracked by CMake build system. - Use BUILD_DEBUG, BUILD_RELEASE and BUILD_DEVELOPMENT variables from Helpers library - Avoid Include directories. Not needed anymore CMake `target_*` APIs handles this through `INTERFACE`, `PUBLIC` and `PRIVATE` scope identifiers - `StatusQ` is meant to be compiled as an external library, therefore StatusQ tests are kept inside its own directory - Forced CMake version to `3.21` for the latest features and fixes. It is desired to be kept as recent as possible due to its backward compatibility. Following Qt's shipped version might be an option - Depends on status-go changes to allow forcing of arm for apple silicon Found limitations to CMake Qt API with Qt 6.3 - Having `0` as major version when using `qt_add_qml_module` doesn't work. Qml engine reports loading the `qmldir` but won't load the plugin library and no error is reported outside that exposed types are not found. - `qt_target_qml_sources` doesn't work now, it generate a double copy error when deploying qml files in bin-directory. For now we stick with adding files using `qt_add_qml_module` central place - Need to add `OUTPUT_DIRECTORY` to `qt_add_qml_module` to use the workaround - If `MACOSX_BUNDLE` target property is set breaks importing of QML files. Disabled until fixed or workaround found - For an unknown reason application executable tries to include the `QML_ELEMENT` include files, therefore for now I include all the C++ qml elements in INTERFACE
2022-05-10 20:10:34 +00:00
set(QT_NO_CREATE_VERSIONLESS_FUNCTIONS true)
set(CMAKE_AUTORCC On)
find_package(Qt6 ${STATUS_QT_VERSION} COMPONENTS Quick REQUIRED)
qt6_standard_project_setup()
qt6_add_executable(${PROJECT_NAME})
chore(CPP): Basic project configuration setup using Qt6 Considerations - Use versioned files. Versioned Qt CMake APIs are disabled to force explicit calls and say that we don't support older `QT`s - Don't use blobbing. Use `target_sources` and `qt_target_qml_sources` - Distribute `CMake` definitions closer to the context: main folders with their own `CMakeLists.txt` - Everything in libraries under `Status` namespace for cleaner code. - Includes are exposed with Module folder externally and without prefix internally - File/Folders name matches definitions they contain for uniformity that leads to cleaner code - All source files (cpp, qml, js ...) have to be added to one of the CMakeLists.txt files to be tracked by CMake build system. - Use BUILD_DEBUG, BUILD_RELEASE and BUILD_DEVELOPMENT variables from Helpers library - Avoid Include directories. Not needed anymore CMake `target_*` APIs handles this through `INTERFACE`, `PUBLIC` and `PRIVATE` scope identifiers - `StatusQ` is meant to be compiled as an external library, therefore StatusQ tests are kept inside its own directory - Forced CMake version to `3.21` for the latest features and fixes. It is desired to be kept as recent as possible due to its backward compatibility. Following Qt's shipped version might be an option - Depends on status-go changes to allow forcing of arm for apple silicon Found limitations to CMake Qt API with Qt 6.3 - Having `0` as major version when using `qt_add_qml_module` doesn't work. Qml engine reports loading the `qmldir` but won't load the plugin library and no error is reported outside that exposed types are not found. - `qt_target_qml_sources` doesn't work now, it generate a double copy error when deploying qml files in bin-directory. For now we stick with adding files using `qt_add_qml_module` central place - Need to add `OUTPUT_DIRECTORY` to `qt_add_qml_module` to use the workaround - If `MACOSX_BUNDLE` target property is set breaks importing of QML files. Disabled until fixed or workaround found - For an unknown reason application executable tries to include the `QML_ELEMENT` include files, therefore for now I include all the C++ qml elements in INTERFACE
2022-05-10 20:10:34 +00:00
# TODO: Fix temporarly workaround until we make qt6_target_qml_sources work
# Adds qml files as /Status/Application/qml/.../<file name>
qt6_add_qml_module(${PROJECT_NAME}
URI Status.Application
VERSION 1.0
chore(CPP): Basic project configuration setup using Qt6 Considerations - Use versioned files. Versioned Qt CMake APIs are disabled to force explicit calls and say that we don't support older `QT`s - Don't use blobbing. Use `target_sources` and `qt_target_qml_sources` - Distribute `CMake` definitions closer to the context: main folders with their own `CMakeLists.txt` - Everything in libraries under `Status` namespace for cleaner code. - Includes are exposed with Module folder externally and without prefix internally - File/Folders name matches definitions they contain for uniformity that leads to cleaner code - All source files (cpp, qml, js ...) have to be added to one of the CMakeLists.txt files to be tracked by CMake build system. - Use BUILD_DEBUG, BUILD_RELEASE and BUILD_DEVELOPMENT variables from Helpers library - Avoid Include directories. Not needed anymore CMake `target_*` APIs handles this through `INTERFACE`, `PUBLIC` and `PRIVATE` scope identifiers - `StatusQ` is meant to be compiled as an external library, therefore StatusQ tests are kept inside its own directory - Forced CMake version to `3.21` for the latest features and fixes. It is desired to be kept as recent as possible due to its backward compatibility. Following Qt's shipped version might be an option - Depends on status-go changes to allow forcing of arm for apple silicon Found limitations to CMake Qt API with Qt 6.3 - Having `0` as major version when using `qt_add_qml_module` doesn't work. Qml engine reports loading the `qmldir` but won't load the plugin library and no error is reported outside that exposed types are not found. - `qt_target_qml_sources` doesn't work now, it generate a double copy error when deploying qml files in bin-directory. For now we stick with adding files using `qt_add_qml_module` central place - Need to add `OUTPUT_DIRECTORY` to `qt_add_qml_module` to use the workaround - If `MACOSX_BUNDLE` target property is set breaks importing of QML files. Disabled until fixed or workaround found - For an unknown reason application executable tries to include the `QML_ELEMENT` include files, therefore for now I include all the C++ qml elements in INTERFACE
2022-05-10 20:10:34 +00:00
QML_FILES
qml/main.qml
qml/Status/Application/Decorators/SplashScreen.qml
chore(CPP): Basic project configuration setup using Qt6 Considerations - Use versioned files. Versioned Qt CMake APIs are disabled to force explicit calls and say that we don't support older `QT`s - Don't use blobbing. Use `target_sources` and `qt_target_qml_sources` - Distribute `CMake` definitions closer to the context: main folders with their own `CMakeLists.txt` - Everything in libraries under `Status` namespace for cleaner code. - Includes are exposed with Module folder externally and without prefix internally - File/Folders name matches definitions they contain for uniformity that leads to cleaner code - All source files (cpp, qml, js ...) have to be added to one of the CMakeLists.txt files to be tracked by CMake build system. - Use BUILD_DEBUG, BUILD_RELEASE and BUILD_DEVELOPMENT variables from Helpers library - Avoid Include directories. Not needed anymore CMake `target_*` APIs handles this through `INTERFACE`, `PUBLIC` and `PRIVATE` scope identifiers - `StatusQ` is meant to be compiled as an external library, therefore StatusQ tests are kept inside its own directory - Forced CMake version to `3.21` for the latest features and fixes. It is desired to be kept as recent as possible due to its backward compatibility. Following Qt's shipped version might be an option - Depends on status-go changes to allow forcing of arm for apple silicon Found limitations to CMake Qt API with Qt 6.3 - Having `0` as major version when using `qt_add_qml_module` doesn't work. Qml engine reports loading the `qmldir` but won't load the plugin library and no error is reported outside that exposed types are not found. - `qt_target_qml_sources` doesn't work now, it generate a double copy error when deploying qml files in bin-directory. For now we stick with adding files using `qt_add_qml_module` central place - Need to add `OUTPUT_DIRECTORY` to `qt_add_qml_module` to use the workaround - If `MACOSX_BUNDLE` target property is set breaks importing of QML files. Disabled until fixed or workaround found - For an unknown reason application executable tries to include the `QML_ELEMENT` include files, therefore for now I include all the C++ qml elements in INTERFACE
2022-05-10 20:10:34 +00:00
qml/Status/Application/MainView/MainView.qml
qml/Status/Application/MainView/StatusApplicationSections.qml
qml/Status/Application/MainView/StatusApplicationSections/Wallet/WalletNavBarSection.qml
qml/Status/Application/Settings/ApplicationSettings.qml
chore(CPP): Basic project configuration setup using Qt6 Considerations - Use versioned files. Versioned Qt CMake APIs are disabled to force explicit calls and say that we don't support older `QT`s - Don't use blobbing. Use `target_sources` and `qt_target_qml_sources` - Distribute `CMake` definitions closer to the context: main folders with their own `CMakeLists.txt` - Everything in libraries under `Status` namespace for cleaner code. - Includes are exposed with Module folder externally and without prefix internally - File/Folders name matches definitions they contain for uniformity that leads to cleaner code - All source files (cpp, qml, js ...) have to be added to one of the CMakeLists.txt files to be tracked by CMake build system. - Use BUILD_DEBUG, BUILD_RELEASE and BUILD_DEVELOPMENT variables from Helpers library - Avoid Include directories. Not needed anymore CMake `target_*` APIs handles this through `INTERFACE`, `PUBLIC` and `PRIVATE` scope identifiers - `StatusQ` is meant to be compiled as an external library, therefore StatusQ tests are kept inside its own directory - Forced CMake version to `3.21` for the latest features and fixes. It is desired to be kept as recent as possible due to its backward compatibility. Following Qt's shipped version might be an option - Depends on status-go changes to allow forcing of arm for apple silicon Found limitations to CMake Qt API with Qt 6.3 - Having `0` as major version when using `qt_add_qml_module` doesn't work. Qml engine reports loading the `qmldir` but won't load the plugin library and no error is reported outside that exposed types are not found. - `qt_target_qml_sources` doesn't work now, it generate a double copy error when deploying qml files in bin-directory. For now we stick with adding files using `qt_add_qml_module` central place - Need to add `OUTPUT_DIRECTORY` to `qt_add_qml_module` to use the workaround - If `MACOSX_BUNDLE` target property is set breaks importing of QML files. Disabled until fixed or workaround found - For an unknown reason application executable tries to include the `QML_ELEMENT` include files, therefore for now I include all the C++ qml elements in INTERFACE
2022-05-10 20:10:34 +00:00
qml/Status/Application/System/StatusTrayIcon.qml
qml/Status/Application/Workflows/CloseApplicationHandler.qml
qml/Status/Application/StatusContentView.qml
qml/Status/Application/MainShortcuts.qml
qml/Status/Application/StatusWindow.qml
SOURCES
res/app.qrc
chore(CPP): Basic project configuration setup using Qt6 Considerations - Use versioned files. Versioned Qt CMake APIs are disabled to force explicit calls and say that we don't support older `QT`s - Don't use blobbing. Use `target_sources` and `qt_target_qml_sources` - Distribute `CMake` definitions closer to the context: main folders with their own `CMakeLists.txt` - Everything in libraries under `Status` namespace for cleaner code. - Includes are exposed with Module folder externally and without prefix internally - File/Folders name matches definitions they contain for uniformity that leads to cleaner code - All source files (cpp, qml, js ...) have to be added to one of the CMakeLists.txt files to be tracked by CMake build system. - Use BUILD_DEBUG, BUILD_RELEASE and BUILD_DEVELOPMENT variables from Helpers library - Avoid Include directories. Not needed anymore CMake `target_*` APIs handles this through `INTERFACE`, `PUBLIC` and `PRIVATE` scope identifiers - `StatusQ` is meant to be compiled as an external library, therefore StatusQ tests are kept inside its own directory - Forced CMake version to `3.21` for the latest features and fixes. It is desired to be kept as recent as possible due to its backward compatibility. Following Qt's shipped version might be an option - Depends on status-go changes to allow forcing of arm for apple silicon Found limitations to CMake Qt API with Qt 6.3 - Having `0` as major version when using `qt_add_qml_module` doesn't work. Qml engine reports loading the `qmldir` but won't load the plugin library and no error is reported outside that exposed types are not found. - `qt_target_qml_sources` doesn't work now, it generate a double copy error when deploying qml files in bin-directory. For now we stick with adding files using `qt_add_qml_module` central place - Need to add `OUTPUT_DIRECTORY` to `qt_add_qml_module` to use the workaround - If `MACOSX_BUNDLE` target property is set breaks importing of QML files. Disabled until fixed or workaround found - For an unknown reason application executable tries to include the `QML_ELEMENT` include files, therefore for now I include all the C++ qml elements in INTERFACE
2022-05-10 20:10:34 +00:00
OUTPUT_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Status/Application
)
# Compile time definitions required by the project
2022-06-30 17:24:31 +00:00
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_PROJECT_NAME="${PROJECT_NAME}")
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_PROJECT_ORGANIZATION_DOMAIN="${PROJECT_ORGANIZATION_DOMAIN}")
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_PROJECT_ORGANIZATION_NAME="${PROJECT_ORGANIZATION_NAME}")
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_PROJECT_APPLICATION_NAME="${PROJECT_APPLICATION_NAME}")
chore(CPP): Basic project configuration setup using Qt6 Considerations - Use versioned files. Versioned Qt CMake APIs are disabled to force explicit calls and say that we don't support older `QT`s - Don't use blobbing. Use `target_sources` and `qt_target_qml_sources` - Distribute `CMake` definitions closer to the context: main folders with their own `CMakeLists.txt` - Everything in libraries under `Status` namespace for cleaner code. - Includes are exposed with Module folder externally and without prefix internally - File/Folders name matches definitions they contain for uniformity that leads to cleaner code - All source files (cpp, qml, js ...) have to be added to one of the CMakeLists.txt files to be tracked by CMake build system. - Use BUILD_DEBUG, BUILD_RELEASE and BUILD_DEVELOPMENT variables from Helpers library - Avoid Include directories. Not needed anymore CMake `target_*` APIs handles this through `INTERFACE`, `PUBLIC` and `PRIVATE` scope identifiers - `StatusQ` is meant to be compiled as an external library, therefore StatusQ tests are kept inside its own directory - Forced CMake version to `3.21` for the latest features and fixes. It is desired to be kept as recent as possible due to its backward compatibility. Following Qt's shipped version might be an option - Depends on status-go changes to allow forcing of arm for apple silicon Found limitations to CMake Qt API with Qt 6.3 - Having `0` as major version when using `qt_add_qml_module` doesn't work. Qml engine reports loading the `qmldir` but won't load the plugin library and no error is reported outside that exposed types are not found. - `qt_target_qml_sources` doesn't work now, it generate a double copy error when deploying qml files in bin-directory. For now we stick with adding files using `qt_add_qml_module` central place - Need to add `OUTPUT_DIRECTORY` to `qt_add_qml_module` to use the workaround - If `MACOSX_BUNDLE` target property is set breaks importing of QML files. Disabled until fixed or workaround found - For an unknown reason application executable tries to include the `QML_ELEMENT` include files, therefore for now I include all the C++ qml elements in INTERFACE
2022-05-10 20:10:34 +00:00
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_BINARY_DIR=${CMAKE_BINARY_DIR})
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_SOURCE_DIR=${CMAKE_SOURCE_DIR})
add_subdirectory(qml/Status/Application/Navigation)
chore(CPP): Basic project configuration setup using Qt6 Considerations - Use versioned files. Versioned Qt CMake APIs are disabled to force explicit calls and say that we don't support older `QT`s - Don't use blobbing. Use `target_sources` and `qt_target_qml_sources` - Distribute `CMake` definitions closer to the context: main folders with their own `CMakeLists.txt` - Everything in libraries under `Status` namespace for cleaner code. - Includes are exposed with Module folder externally and without prefix internally - File/Folders name matches definitions they contain for uniformity that leads to cleaner code - All source files (cpp, qml, js ...) have to be added to one of the CMakeLists.txt files to be tracked by CMake build system. - Use BUILD_DEBUG, BUILD_RELEASE and BUILD_DEVELOPMENT variables from Helpers library - Avoid Include directories. Not needed anymore CMake `target_*` APIs handles this through `INTERFACE`, `PUBLIC` and `PRIVATE` scope identifiers - `StatusQ` is meant to be compiled as an external library, therefore StatusQ tests are kept inside its own directory - Forced CMake version to `3.21` for the latest features and fixes. It is desired to be kept as recent as possible due to its backward compatibility. Following Qt's shipped version might be an option - Depends on status-go changes to allow forcing of arm for apple silicon Found limitations to CMake Qt API with Qt 6.3 - Having `0` as major version when using `qt_add_qml_module` doesn't work. Qml engine reports loading the `qmldir` but won't load the plugin library and no error is reported outside that exposed types are not found. - `qt_target_qml_sources` doesn't work now, it generate a double copy error when deploying qml files in bin-directory. For now we stick with adding files using `qt_add_qml_module` central place - Need to add `OUTPUT_DIRECTORY` to `qt_add_qml_module` to use the workaround - If `MACOSX_BUNDLE` target property is set breaks importing of QML files. Disabled until fixed or workaround found - For an unknown reason application executable tries to include the `QML_ELEMENT` include files, therefore for now I include all the C++ qml elements in INTERFACE
2022-05-10 20:10:34 +00:00
add_subdirectory(src)
include(${CMAKE_SOURCE_DIR}/cmake/platform_specific.cmake)
string(TOLOWER ${PROJECT_ORGANIZATION_NAME} URL_ORGANIZATION_NAME)
configure_app_os_specific(${PROJECT_NAME} ${URL_ORGANIZATION_NAME} ${PROJECT_ORGANIZATION_DOMAIN} ${PROJECT_VERSION_MAJOR} ${PROJECT_VERSION_MINOR} ${PROJECT_VERSION_PATCH})
target_compile_definitions(${PROJECT_NAME}
PRIVATE
$<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>
)
target_link_libraries(${PROJECT_NAME}
PRIVATE
Qt6::Quick
Status::Application::Navigation
chore(CPP): Basic project configuration setup using Qt6 Considerations - Use versioned files. Versioned Qt CMake APIs are disabled to force explicit calls and say that we don't support older `QT`s - Don't use blobbing. Use `target_sources` and `qt_target_qml_sources` - Distribute `CMake` definitions closer to the context: main folders with their own `CMakeLists.txt` - Everything in libraries under `Status` namespace for cleaner code. - Includes are exposed with Module folder externally and without prefix internally - File/Folders name matches definitions they contain for uniformity that leads to cleaner code - All source files (cpp, qml, js ...) have to be added to one of the CMakeLists.txt files to be tracked by CMake build system. - Use BUILD_DEBUG, BUILD_RELEASE and BUILD_DEVELOPMENT variables from Helpers library - Avoid Include directories. Not needed anymore CMake `target_*` APIs handles this through `INTERFACE`, `PUBLIC` and `PRIVATE` scope identifiers - `StatusQ` is meant to be compiled as an external library, therefore StatusQ tests are kept inside its own directory - Forced CMake version to `3.21` for the latest features and fixes. It is desired to be kept as recent as possible due to its backward compatibility. Following Qt's shipped version might be an option - Depends on status-go changes to allow forcing of arm for apple silicon Found limitations to CMake Qt API with Qt 6.3 - Having `0` as major version when using `qt_add_qml_module` doesn't work. Qml engine reports loading the `qmldir` but won't load the plugin library and no error is reported outside that exposed types are not found. - `qt_target_qml_sources` doesn't work now, it generate a double copy error when deploying qml files in bin-directory. For now we stick with adding files using `qt_add_qml_module` central place - Need to add `OUTPUT_DIRECTORY` to `qt_add_qml_module` to use the workaround - If `MACOSX_BUNDLE` target property is set breaks importing of QML files. Disabled until fixed or workaround found - For an unknown reason application executable tries to include the `QML_ELEMENT` include files, therefore for now I include all the C++ qml elements in INTERFACE
2022-05-10 20:10:34 +00:00
# TODO: Use Status:: namespace
Status::ApplicationCore
Status::Helpers
Status::Onboarding
Status::Assets
Status::StatusQ
Status::StatusGoQt
chore(CPP): Basic project configuration setup using Qt6 Considerations - Use versioned files. Versioned Qt CMake APIs are disabled to force explicit calls and say that we don't support older `QT`s - Don't use blobbing. Use `target_sources` and `qt_target_qml_sources` - Distribute `CMake` definitions closer to the context: main folders with their own `CMakeLists.txt` - Everything in libraries under `Status` namespace for cleaner code. - Includes are exposed with Module folder externally and without prefix internally - File/Folders name matches definitions they contain for uniformity that leads to cleaner code - All source files (cpp, qml, js ...) have to be added to one of the CMakeLists.txt files to be tracked by CMake build system. - Use BUILD_DEBUG, BUILD_RELEASE and BUILD_DEVELOPMENT variables from Helpers library - Avoid Include directories. Not needed anymore CMake `target_*` APIs handles this through `INTERFACE`, `PUBLIC` and `PRIVATE` scope identifiers - `StatusQ` is meant to be compiled as an external library, therefore StatusQ tests are kept inside its own directory - Forced CMake version to `3.21` for the latest features and fixes. It is desired to be kept as recent as possible due to its backward compatibility. Following Qt's shipped version might be an option - Depends on status-go changes to allow forcing of arm for apple silicon Found limitations to CMake Qt API with Qt 6.3 - Having `0` as major version when using `qt_add_qml_module` doesn't work. Qml engine reports loading the `qmldir` but won't load the plugin library and no error is reported outside that exposed types are not found. - `qt_target_qml_sources` doesn't work now, it generate a double copy error when deploying qml files in bin-directory. For now we stick with adding files using `qt_add_qml_module` central place - Need to add `OUTPUT_DIRECTORY` to `qt_add_qml_module` to use the workaround - If `MACOSX_BUNDLE` target property is set breaks importing of QML files. Disabled until fixed or workaround found - For an unknown reason application executable tries to include the `QML_ELEMENT` include files, therefore for now I include all the C++ qml elements in INTERFACE
2022-05-10 20:10:34 +00:00
)
# QtCreator needs this
set(QML_IMPORT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/qml;${QML_IMPORT_PATH} CACHE STRING "For QtCreator" FORCE)
list(REMOVE_DUPLICATES QML_IMPORT_PATH)
install(
TARGETS
${PROJECT_NAME}
RUNTIME
)