summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2024-07-23 20:18:26 -0400
committerLouie S <louie@example.com>2024-07-23 20:18:26 -0400
commitf820f439910ef0243e6b9aded293190341b058ac (patch)
tree2030c6ecfde9e84cfec71b352c35942c7a11483c
parenta97729ff1b79196ce479a88324b6399918df5486 (diff)
Copy android-specific configurations from qtcreator
-rw-r--r--CMakeLists.txt54
1 files changed, 47 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b302e09..7f69e5b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -108,12 +108,44 @@ set(project_misc
configure_file(config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h @ONLY)
-add_executable(assignment-list
- ${project_sources}
- ${project_headers}
- ${project_uis}
- ${project_misc}
-)
+#add_executable(assignment-list
+# ${project_sources}
+# ${project_headers}
+# ${project_uis}
+# ${project_misc}
+#)
+
+if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
+ qt_add_executable(assignment-list
+ MANUAL_FINALIZATION
+ ${project_sources}
+ ${project_headers}
+ ${project_uis}
+ ${project_misc}
+ )
+# Define target properties for Android with Qt 6 as:
+# set_property(TARGET qt_quick_hello 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(assignment-list SHARED
+ ${project_sources}
+ ${project_headers}
+ ${project_uis}
+ ${project_misc}
+ )
+# 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(assignment-list
+ ${project_sources}
+ ${project_headers}
+ ${project_uis}
+ ${project_misc}
+ )
+ endif()
+endif()
# Avoid opening console on windows
set_target_properties(assignment-list PROPERTIES WIN32_EXECUTABLE ON)
@@ -124,7 +156,11 @@ target_link_libraries(assignment-list PUBLIC ${qt_libraries})
include(GNUInstallDirs)
# Do not install normally if on Windows (we will install to / rather than /bin of install location)
if(NOT CMAKE_SYSTEM MATCHES "Windows*")
- install(TARGETS assignment-list)
+ install(TARGETS assignment-list
+ BUNDLE DESTINATION .
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ )
endif()
# install desktop entry and icon
@@ -134,6 +170,10 @@ if(CMAKE_SYSTEM MATCHES "Linux.*")
install(FILES data/assignment-list.svg DESTINATION share/pixmaps)
endif()
+if(QT_VERSION_MAJOR EQUAL 6)
+ qt_finalize_executable(assignment-list)
+endif()
+
# CPack configuration
set(CPACK_PACKAGE_DESCRIPTION "A QT application for managing grouped tasks")
if(IS_RELEASE)