11##############################################################################
2- # Copyright (c) 2022 Leon Lynch
2+ # Copyright (c) 2022-2023 Leon Lynch
33#
44# This file is licensed under the terms of the LGPL v2.1 license.
55# See LICENSE file.
@@ -47,14 +47,21 @@ endif()
4747
4848include (GNUInstallDirs ) # Provides CMAKE_INSTALL_* variables and good defaults for install()
4949
50+ # Print helpers object library
51+ add_library (print_helpers OBJECT EXCLUDE_FROM_ALL print_helpers.c )
52+ target_include_directories (print_helpers INTERFACE
53+ $<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR } >
54+ )
55+ target_link_libraries (print_helpers PRIVATE iso7816 emv emv_strings )
56+
5057# EMV decode command line tool
5158if (BUILD_EMV_DECODE)
52- add_executable (emv-decode emv-decode.c print_helpers.c )
59+ add_executable (emv-decode emv-decode.c )
5360 set_source_files_properties (emv-decode.c
5461 PROPERTIES
5562 COMPILE_DEFINITIONS EMV_UTILS_VERSION_STRING="${EMV_UTILS_VERSION_STRING} "
5663 )
57- target_link_libraries (emv-decode PRIVATE emv_strings emv iso7816 iso8859 )
64+ target_link_libraries (emv-decode PRIVATE print_helpers iso7816 emv emv_strings iso8859 )
5865 if (TARGET libargp::argp)
5966 target_link_libraries (emv-decode PRIVATE libargp::argp )
6067 endif ()
@@ -77,12 +84,12 @@ if(BUILD_EMV_TOOL)
7784 )
7885 endif ()
7986
80- add_executable (emv-tool emv-tool.c print_helpers.c ../src/pcsc.c )
87+ add_executable (emv-tool emv-tool.c ../src/pcsc.c )
8188 set_source_files_properties (emv-tool.c
8289 PROPERTIES
8390 COMPILE_DEFINITIONS EMV_UTILS_VERSION_STRING="${EMV_UTILS_VERSION_STRING} "
8491 )
85- target_link_libraries (emv-tool PRIVATE emv_strings emv iso7816 )
92+ target_link_libraries (emv-tool PRIVATE print_helpers iso7816 emv emv_strings )
8693 if (TARGET libargp::argp)
8794 target_link_libraries (emv-tool PRIVATE libargp::argp )
8895 endif ()
0 commit comments