-
Notifications
You must be signed in to change notification settings - Fork 31
/
CMakeLists.txt
64 lines (54 loc) · 2.33 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
cmake_minimum_required(VERSION 3.10)
project(filesremote VERSION 1.13 LANGUAGES CXX)
SET(CMAKE_CXX_STANDARD 17)
set(MSYS_ORIG ${MSYS})
set(MSYS 0) # Because FindwxWidgets.cmake breaks due to some strange path handling when it knows its in MSYS.
find_package(wxWidgets COMPONENTS core base REQUIRED)
include("${wxWidgets_USE_FILE}")
set(MSYS ${MSYS_ORIG})
find_package(OpenSSL REQUIRED)
find_package(Libssh2 REQUIRED)
include_directories(${CMAKE_SOURCE_DIR})
add_subdirectory(src)
configure_file(version.h.in version.h)
target_include_directories(filesremote PUBLIC "${PROJECT_BINARY_DIR}")
if(MSYS) # Windows
message("Packaging for Windows")
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${PROJECT_VERSION}-Windows-x86_64-static")
install(
TARGETS filesremote
RUNTIME DESTINATION .
)
elseif(APPLE)
message("Packaging for macOS")
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${PROJECT_VERSION}-macOS-x86_64")
set_target_properties(filesremote PROPERTIES
OUTPUT_NAME "FilesRemote"
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
install(
TARGETS filesremote
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
BUNDLE DESTINATION .
)
elseif(UNIX)
message("Packaging for Linux")
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${PROJECT_VERSION}-Linux-x86_64-static")
set(CPACK_PACKAGE_VENDOR "Allan Boll")
set(CPACK_PACKAGE_CONTACT "Allan Boll <[email protected]>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "An SFTP file manager")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
install(
TARGETS filesremote
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(FILES FilesRemote.desktop DESTINATION share/applications )
install(FILES graphics/appicon/icon.svg DESTINATION share/icons/hicolor/scalable/apps RENAME FilesRemote.svg)
endif()
include(CPack)