Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CMakeLists.txt « cli « src - github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f5c90df8d11700c08538efbf6f2de38f0088914a (plain)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#  Copyright (C) 2019 KeePassXC Team
#
#  This program is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 2 or (at your option)
#  version 3 of the License.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.

set(cli_SOURCES
        Add.cpp
        AddGroup.cpp
        Analyze.cpp
        Clip.cpp
        Close.cpp
        Create.cpp
        Command.cpp
        DatabaseCommand.cpp
        Diceware.cpp
        Edit.cpp
        Estimate.cpp
        Exit.cpp
        Export.cpp
        Generate.cpp
        Help.cpp
        Import.cpp
        List.cpp
        Locate.cpp
        Merge.cpp
        Move.cpp
        Open.cpp
        Remove.cpp
        RemoveGroup.cpp
        Show.cpp)

add_library(cli STATIC ${cli_SOURCES})
target_link_libraries(cli Qt5::Core Qt5::Widgets)

find_package(Readline)

if (READLINE_FOUND)
    target_compile_definitions(cli PUBLIC USE_READLINE)
    target_link_libraries(cli readline)
endif()

add_executable(keepassxc-cli keepassxc-cli.cpp)
target_link_libraries(keepassxc-cli
        cli
        keepassx_core
        Qt5::Core
        ${GCRYPT_LIBRARIES}
        ${sodium_LIBRARY_RELEASE}
        ${ARGON2_LIBRARIES}
        ${GPGERROR_LIBRARIES}
        ${ZLIB_LIBRARIES}
        ${ZXCVBN_LIBRARIES})

install(TARGETS keepassxc-cli
        BUNDLE DESTINATION . COMPONENT Runtime
        RUNTIME DESTINATION ${CLI_INSTALL_DIR} COMPONENT Runtime)

if(MINGW)
    install(CODE "include(BundleUtilities)
                  fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/keepassxc-cli.exe\" \"\" \"\")"
            COMPONENT Runtime)
endif()

if(APPLE AND WITH_APP_BUNDLE)
    add_custom_command(TARGET keepassxc-cli
                       POST_BUILD
                       COMMAND ${CMAKE_INSTALL_NAME_TOOL}
                            -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore
                                "@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore"
                            -change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui
                                "@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui"
                            -change /usr/local/opt/qt/lib/QtMacExtras.framework/Versions/5/QtMacExtras
                                "@executable_path/../Frameworks/QtMacExtras.framework/Versions/5/QtMacExtras"
                            -change /usr/local/opt/qt/lib/QtConcurrent.framework/Versions/5/QtConcurrent
                                "@executable_path/../Frameworks/QtConcurrent.framework/Versions/5/QtConcurrent"
                            -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore
                                "@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore"
                            -change /usr/local/opt/qt/lib/QtNetwork.framework/Versions/5/QtNetwork
                                "@executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork"
                            -change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets
                                "@executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets"
                            -change /usr/local/opt/qt/lib/QtSvg.framework/Versions/5/QtSvg
                                "@executable_path/../Frameworks/QtSvg.framework/Versions/5/QtSvg"
                            -change /usr/local/opt/libgcrypt/lib/libgcrypt.20.dylib
                                "@executable_path/../Frameworks/libgcrypt.20.dylib"
                            -change /usr/local/opt/argon2/lib/libargon2.1.dylib
                                "@executable_path/../Frameworks/libargon2.1.dylib"
                            -change /usr/local/opt/libgpg-error/lib/libgpg-error.0.dylib
                                "@executable_path/../Frameworks/libgpg-error.0.dylib"
                            -change /usr/local/opt/libsodium/lib/libsodium.23.dylib
                                "@executable_path/../Frameworks/libsodium.23.dylib"
                            -change /usr/local/opt/qrencode/lib/libqrencode.4.dylib
                                "@executable_path/../Frameworks/libqrencode.4.dylib"
                            -change /usr/local/opt/libyubikey/lib/libyubikey.0.dylib
                                "@executable_path/../Frameworks/libyubikey.0.dylib"
                            -change /usr/local/opt/ykpers/lib/libykpers-1.1.dylib
                                "@executable_path/../Frameworks/libykpers-1.1.dylib"
                            -change /usr/local/opt/quazip/lib/libquazip.1.dylib
                                "@executable_path/../Frameworks/libquazip.1.dylib"
                       keepassxc-cli
                       COMMENT "Changing linking of keepassxc-cli")

    # Copy app to staging directory for pre-install testing
    set(CLI_APP_DIR "${CMAKE_BINARY_DIR}/src/${CLI_INSTALL_DIR}")
    add_custom_command(TARGET keepassxc-cli
                       POST_BUILD
                       COMMAND ${CMAKE_COMMAND} -E copy keepassxc-cli ${CLI_APP_DIR}/keepassxc-cli
                       COMMENT "Copying keepassxc-cli inside the application")
endif()

if(APPLE OR UNIX)
    install(FILES ../../share/docs/man/keepassxc-cli.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1/)
endif()