Skip to content

Commit

Permalink
try fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tamlok committed May 8, 2024
1 parent 2f161f0 commit 5e5de4d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 35 deletions.
32 changes: 16 additions & 16 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,22 @@ if (WIN32)
elseif(APPLE)

else()
desktop.path = applications
desktop.files = data/core/vnote.desktop
icon16.path = icons/hicolor/16x16/apps
icon16.files = data/core/logo/16x16/vnote.png
icon32.path = icons/hicolor/32x32/apps
icon32.files = data/core/logo/32x32/vnote.png
icon48.path = icons/hicolor/48x48/apps
icon48.files = data/core/logo/48x48/vnote.png
icon64.path = icons/hicolor/64x64/apps
icon64.files = data/core/logo/64x64/vnote.png
icon128.path = icons/hicolor/128x128/apps
icon128.files = data/core/logo/128x128/vnote.png
icon256.path = icons/hicolor/256x256/apps
icon256.files = data/core/logo/256x256/vnote.png
iconsvg.path = icons/hicolor/scalable/apps
iconsvg.files = data/core/logo/vnote.svg
set(desktop.path applications)
set(desktop.files data/core/vnote.desktop)
set(icon16.path icons/hicolor/16x16/apps)
set(icon16.files data/core/logo/16x16/vnote.png)
set(icon32.path icons/hicolor/32x32/apps)
set(icon32.files data/core/logo/32x32/vnote.png)
set(icon48.path icons/hicolor/48x48/apps)
set(icon48.files data/core/logo/48x48/vnote.png)
set(icon64.path icons/hicolor/64x64/apps)
set(icon64.files data/core/logo/64x64/vnote.png)
set(icon128.path icons/hicolor/128x128/apps)
set(icon128.files data/core/logo/128x128/vnote.png)
set(icon256.path icons/hicolor/256x256/apps)
set(icon256.files data/core/logo/256x256/vnote.png)
set(iconsvg.path icons/hicolor/scalable/apps)
set(iconsvg.files data/core/logo/vnote.svg)
foreach(items IN ITEMS desktop icon16 icon32 icon48 icon64 icon128 icon256 iconsvg)
install(FILES ${CMAKE_CURRENT_LIST_DIR}/${${items}.files}
DESTINATION share/${${items}.path}
Expand Down
9 changes: 5 additions & 4 deletions src/CPackLinuxDeployQt.cmake.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
set(VX_DEST_DIR "${CPACK_PACKAGE_DIRECTORY}/_CPack_Packages/Linux/External/AppImage")
set(VX_DESKTOP_FILE "${VX_DEST_DIR}${CMAKE_INSTALL_PREFIX}/share/applications/vnote.desktop")
message(STATUS "VX_APPIMAGE_DEST_DIR ${VX_APPIMAGE_DEST_DIR}")
message(STATUS "VX_APPIMAGE_DESKTOP_FILE ${VX_APPIMAGE_DESKTOP_FILE}")

execute_process(
COMMAND ${CMAKE_MAKE_PROGRAM} DESTDIR="${VX_DEST_DIR}" install
COMMAND ${CMAKE_MAKE_PROGRAM} DESTDIR=${VX_APPIMAGE_DEST_DIR} install
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
execute_process(
COMMAND env QMAKE=${qmake_executable} "${LINUXDEPLOY_EXECUTABLE}" --plugin=qt --output=appimage --appdir="${VX_DEST_DIR}" -e ${CMAKE_BINARY_DIR}/${target} -d "${VX_DESKTOP_FILE}"
COMMAND env QMAKE=${qmake_executable} "${LINUXDEPLOY_EXECUTABLE}" --plugin=qt --output=appimage --appdir=${VX_APPIMAGE_DEST_DIR} -e ${CMAKE_CURRENT_BINARY_DIR}/vnote -d ${VX_APPIMAGE_DESKTOP_FILE}
WORKING_DIRECTORY ${CPACK_PACKAGE_DIRECTORY})
20 changes: 5 additions & 15 deletions src/Packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,6 @@ find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${QT_BIN_DIR}")
find_program(MACDEPLOYQTFIX_EXECUTABLE macdeployqtfix.py HINTS "${QT_BIN_DIR}")
find_package(Python)

function(linuxdeployqt dest_dir desktop_file)
add_custom_command(
TARGET pack PRE_BUILD
COMMAND "${CMAKE_MAKE_PROGRAM}" DESTDIR=${dest_dir} install
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_custom_command(
TARGET pack POST_BUILD
COMMAND env QMAKE=${qmake_executable} "${LINUXDEPLOY_EXECUTABLE}" --appdir=${dest_dir} --plugin=qt --output=appimage -e ${CMAKE_BINARY_DIR}/${target} -d ${destdir}/${CMAKE_INSTALL_PREFIX}/${desktopfile}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endfunction()

function(windeployqt target)
# Bundle Library Files
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER)
Expand All @@ -38,8 +27,6 @@ function(windeployqt target)
endif()
endif()

message(INFO " debug: windeployqt:${WINDEPLOYQT_EXECUTABLE}")

add_custom_target(deploy
COMMAND "${CMAKE_COMMAND}" -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/winqt/"
COMMAND "${CMAKE_COMMAND}" -E
Expand Down Expand Up @@ -68,10 +55,10 @@ function(windeployqt target)
cmake_path(NORMAL_PATH OPENSSL_LIBS_FILES OUTPUT_VARIABLE OPENSSL_LIBS_FILES)
install(FILES ${OPENSSL_LIBS_FILES} DESTINATION "${CMAKE_INSTALL_BINDIR}" OPTIONAL)

message(INFO " debug: OpenSSLExtraLIBDIR:${OPENSSL_EXTRA_LIB_DIR}")
message(STATUS "OpenSSLExtraLIBDIR:${OPENSSL_EXTRA_LIB_DIR}")
file(GLOB OPENSSL_EXTRA_LIB_FILES "${OPENSSL_EXTRA_LIB_DIR}/lib*.dll")
cmake_path(NORMAL_PATH OPENSSL_EXTRA_LIB_FILES OUTPUT_VARIABLE OPENSSL_EXTRA_LIB_FILES)
message(INFO " debug: OpenSSLExtraLibFiles:${OPENSSL_EXTRA_LIB_FILES}")
message(STATUS "OpenSSLExtraLibFiles:${OPENSSL_EXTRA_LIB_FILES}")
install(FILES ${OPENSSL_EXTRA_LIB_FILES} DESTINATION "${CMAKE_INSTALL_BINDIR}" OPTIONAL)

set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
Expand Down Expand Up @@ -132,10 +119,13 @@ if(WIN32)
windeployqt(vnote)
elseif(APPLE)
else()
message(STATUS "LinuxDeployExecutable: ${LINUXDEPLOY_EXECUTABLE}")
if(LINUXDEPLOY_EXECUTABLE)
message(STATUS "Package generation - Linux - AppImage")

set(CPACK_GENERATOR "External;${CPACK_GENERATOR}")
set(VX_APPIMAGE_DEST_DIR "${CPACK_PACKAGE_DIRECTORY}/_CPack_Packages/Linux/External/AppImage")
set(VX_APPIMAGE_DESKTOP_FILE "${VX_APPIMAGE_DEST_DIR}${CMAKE_INSTALL_PREFIX}/share/applications/vnote.desktop")
configure_file(${CMAKE_CURRENT_LIST_DIR}/CPackLinuxDeployQt.cmake.in "${CMAKE_BINARY_DIR}/CPackExternal.cmake")
set(CPACK_EXTERNAL_PACKAGE_SCRIPT "${CMAKE_BINARY_DIR}/CPackExternal.cmake")
endif()
Expand Down

0 comments on commit 5e5de4d

Please sign in to comment.