Skip to content

Commit

Permalink
Restart from scratch
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandrePTJ committed Dec 6, 2024
1 parent 168ec41 commit e6d778b
Show file tree
Hide file tree
Showing 133 changed files with 366 additions and 13,725 deletions.
84 changes: 9 additions & 75 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.11)
project(KemaiProject VERSION 0.11.1 LANGUAGES CXX)
cmake_minimum_required(VERSION 3.30)
project(KemaiProject VERSION 0.99.0 LANGUAGES CXX)

# Point CMake to the custom modules
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake)
Expand All @@ -20,103 +20,37 @@ if (KEMAI_BUILD_LOCAL_DEPENDENCIES)
include(FetchContent)
FetchContent_Declare(fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt
GIT_TAG 10.2.1
GIT_TAG 11.0.2
OVERRIDE_FIND_PACKAGE)
FetchContent_Declare(magic_enum
GIT_REPOSITORY https://github.com/Neargye/magic_enum.git
GIT_TAG v0.9.5
GIT_TAG v0.9.7
OVERRIDE_FIND_PACKAGE)
FetchContent_Declare(spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.14.0
OVERRIDE_FIND_PACKAGE)
FetchContent_Declare(range-v3
GIT_REPOSITORY https://github.com/ericniebler/range-v3.git
GIT_TAG 0.12.0
GIT_TAG v1.15.0
OVERRIDE_FIND_PACKAGE)
endif (KEMAI_BUILD_LOCAL_DEPENDENCIES)

# Find external dependencies
find_package(fmt REQUIRED)
find_package(magic_enum REQUIRED)
find_package(spdlog REQUIRED)
find_package(range-v3 REQUIRED)

# Setup Qt
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
find_package(Qt6 QUIET COMPONENTS Widgets Network LinguistTools)
if (NOT Qt6_FOUND)
message(NOTICE "Qt6 not found. Fallback to Qt5")
find_package(Qt5 COMPONENTS Widgets Network LinguistTools REQUIRED)
add_compile_definitions(UNICODE _UNICODE)
message(STATUS "Using Qt ${Qt5_VERSION}")
else ()
message(STATUS "Using Qt ${Qt6_VERSION}")
endif ()
find_package(Qt6 REQUIRED COMPONENTS Gui Network LinguistTools Quick)

# Write version to file to ease packaging
file(WRITE ${CMAKE_BINARY_DIR}/version.txt ${PROJECT_VERSION})

# Project code
add_subdirectory(src)

# Common package configuration
set(KEMAI_GUID "88815E44-85A0-469C-9740-B4887D456BAA")
set(KEMAI_PROJECT_NAME "Kemai")
set(CPACK_PACKAGE_NAME ${KEMAI_PROJECT_NAME})
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})

# OS Dependant options / configurations
if (WIN32)
# Hide console
if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
set(OS_BUNDLE WIN32)
endif ()

# Add Qt libs and installer for windows platform
include(WinDeployQt)

# Add OpenSSL binaries for installer
include(WinDeployOpenSSL)

# Package
set(DEPLOY_DIR .)
set(CPACK_GENERATOR WIX)
set(CPACK_WIX_UPGRADE_GUID ${KEMAI_GUID})
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${KEMAI_PROJECT_NAME})
set(CPACK_PACKAGE_EXECUTABLES Kemai;${KEMAI_PROJECT_NAME})
set(CPACK_CREATE_DESKTOP_LINKS Kemai;${KEMAI_PROJECT_NAME})
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE.txt)
elseif (APPLE)
set(OS_BUNDLE MACOSX_BUNDLE)
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12)
set(DEPLOY_DIR .)
set(CPACK_GENERATOR DragNDrop)
install(FILES LICENSE.txt DESTINATION ${DEPLOY_DIR})
else ()
include(GNUInstallDirs)
set(OS_BUNDLE)
set(DEPLOY_DIR bin)
# install(FILES share/kemai.desktop DESTINATION ${)
install(FILES share/kemai.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
)
install(FILES src/resources/icons/kimai.png
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/256x256/apps/
)
install(FILES LICENSE.txt DESTINATION ${CMAKE_INSTALL_DOCDIR}/)
endif ()

# Project code
add_subdirectory(src)

# Install targets and files
install(TARGETS Kemai DESTINATION ${DEPLOY_DIR})

if (WIN32)
windeployqt(Kemai ${DEPLOY_DIR})
windeployopenssl(${DEPLOY_DIR})
endif ()

include(CPack)
6 changes: 2 additions & 4 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
"minor": 30,
"patch": 0
},
"configurePresets": [
Expand All @@ -21,16 +21,14 @@
"name": "default-windows",
"hidden": true,
"cacheVariables": {
"CMAKE_PREFIX_PATH": "c:/Qt/6.7.2/msvc2019_64",
"OPENSSL_ROOT": "c:/Qt/Tools/OpenSSLv3/Win_x64",
"CMAKE_PREFIX_PATH": "c:/Qt/6.7.3/msvc2019_64",
"CMAKE_INSTALL_PREFIX": "dist"
}
},
{
"name": "default-macos",
"hidden": true,
"cacheVariables": {
"CMAKE_PREFIX_PATH": "$env{HOME}/Qt/6.7.2/macos",
"CMAKE_INSTALL_PREFIX": "dist"
}
},
Expand Down
65 changes: 0 additions & 65 deletions bundle/linux/create_appimage.sh

This file was deleted.

6 changes: 0 additions & 6 deletions bundle/linux/sysroot/kemai-wrapper.desktop

This file was deleted.

Binary file removed bundle/linux/sysroot/kemai-wrapper.png
Binary file not shown.
41 changes: 0 additions & 41 deletions bundle/linux/sysroot/usr/bin/kemai-wrapper.sh

This file was deleted.

19 changes: 0 additions & 19 deletions cmake/LocalizationTools.cmake

This file was deleted.

48 changes: 0 additions & 48 deletions cmake/WinDeployOpenSSL.cmake

This file was deleted.

62 changes: 0 additions & 62 deletions cmake/WinDeployQt.cmake

This file was deleted.

1 change: 0 additions & 1 deletion docs/_config.yml

This file was deleted.

Binary file removed docs/api_password.gif
Binary file not shown.
Binary file removed docs/kemai_settings.gif
Binary file not shown.
Binary file removed docs/screenshots/windows_add_project.jpg
Binary file not shown.
Binary file removed docs/screenshots/windows_running.jpg
Binary file not shown.
Binary file removed docs/screenshots/windows_settings.jpg
Binary file not shown.
Loading

0 comments on commit e6d778b

Please sign in to comment.