2019-06-01 17:53:40 -04:00
|
|
|
# Copyright (C) 2019 KeePassXC Team
|
2011-07-06 14:23:29 -04:00
|
|
|
#
|
|
|
|
# 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/>.
|
|
|
|
|
2017-01-30 19:18:35 -05:00
|
|
|
set(cli_SOURCES
|
2018-10-19 15:41:56 -04:00
|
|
|
Add.cpp
|
2019-09-12 11:08:28 -04:00
|
|
|
AddGroup.cpp
|
2019-06-24 18:03:42 -04:00
|
|
|
Analyze.cpp
|
2021-11-03 23:29:44 -04:00
|
|
|
AttachmentExport.cpp
|
|
|
|
AttachmentImport.cpp
|
|
|
|
AttachmentRemove.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
Clip.cpp
|
2019-09-13 09:49:03 -04:00
|
|
|
Close.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
Command.cpp
|
2019-06-01 17:53:40 -04:00
|
|
|
DatabaseCommand.cpp
|
2022-10-05 07:30:15 -04:00
|
|
|
DatabaseCreate.cpp
|
|
|
|
DatabaseEdit.cpp
|
|
|
|
DatabaseInfo.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
Diceware.cpp
|
|
|
|
Edit.cpp
|
|
|
|
Estimate.cpp
|
2019-09-13 09:49:03 -04:00
|
|
|
Exit.cpp
|
2019-06-16 21:33:13 -04:00
|
|
|
Export.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
Generate.cpp
|
2019-09-13 09:49:03 -04:00
|
|
|
Help.cpp
|
2019-10-14 08:37:26 -04:00
|
|
|
Import.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
List.cpp
|
|
|
|
Merge.cpp
|
2019-09-12 11:08:28 -04:00
|
|
|
Move.cpp
|
2019-09-13 09:49:03 -04:00
|
|
|
Open.cpp
|
2018-10-19 15:41:56 -04:00
|
|
|
Remove.cpp
|
2019-09-12 11:08:28 -04:00
|
|
|
RemoveGroup.cpp
|
2021-08-03 09:37:47 -04:00
|
|
|
Search.cpp
|
2018-10-27 15:39:50 -04:00
|
|
|
Show.cpp)
|
2011-07-06 14:23:29 -04:00
|
|
|
|
2017-01-30 19:18:35 -05:00
|
|
|
add_library(cli STATIC ${cli_SOURCES})
|
2024-05-27 15:11:34 -04:00
|
|
|
target_link_libraries(cli ${ZXCVBN_LIBRARIES} Qt5::Core)
|
2016-11-23 21:59:24 -05:00
|
|
|
|
2019-09-13 09:49:03 -04:00
|
|
|
find_package(Readline)
|
|
|
|
|
|
|
|
if (READLINE_FOUND)
|
|
|
|
target_compile_definitions(cli PUBLIC USE_READLINE)
|
2021-09-06 22:26:00 -04:00
|
|
|
target_link_libraries(cli ${Readline_LIBRARY})
|
2019-09-13 09:49:03 -04:00
|
|
|
endif()
|
|
|
|
|
2017-01-30 19:18:35 -05:00
|
|
|
add_executable(keepassxc-cli keepassxc-cli.cpp)
|
|
|
|
target_link_libraries(keepassxc-cli
|
2020-04-02 01:59:34 -04:00
|
|
|
${GPGERROR_LIBRARIES}
|
2018-10-19 15:41:56 -04:00
|
|
|
cli
|
2022-09-17 21:45:43 -04:00
|
|
|
keepassxc_core)
|
2017-02-02 18:29:31 -05:00
|
|
|
|
|
|
|
install(TARGETS keepassxc-cli
|
|
|
|
BUNDLE DESTINATION . COMPONENT Runtime
|
2017-02-04 14:52:43 -05:00
|
|
|
RUNTIME DESTINATION ${CLI_INSTALL_DIR} COMPONENT Runtime)
|
2017-08-21 21:33:49 -04:00
|
|
|
|
2021-09-06 22:26:00 -04:00
|
|
|
if(WIN32)
|
2022-10-29 08:07:31 -04:00
|
|
|
target_sources(keepassxc-cli
|
|
|
|
PRIVATE keepassxc-cli.exe.manifest)
|
|
|
|
|
2021-09-06 22:26:00 -04:00
|
|
|
# install(CODE "include(BundleUtilities)
|
|
|
|
# fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/keepassxc-cli.exe\" \"\" \"\")"
|
|
|
|
# COMPONENT Runtime)
|
2019-09-13 09:49:03 -04:00
|
|
|
endif()
|
|
|
|
|
2018-12-28 18:32:25 -05:00
|
|
|
if(APPLE AND WITH_APP_BUNDLE)
|
2019-01-16 11:03:11 -05:00
|
|
|
set(CLI_APP_DIR "${CMAKE_BINARY_DIR}/src/${CLI_INSTALL_DIR}")
|
2022-03-01 12:24:07 -05:00
|
|
|
|
2019-01-16 11:03:11 -05:00
|
|
|
add_custom_command(TARGET keepassxc-cli
|
2021-02-01 11:54:28 -05:00
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/keepassxc-cli ${CLI_APP_DIR}/keepassxc-cli
|
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src
|
2022-03-01 12:24:07 -05:00
|
|
|
COMMENT "Copying keepassxc-cli into app bundle")
|
2022-03-08 06:30:17 -05:00
|
|
|
set_property(GLOBAL APPEND PROPERTY
|
|
|
|
_MACDEPLOYQT_EXTRA_BINARIES "${CLI_INSTALL_DIR}/keepassxc-cli")
|
2018-12-28 18:32:25 -05:00
|
|
|
endif()
|