Skip to content

Commit

Permalink
style cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasMizera committed Aug 22, 2023
1 parent 5fd7bbe commit 97c1e8b
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 55 deletions.
2 changes: 1 addition & 1 deletion app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ endif ()

if (LNX)
target_link_libraries(Input PUBLIC Glib2::Glib2)
endif()
endif ()

if (IOS)
target_link_libraries(Input PUBLIC AppleFrameworks::CoreLocation)
Expand Down
106 changes: 52 additions & 54 deletions gallery/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cmake_minimum_required(VERSION 3.16)

project(
MerginMapsGallery
VERSION 0.1
LANGUAGES CXX
MerginMapsGallery
VERSION 0.1
LANGUAGES CXX
)

set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -14,87 +14,85 @@ set(QT6_VERSION
set(CMAKE_AUTORCC ON)

find_package(
Qt6 ${QT6_VERSION}
COMPONENTS Quick
Qml
Concurrent
Positioning
QuickControls2
Svg
Core
Core5Compat
REQUIRED
Qt6 ${QT6_VERSION}
COMPONENTS Quick
Qml
Concurrent
Positioning
QuickControls2
Svg
Core
Core5Compat
REQUIRED
)

qt_standard_project_setup()
qt_policy(SET QTP0001 NEW)

set(GALLERY_HDRS
helper.h
)
set(GALLERY_HDRS helper.h)

set(GALLERY_SRCS
helper.cpp
)
set(GALLERY_SRCS helper.cpp)

if (IOS OR ANDROID)
add_compile_definitions(MOBILE_OS)
add_compile_definitions(MOBILE_OS)
else ()
add_compile_definitions(DESKTOP_OS)
add_compile_definitions(DESKTOP_OS)

set(GALLERY_HDRS ${GALLERY_HDRS} hotreload.h)
set(GALLERY_SRCS ${GALLERY_SRCS} hotreload.cpp)
set(GALLERY_HDRS ${GALLERY_HDRS} hotreload.h)
set(GALLERY_SRCS ${GALLERY_SRCS} hotreload.cpp)

# todo: cp -r app/qmlV2 gallery/app/
# todo: cp -r app/qmlV2 gallery/app/

endif ()

qt_add_executable(
MerginMapsGallery
${GALLERY_SRCS}
${GALLERY_HDRS}
main.cpp
qml.qrc
fonts.qrc
../app/icons/icons.qrc
MerginMapsGallery
${GALLERY_SRCS}
${GALLERY_HDRS}
main.cpp
qml.qrc
fonts.qrc
../app/icons/icons.qrc
)

qt_add_qml_module(
MerginMapsGallery
URI gallery
VERSION 1.0
QML_FILES qml/Main.qml NO_GENERATE_QMLTYPES
RESOURCES mobile.qrc
MerginMapsGallery
URI gallery
VERSION 1.0
QML_FILES qml/Main.qml
NO_GENERATE_QMLTYPES
RESOURCES
mobile.qrc
)

qt_add_resources(fonts.qrc)

set_target_properties(
MerginMapsGallery
PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING
${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
MerginMapsGallery
PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING
${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)

target_link_libraries(MerginMapsGallery PRIVATE Qt6::Quick)

install(
TARGETS MerginMapsGallery
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
TARGETS MerginMapsGallery
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

qt_generate_deploy_qml_app_script(
TARGET
MerginMapsGallery
OUTPUT_SCRIPT
deploy_script
MACOS_BUNDLE_POST_BUILD
NO_UNSUPPORTED_PLATFORM_ERROR
DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM
TARGET
MerginMapsGallery
OUTPUT_SCRIPT
deploy_script
MACOS_BUNDLE_POST_BUILD
NO_UNSUPPORTED_PLATFORM_ERROR
DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM
)
install(SCRIPT ${deploy_script})

1 comment on commit 97c1e8b

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 23.08.450111 just submitted!

Please sign in to comment.