Add cross-platform docker images for armv7 and arm64
[RRG-proxmark3.git] / client / CMakeLists.txt
blob2a74b1500d60e1f59c16412349bcf98a198dccae
1 #-----------------------------------------------------------------------------
2 # Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
14 # See LICENSE.txt for the text of the license.
15 #-----------------------------------------------------------------------------
16 # Usage:
17 #  mkdir build
18 #  cd build
19 #  cmake ..     (see below for options)
20 #  make         (VERBOSE=1 if needed)
22 # MINGW:
23 #  On ProxSpace 3.4:
24 #    cmake -G"MSYS Makefiles" ..
25 #  On Proxspace 3.3 or less, you need to install cmake:
26 #    pacman -S mingw-w64-x86_64-cmake
27 #    /mingw64/bin/cmake -G"MSYS Makefiles" ..
29 # Android cross-compilation: (ANDROID_ABI=arm64-v8a for a 64b version)
30 # cmake \
31 #    -DCMAKE_TOOLCHAIN_FILE=<path-to-your-android-ndk>/build/cmake/android.toolchain.cmake \
32 #    -DANDROID_ABI=armeabi-v7a \
33 #    -DANDROID_NATIVE_API_LEVEL=android-19 \
34 #    -DSKIPBT=1 -DSKIPPYTHON=1 -DSKIPPTHREAD=1 ..
36 message(STATUS "CMake ${CMAKE_VERSION}")
37 cmake_minimum_required(VERSION 3.10)
38 project(proxmark3)
39 SET (PM3_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/..)
41 if(CMAKE_VERSION VERSION_LESS "3.7.0")
42     set(CMAKE_INCLUDE_CURRENT_DIR ON)
43 endif()
45 find_package(PkgConfig)
47 # Allow specifying a Python version via cmake option
48 set(PYTHON3_PKGCONFIG "python3" CACHE STRING "Python3 package config version suffix")
50 if (NOT SKIPQT EQUAL 1)
52     if(APPLE AND EXISTS /usr/local/opt/qt5)
53         # Homebrew installs Qt5 (up to at least 5.11.0) in
54         # /usr/local/opt/qt5. Ensure that it can be found by CMake
55         # since it is not in the default /usr/local prefix.
56         # Add it to PATHS so that it doesn't override the
57         # CMAKE_PREFIX_PATH environment variable.
58         # QT_FIND_PACKAGE_OPTIONS should be passed to find_package,
59         # e.g. find_package(Qt5Core ${QT_FIND_PACKAGE_OPTIONS})
60         list(APPEND QT_FIND_PACKAGE_OPTIONS PATHS /usr/local/opt/qt5)
61     endif(APPLE AND EXISTS /usr/local/opt/qt5)
63     if(APPLE AND EXISTS /opt/homebrew/opt/qt@5)
64         # Homebrew on Apple Silicon installs Qt5 in
65         # /opt/homebrew/opt/qt@5. Ensure that it can be found by CMake
66         # since it is not in the default /usr/local prefix.
67         # Add it to PATHS so that it doesn't override the
68         # CMAKE_PREFIX_PATH environment variable.
69         # QT_FIND_PACKAGE_OPTIONS should be passed to find_package,
70         # e.g. find_package(Qt5Core ${QT_FIND_PACKAGE_OPTIONS})
71         list(APPEND QT_FIND_PACKAGE_OPTIONS PATHS /opt/homebrew/opt/qt@5)
72     endif(APPLE AND EXISTS /opt/homebrew/opt/qt@5)
73     set(QT_PACKAGELIST
74         Qt5Core
75         Qt5Widgets
76         Qt5Gui
77     )
78     set(Qt5_FOUND ON)
79     foreach(_qt_package IN LISTS QT_PACKAGELIST)
80         find_package(${_qt_package} QUIET ${QT_FIND_PACKAGE_OPTIONS})
81         set(Qt5_LIBRARIES ${${_qt_package}_LIBRARIES} ${Qt5_LIBRARIES})
82         if(NOT ${_qt_package}_FOUND)
83             set(Qt5_FOUND OFF)
84         endif(NOT ${_qt_package}_FOUND)
85     endforeach()
86 endif (NOT SKIPQT EQUAL 1)
88 if (NOT SKIPBT EQUAL 1)
89     pkg_search_module(BLUEZ QUIET bluez)
90 endif (NOT SKIPBT EQUAL 1)
92 if (NOT SKIPPYTHON EQUAL 1)
93     pkg_search_module(PYTHON3 QUIET ${PYTHON3_PKGCONFIG})
94     pkg_search_module(PYTHON3EMBED QUIET ${PYTHON3_PKGCONFIG}-embed)
95 endif (NOT SKIPPYTHON EQUAL 1)
97 # If cross-compiled, we need to init source and build.
98 if (CMAKE_TOOLCHAIN_FILE)
99     if (ANDROID)
100         set(CFLAGS_EXTERNAL_LIB "CFLAGS=--target=${CMAKE_C_COMPILER_TARGET} -w")
101     endif (ANDROID)
102     set(EMBED_READLINE ON)
103     set(EMBED_BZIP2 ON)
104     set(EMBED_LZ4 ON)
105     set(EMBED_GD ON)
106 endif (CMAKE_TOOLCHAIN_FILE)
108 if (EMBED_READLINE OR EMBED_BZIP2 OR EMBED_LZ4 OR EMBED_GD)
109     include(ExternalProject)
110 endif (EMBED_READLINE OR EMBED_BZIP2 OR EMBED_LZ4 OR EMBED_GD)
112 if (NOT SKIPREADLINE EQUAL 1)
113     if (APPLE)
114       find_path(READLINE_INCLUDE_DIRS readline/readline.h /usr/local/opt/readline/include /opt/local/include /opt/include /usr/local/include /usr/include /opt/homebrew/opt/readline/include NO_DEFAULT_PATH)
115       find_library(READLINE_LIBRARIES readline /usr/local/opt/readline/lib /opt/local/lib /opt/lib /usr/local/lib /usr/lib /opt/homebrew/opt/readline/lib NO_DEFAULT_PATH)
116     endif (APPLE)
117     if (EMBED_READLINE)
118         ExternalProject_Add(ncurses
119             URL                   http://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.1.tar.gz
120             PREFIX                deps/ncurses
121             DOWNLOAD_DIR          ${CMAKE_CURRENT_SOURCE_DIR}/deps/ncurses
122             CONFIGURE_COMMAND     ./configure CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} LD=${CMAKE_C_COMPILER} AR=${CMAKE_AR} RANLIB=${CMAKE_RANLIB} ${CFLAGS_EXTERNAL_LIB} --host=arm --disable-database  --with-fallbacks=ansi-generic,ansi-mini,color_xterm,dtterm,dumb,Eterm,Eterm-256color,Eterm-88color,eterm-color,gnome,gnome-256color,guru,hurd,iTerm.app,konsole,konsole-16color,konsole-256color,konsole-base,konsole-linux,konsole-solaris,konsole-vt100,kterm,kterm-color,linux,linux-16color,linux-basic,mac,mlterm,mlterm-256color,mrxvt,mrxvt-256color,mterm,mterm-ansi,mvterm,nsterm,nsterm-16color,nsterm-256color,pty,putty,putty-256color,putty-vt100,rxvt,rxvt-16color,rxvt-256color,rxvt-88color,rxvt-basic,rxvt-color,screen,screen-16color,screen-256color,simpleterm,st-16color,st-256color,st52,st52-color,stv52,tt,tt52,unknown,vt100,vt102,vte,vte-256color,xterm,xterm-16color,xterm-256color,xterm-88color,xterm-basic,xterm-bold,xterm-color,xterm-utf8,xterm-vt220,xterm-vt52,xterm1,xtermc,xtermm   --enable-termcap --without-ada --without-debug --without-dlsym --without-gpm --without-develop --without-tests --without-cxx-binding --with-termlib
123             BUILD_IN_SOURCE       ON
124             BUILD_COMMAND         make libs
125             INSTALL_COMMAND       ""
126             LOG_DOWNLOAD          ON
127         )
128         ExternalProject_Add_StepTargets(ncurses configure build install)
130         ExternalProject_Add(readline
131             URL                   https://ftp.gnu.org/gnu/readline/readline-8.2.tar.gz
132             PREFIX                deps/readline
133             DOWNLOAD_DIR          ${CMAKE_CURRENT_SOURCE_DIR}/deps/readline
134             CONFIGURE_COMMAND     ./configure CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} LD=${CMAKE_C_COMPILER} AR=${CMAKE_AR} RANLIB=${CMAKE_RANLIB} ${CFLAGS_EXTERNAL_LIB} --host=arm --enable-static
135             BUILD_IN_SOURCE       ON
136             BUILD_COMMAND         make
137             INSTALL_COMMAND       ""
138             LOG_DOWNLOAD          ON
139         )
140         ExternalProject_Add_StepTargets(readline configure build install)
141         set(READLINE_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/deps/readline/src/)
142         set(READLINE_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/deps/readline/src/readline/libreadline.a ${CMAKE_CURRENT_BINARY_DIR}/deps/ncurses/src/ncurses/lib/libtinfo.a)
143     else (EMBED_READLINE)
144         find_path(READLINE_INCLUDE_DIRS readline/readline.h)
145         find_library(READLINE_LIBRARIES readline)
146     endif (EMBED_READLINE)
147     if (READLINE_INCLUDE_DIRS AND READLINE_LIBRARIES)
148         set(READLINE_FOUND ON)
149     endif (READLINE_INCLUDE_DIRS AND READLINE_LIBRARIES)
150 else (NOT SKIPREADLINE EQUAL 1)
151     if (NOT SKIPLINENOISE EQUAL 1)
152         if (EXISTS ${PM3_ROOT}/client/deps/linenoise/)
153             set(LINENOISE_LOCAL_FOUND ON)
154         endif (EXISTS ${PM3_ROOT}/client/deps/linenoise/)
155     endif (NOT SKIPLINENOISE EQUAL 1)
156 endif (NOT SKIPREADLINE EQUAL 1)
158 if (NOT SKIPJANSSONSYSTEM EQUAL 1)
159     pkg_check_modules(PC_JANSSON QUIET jansson)
160     find_path(JANSSON_INCLUDE_DIRS
161             NAMES jansson.h
162             HINTS ${PC_JANSSON_INCLUDEDIR} ${PC_JANSSON_INCLUDE_DIRS})
163     find_library(JANSSON_LIBRARIES
164             NAMES jansson libjansson
165             HINTS ${PC_JANSSON_LIBDIR} ${PC_JANSSON_LIBRARY_DIRS})
166     if (JANSSON_INCLUDE_DIRS AND JANSSON_LIBRARIES)
167         set(JANSSON_FOUND ON)
168     endif (JANSSON_INCLUDE_DIRS AND JANSSON_LIBRARIES)
169 endif (NOT SKIPJANSSONSYSTEM EQUAL 1)
171 if(EMBED_BZIP2)
172     cmake_policy(SET CMP0114 NEW)
173     set(BZIP2_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/deps/bzip2/src/bzip2)
174     # Specify SOURCE_DIR will cause some errors
175     ExternalProject_Add(bzip2
176         GIT_REPOSITORY        https://android.googlesource.com/platform/external/bzip2
177         GIT_TAG               platform-tools-30.0.2
178         PREFIX                deps/bzip2
179         # SOURCE_DIR            ${CMAKE_CURRENT_SOURCE_DIR}/deps/bzip2
180         CONFIGURE_COMMAND     mkdir -p ${BZIP2_BUILD_DIR} && git archive --format tar HEAD | tar -C ${BZIP2_BUILD_DIR} -x
181         BUILD_IN_SOURCE       ON
182         BUILD_COMMAND         make -C ${BZIP2_BUILD_DIR} -j4 CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} LD=${CMAKE_C_COMPILER} AR=${CMAKE_AR} RANLIB=${CMAKE_RANLIB} ${CFLAGS_EXTERNAL_LIB} libbz2.a
183         INSTALL_COMMAND       ""
184         LOG_DOWNLOAD          ON
185     )
186     ExternalProject_Add_StepTargets(bzip2 configure build install)
187     set(BZIP2_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/deps/bzip2/src/bzip2)
188     set(BZIP2_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/deps/bzip2/src/bzip2/libbz2.a)
189     set(BZIP2_FOUND ON)
190 else(EMBED_BZIP2)
191     find_package (BZip2 REQUIRED)
192 endif(EMBED_BZIP2)
194 if(EMBED_LZ4)
195     cmake_policy(SET CMP0114 NEW)
196     set(LZ4_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/deps/lz4/src/lz4)
197     # Specify SOURCE_DIR will cause some errors
198     ExternalProject_Add(lz4
199         GIT_REPOSITORY        https://android.googlesource.com/platform/external/lz4
200         GIT_TAG               platform-tools-30.0.2
201         PREFIX                deps/lz4
202         # SOURCE_DIR            ${CMAKE_CURRENT_SOURCE_DIR}/deps/lz4
203         CONFIGURE_COMMAND     mkdir -p ${LZ4_BUILD_DIR} && git archive --format tar HEAD | tar -C ${LZ4_BUILD_DIR} -x
204         BUILD_IN_SOURCE       ON
205         BUILD_COMMAND         make -C ${LZ4_BUILD_DIR}/lib -j4 CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} LD=${CMAKE_C_COMPILER} AR=${CMAKE_AR} RANLIB=${CMAKE_RANLIB} ${CFLAGS_EXTERNAL_LIB} liblz4.a
206         INSTALL_COMMAND       ""
207         LOG_DOWNLOAD          ON
208     )
209     ExternalProject_Add_StepTargets(lz4 configure build install)
210     set(LZ4_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/deps/lz4/src/lz4/lib)
211     set(LZ4_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/deps/lz4/src/lz4/lib/liblz4.a)
212     set(LZ4_FOUND ON)
213 else(EMBED_LZ4)
214     find_path(LZ4_INCLUDE_DIRS lz4frame.h)
215     find_library(LZ4_LIBRARIES lz4)
216 endif(EMBED_LZ4)
218 if (LZ4_INCLUDE_DIRS AND LZ4_LIBRARIES)
219     set(LZ4_FOUND ON)
220 endif (LZ4_INCLUDE_DIRS AND LZ4_LIBRARIES)
222 if (NOT SKIPGD EQUAL 1)
223     if (EMBED_GD)
224         cmake_policy(SET CMP0114 NEW)
225         set(GD_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/deps/gd)
226         # Specify SOURCE_DIR will cause some errors
227         ExternalProject_Add(gd
228             URL                   https://github.com/libgd/libgd/releases/download/gd-2.3.3/libgd-2.3.3.tar.gz
229             URL_HASH              SHA256=dd3f1f0bb016edcc0b2d082e8229c822ad1d02223511997c80461481759b1ed2
230             PREFIX                deps/gd
231             CMAKE_ARGS            -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DENABLE_CPP=0 -DCMAKE_INSTALL_PREFIX=.
232             PATCH_COMMAND         cat ${CMAKE_CURRENT_SOURCE_DIR}/deps/gd-static.patch | patch -p1
233         )
234         ExternalProject_Add_StepTargets(gd configure build install)
235         set(GD_INCLUDE_DIRS ${GD_BUILD_DIR}/src/gd-build/include)
236         set(GD_LIBRARIES ${GD_BUILD_DIR}/src/gd-build/lib/libgd.a)
237         set(GD_FOUND ON)
238     else (EMBED_GD)
239         pkg_search_module(GD QUIET gdlib)
240     endif (EMBED_GD)
241 endif (NOT SKIPGD EQUAL 1)
243 if (NOT SKIPWHEREAMISYSTEM EQUAL 1)
244     find_path(WHEREAMI_INCLUDE_DIRS whereami.h)
245     find_library(WHEREAMI_LIBRARIES whereami)
246     if (WHEREAMI_INCLUDE_DIRS AND WHEREAMI_LIBRARIES)
247         set(WHEREAMI_FOUND ON)
248     endif (WHEREAMI_INCLUDE_DIRS AND WHEREAMI_LIBRARIES)
249 endif (NOT SKIPWHEREAMISYSTEM EQUAL 1)
251 add_subdirectory(${PM3_ROOT}/client/deps deps)
253 set (TARGET_SOURCES
254         ${PM3_ROOT}/common/commonutil.c
255         ${PM3_ROOT}/common/util_posix.c
256         ${PM3_ROOT}/common/bucketsort.c
257         ${PM3_ROOT}/common/crapto1/crapto1.c
258         ${PM3_ROOT}/common/crapto1/crypto1.c
259         ${PM3_ROOT}/common/crc.c
260         ${PM3_ROOT}/common/crc16.c
261         ${PM3_ROOT}/common/crc32.c
262         ${PM3_ROOT}/common/crc64.c
263         ${PM3_ROOT}/common/lfdemod.c
264         ${PM3_ROOT}/common/legic_prng.c
265         ${PM3_ROOT}/common/iso15693tools.c
266         ${PM3_ROOT}/common/cardhelper.c
267         ${PM3_ROOT}/common/generator.c
268         ${PM3_ROOT}/common/bruteforce.c
269         ${PM3_ROOT}/common/hitag2/hitag2_crypto.c
270         ${PM3_ROOT}/client/src/crypto/asn1dump.c
271         ${PM3_ROOT}/client/src/crypto/asn1utils.c
272         ${PM3_ROOT}/client/src/crypto/libpcrypto.c
273         ${PM3_ROOT}/client/src/crypto/originality.c
274         ${PM3_ROOT}/client/src/emv/test/cda_test.c
275         ${PM3_ROOT}/client/src/emv/test/crypto_test.c
276         ${PM3_ROOT}/client/src/emv/test/cryptotest.c
277         ${PM3_ROOT}/client/src/emv/test/dda_test.c
278         ${PM3_ROOT}/client/src/emv/test/sda_test.c
279         ${PM3_ROOT}/client/src/emv/cmdemv.c
280         ${PM3_ROOT}/client/src/emv/crypto.c
281         ${PM3_ROOT}/client/src/emv/crypto_polarssl.c
282         ${PM3_ROOT}/client/src/emv/dol.c
283         ${PM3_ROOT}/client/src/emv/emv_pk.c
284         ${PM3_ROOT}/client/src/emv/emv_pki.c
285         ${PM3_ROOT}/client/src/emv/emv_pki_priv.c
286         ${PM3_ROOT}/client/src/emv/emv_roca.c
287         ${PM3_ROOT}/client/src/emv/emv_tags.c
288         ${PM3_ROOT}/client/src/emv/emvcore.c
289         ${PM3_ROOT}/client/src/emv/emvjson.c
290         ${PM3_ROOT}/client/src/emv/tlv.c
291         ${PM3_ROOT}/client/src/fido/additional_ca.c
292         ${PM3_ROOT}/client/src/fido/cbortools.c
293         ${PM3_ROOT}/client/src/fido/cose.c
294         ${PM3_ROOT}/client/src/fido/fidocore.c
295         ${PM3_ROOT}/client/src/iso7816/apduinfo.c
296         ${PM3_ROOT}/client/src/iso7816/iso7816core.c
297         ${PM3_ROOT}/client/src/ksx6924/ksx6924core.c
298         ${PM3_ROOT}/client/src/cipurse/cipursecrypto.c
299         ${PM3_ROOT}/client/src/cipurse/cipursecore.c
300         ${PM3_ROOT}/client/src/cipurse/cipursetest.c
301         ${PM3_ROOT}/client/src/loclass/cipher.c
302         ${PM3_ROOT}/client/src/loclass/cipherutils.c
303         ${PM3_ROOT}/client/src/loclass/elite_crack.c
304         ${PM3_ROOT}/client/src/loclass/hash1_brute.c
305         ${PM3_ROOT}/client/src/loclass/ikeys.c
306         ${PM3_ROOT}/client/src/mifare/mad.c
307         ${PM3_ROOT}/client/src/mifare/aiddesfire.c
308         ${PM3_ROOT}/client/src/mifare/mfkey.c
309         ${PM3_ROOT}/client/src/mifare/mifare4.c
310         ${PM3_ROOT}/client/src/mifare/mifaredefault.c
311         ${PM3_ROOT}/client/src/mifare/mifarehost.c
312         ${PM3_ROOT}/client/src/mifare/gen4.c
313         ${PM3_ROOT}/client/src/nfc/ndef.c
314         ${PM3_ROOT}/client/src/mifare/lrpcrypto.c
315         ${PM3_ROOT}/client/src/mifare/desfirecrypto.c
316         ${PM3_ROOT}/client/src/mifare/desfiresecurechan.c
317         ${PM3_ROOT}/client/src/mifare/desfirecore.c
318         ${PM3_ROOT}/client/src/mifare/desfiretest.c
319         ${PM3_ROOT}/client/src/mifare/gallaghercore.c
320         ${PM3_ROOT}/client/src/uart/ringbuffer.c
321         ${PM3_ROOT}/client/src/uart/uart_common.c
322         ${PM3_ROOT}/client/src/uart/uart_posix.c
323         ${PM3_ROOT}/client/src/uart/uart_win32.c
324         ${PM3_ROOT}/client/src/ui/overlays.ui
325         ${PM3_ROOT}/client/src/ui/image.ui
326         ${PM3_ROOT}/client/src/aidsearch.c
327         ${PM3_ROOT}/client/src/atrs.c
328         ${PM3_ROOT}/client/src/cmdanalyse.c
329         ${PM3_ROOT}/client/src/cmdcrc.c
330         ${PM3_ROOT}/client/src/cmddata.c
331         ${PM3_ROOT}/client/src/cmdflashmem.c
332         ${PM3_ROOT}/client/src/cmdflashmemspiffs.c
333         ${PM3_ROOT}/client/src/cmdhf.c
334         ${PM3_ROOT}/client/src/cmdhf14a.c
335         ${PM3_ROOT}/client/src/cmdhf14b.c
336         ${PM3_ROOT}/client/src/cmdhf15.c
337         ${PM3_ROOT}/client/src/cmdhfcryptorf.c
338         ${PM3_ROOT}/client/src/cmdhfemrtd.c
339         ${PM3_ROOT}/client/src/cmdhfepa.c
340         ${PM3_ROOT}/client/src/cmdhffelica.c
341         ${PM3_ROOT}/client/src/cmdhffido.c
342         ${PM3_ROOT}/client/src/cmdhffudan.c
343         ${PM3_ROOT}/client/src/cmdhfgallagher.c
344         ${PM3_ROOT}/client/src/cmdhfcipurse.c
345         ${PM3_ROOT}/client/src/cmdhficlass.c
346         ${PM3_ROOT}/client/src/cmdhfict.c
347         ${PM3_ROOT}/client/src/cmdhfjooki.c
348         ${PM3_ROOT}/client/src/cmdhfksx6924.c
349         ${PM3_ROOT}/client/src/cmdhflegic.c
350         ${PM3_ROOT}/client/src/cmdhflist.c
351         ${PM3_ROOT}/client/src/cmdhflto.c
352         ${PM3_ROOT}/client/src/cmdhfmf.c
353         ${PM3_ROOT}/client/src/cmdhfmfdes.c
354         ${PM3_ROOT}/client/src/cmdhfmfhard.c
355         ${PM3_ROOT}/client/src/cmdhfmfp.c
356         ${PM3_ROOT}/client/src/cmdhfmfu.c
357         ${PM3_ROOT}/client/src/cmdhfntag424.c
358         ${PM3_ROOT}/client/src/cmdhfseos.c
359         ${PM3_ROOT}/client/src/cmdhfst.c
360         ${PM3_ROOT}/client/src/cmdhfst25ta.c
361         ${PM3_ROOT}/client/src/cmdhftesla.c
362         ${PM3_ROOT}/client/src/cmdhftexkom.c
363         ${PM3_ROOT}/client/src/cmdhfthinfilm.c
364         ${PM3_ROOT}/client/src/cmdhftopaz.c
365         ${PM3_ROOT}/client/src/cmdhfvas.c
366         ${PM3_ROOT}/client/src/cmdhfxerox.c
367         ${PM3_ROOT}/client/src/cmdhw.c
368         ${PM3_ROOT}/client/src/cmdlf.c
369         ${PM3_ROOT}/client/src/cmdlfawid.c
370         ${PM3_ROOT}/client/src/cmdlfcotag.c
371         ${PM3_ROOT}/client/src/cmdlfdestron.c
372         ${PM3_ROOT}/client/src/cmdlfem.c
373         ${PM3_ROOT}/client/src/cmdlfem410x.c
374         ${PM3_ROOT}/client/src/cmdlfem4x05.c
375         ${PM3_ROOT}/client/src/cmdlfem4x50.c
376         ${PM3_ROOT}/client/src/cmdlfem4x70.c
377         ${PM3_ROOT}/client/src/cmdlffdxb.c
378         ${PM3_ROOT}/client/src/cmdlfgallagher.c
379         ${PM3_ROOT}/client/src/cmdlfguard.c
380         ${PM3_ROOT}/client/src/cmdlfhid.c
381         ${PM3_ROOT}/client/src/cmdlfhitag.c
382         ${PM3_ROOT}/client/src/cmdlfhitaghts.c
383         ${PM3_ROOT}/client/src/cmdlfidteck.c
384         ${PM3_ROOT}/client/src/cmdlfindala.c
385         ${PM3_ROOT}/client/src/cmdlfio.c
386         ${PM3_ROOT}/client/src/cmdlfjablotron.c
387         ${PM3_ROOT}/client/src/cmdlfkeri.c
388         ${PM3_ROOT}/client/src/cmdlfmotorola.c
389         ${PM3_ROOT}/client/src/cmdlfnedap.c
390         ${PM3_ROOT}/client/src/cmdlfnexwatch.c
391         ${PM3_ROOT}/client/src/cmdlfnoralsy.c
392         ${PM3_ROOT}/client/src/cmdlfpac.c
393         ${PM3_ROOT}/client/src/cmdlfparadox.c
394         ${PM3_ROOT}/client/src/cmdlfpcf7931.c
395         ${PM3_ROOT}/client/src/cmdlfpresco.c
396         ${PM3_ROOT}/client/src/cmdlfpyramid.c
397         ${PM3_ROOT}/client/src/cmdlfsecurakey.c
398         ${PM3_ROOT}/client/src/cmdlft55xx.c
399         ${PM3_ROOT}/client/src/cmdlfti.c
400         ${PM3_ROOT}/client/src/cmdlfviking.c
401         ${PM3_ROOT}/client/src/cmdlfvisa2000.c
402         ${PM3_ROOT}/client/src/cmdlfzx8211.c
403         ${PM3_ROOT}/client/src/cmdmain.c
404         ${PM3_ROOT}/client/src/cmdnfc.c
405         ${PM3_ROOT}/client/src/cmdparser.c
406         ${PM3_ROOT}/client/src/cmdpiv.c
407         ${PM3_ROOT}/client/src/cmdscript.c
408         ${PM3_ROOT}/client/src/cmdsmartcard.c
409         ${PM3_ROOT}/client/src/cmdtrace.c
410         ${PM3_ROOT}/client/src/cmdusart.c
411         ${PM3_ROOT}/client/src/cmdwiegand.c
412         ${PM3_ROOT}/client/src/comms.c
413         ${PM3_ROOT}/client/src/fileutils.c
414         ${PM3_ROOT}/client/src/flash.c
415         ${PM3_ROOT}/client/src/graph.c
416         ${PM3_ROOT}/client/src/iso4217.c
417         ${PM3_ROOT}/client/src/jansson_path.c
418         ${PM3_ROOT}/client/src/lua_bitlib.c
419         ${PM3_ROOT}/client/src/preferences.c
420         ${PM3_ROOT}/client/src/pm3.c
421         ${PM3_ROOT}/client/src/pm3_binlib.c
422         ${PM3_ROOT}/client/src/pm3_bitlib.c
423         ${PM3_ROOT}/client/src/pm3line.c
424         ${PM3_ROOT}/client/src/scandir.c
425         ${PM3_ROOT}/client/src/scripting.c
426         ${PM3_ROOT}/client/src/ui.c
427         ${PM3_ROOT}/client/src/util.c
428         ${PM3_ROOT}/client/src/wiegand_formats.c
429         ${PM3_ROOT}/client/src/wiegand_formatutils.c
430         ${CMAKE_BINARY_DIR}/version_pm3.c
431         )
433 add_custom_command(
434     OUTPUT  ${CMAKE_BINARY_DIR}/version_pm3.c
435     COMMAND sh ${PM3_ROOT}/tools/mkversion.sh ${CMAKE_BINARY_DIR}/version_pm3.c || ${CMAKE_COMMAND} -E copy ${PM3_ROOT}/common/default_version_pm3.c ${CMAKE_BINARY_DIR}/version_pm3.c
436     DEPENDS ${PM3_ROOT}/common/default_version_pm3.c
439 set(ADDITIONAL_SRC "")
440 set(ADDITIONAL_LNK "")
441 set(ADDITIONAL_DIRS "")
442 set(ADDITIONAL_LNKDIRS "")
443 set(X86_CPUS x86 x86_64 i686)
445 message(STATUS "CMAKE_SYSTEM_PROCESSOR := ${CMAKE_SYSTEM_PROCESSOR}")
447 if (APPLE)
448     message(STATUS "Apple device detected.")
449     set(ADDITIONAL_SRC ${PM3_ROOT}/client/src/util_darwin.h  ${PM3_ROOT}/client/src/util_darwin.m ${ADDITIONAL_SRC})
451     find_library(UIKIT_LIBRARY UIKit)
452     if (NOT UIKIT_LIBRARY)
453         message(STATUS "UIKit.framework NOT found!")
454     else()
455         message(STATUS "UIKit.framework found! ${UIKIT_LIBRARY}")
456         set(ADDITIONAL_LNK "-framework Foundation" "-framework UIKit")
457     endif()
459     find_library(APPKIT_LIBRARY AppKit)
460     if (NOT APPKIT_LIBRARY)
461       message(STATUS "AppKit.framework NOT found!")
462     else()
463       message(STATUS "AppKit.framework found! ${APPKIT_LIBRARY}")
464       set(ADDITIONAL_LNK "-framework Foundation" "-framework AppKit")
465     endif()
466 endif (APPLE)
468 if ((NOT SKIPQT EQUAL 1) AND (Qt5_FOUND))
469     set(CMAKE_AUTOMOC ON)
470     set(CMAKE_AUTORCC ON)
471     set(CMAKE_AUTOUIC ON)
472     set (TARGET_SOURCES
473             ${PM3_ROOT}/client/src/proxgui.cpp
474             ${PM3_ROOT}/client/src/proxguiqt.cpp
475             ${TARGET_SOURCES})
477     add_definitions("-DHAVE_GUI")
478     set(ADDITIONAL_LNK ${Qt5_LIBRARIES} ${ADDITIONAL_LNK})
479 else ((NOT SKIPQT EQUAL 1) AND (Qt5_FOUND))
480     set(TARGET_SOURCES
481             ${PM3_ROOT}/client/src/guidummy.cpp
482             ${TARGET_SOURCES})
483 endif ((NOT SKIPQT EQUAL 1) AND (Qt5_FOUND))
485 if (NOT SKIPBT EQUAL 1)
486     if (BLUEZ_FOUND)
487         add_definitions("-DHAVE_BLUEZ")
488         set(ADDITIONAL_LNK ${BLUEZ_LIBRARIES} ${ADDITIONAL_LNK})
489     endif (BLUEZ_FOUND)
490 endif(NOT SKIPBT EQUAL 1)
492 if (JANSSON_FOUND)
493     set(ADDITIONAL_DIRS ${JANSSON_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
494     set(ADDITIONAL_LNK ${JANSSON_LIBRARIES} ${ADDITIONAL_LNK})
495 endif (JANSSON_FOUND)
497 if (NOT SKIPPYTHON EQUAL 1)
498     if (PYTHON3EMBED_FOUND)
499         add_definitions(-DHAVE_PYTHON)
500         set(ADDITIONAL_DIRS ${PYTHON3EMBED_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
501         set(ADDITIONAL_LNK ${PYTHON3EMBED_LIBRARIES} ${ADDITIONAL_LNK})
502         set(ADDITIONAL_LNKDIRS ${PYTHON3EMBED_LIBRARY_DIRS} ${ADDITIONAL_LNKDIRS})
503     elseif (PYTHON3_FOUND)
504         add_definitions(-DHAVE_PYTHON)
505         set(ADDITIONAL_DIRS ${PYTHON3_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
506         set(ADDITIONAL_LNK ${PYTHON3_LIBRARIES} ${ADDITIONAL_LNK})
507         set(ADDITIONAL_LNKDIRS ${PYTHON3_LIBRARY_DIRS} ${ADDITIONAL_LNKDIRS})
508     endif (PYTHON3EMBED_FOUND)
509 endif (NOT SKIPPYTHON EQUAL 1)
511 if (NOT SKIPREADLINE EQUAL 1)
512     if (READLINE_FOUND)
513         add_definitions("-DHAVE_READLINE")
514         set(ADDITIONAL_DIRS ${READLINE_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
515         set(ADDITIONAL_LNK ${READLINE_LIBRARIES} ${ADDITIONAL_LNK})
516     endif (READLINE_FOUND)
517 endif(NOT SKIPREADLINE EQUAL 1)
519 if (BZIP2_FOUND)
520     set(ADDITIONAL_DIRS ${BZIP2_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
521     set(ADDITIONAL_LNK ${BZIP2_LIBRARIES} ${ADDITIONAL_LNK})
522 endif (BZIP2_FOUND)
524 if (LZ4_FOUND)
525     set(ADDITIONAL_DIRS ${LZ4_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
526     set(ADDITIONAL_LNK ${LZ4_LIBRARIES} ${ADDITIONAL_LNK})
527 endif (LZ4_FOUND)
529 if (NOT SKIPGD EQUAL 1 AND GD_FOUND)
530     set(ADDITIONAL_DIRS ${GD_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
531     set(ADDITIONAL_LNK ${GD_LIBRARIES} ${ADDITIONAL_LNK})
532     set(ADDITIONAL_LNKDIRS ${GD_LIBRARY_DIRS} ${ADDITIONAL_LNKDIRS})
533     set(TARGET_SOURCES
534             ${PM3_ROOT}/client/src/imgutils.c
535             ${PM3_ROOT}/client/src/cmdhfwaveshare.c
536             ${TARGET_SOURCES})
537     add_definitions("-DHAVE_GD")
538 endif (NOT SKIPGD EQUAL 1 AND GD_FOUND)
540 if (WHEREAMI_FOUND)
541     set(ADDITIONAL_DIRS ${WHEREAMI_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
542     set(ADDITIONAL_LNK ${WHEREAMI_LIBRARIES} ${ADDITIONAL_LNK})
543 endif (WHEREAMI_FOUND)
545 message(STATUS "===================================================================")
546 execute_process(
547     COMMAND sh ${PM3_ROOT}/tools/mkversion.sh --short
548     OUTPUT_VARIABLE version_pm3
550 string(STRIP ${version_pm3} version_pm3)
551 message(STATUS "Version info:      ${version_pm3}")
552 if (SKIPQT EQUAL 1)
553     message(STATUS "GUI support:       skipped")
554 else (SKIPQT EQUAL 1)
555     if (Qt5_FOUND)
556         message(STATUS "GUI support:       QT5 found, enabled")
557     else (Qt5_FOUND)
558         message(STATUS "GUI support:       QT5 not found, disabled")
559     endif (Qt5_FOUND)
560 endif (SKIPQT EQUAL 1)
562 if (SKIPBT EQUAL 1)
563     message(STATUS "native BT support: skipped")
564 else (SKIPBT EQUAL 1)
565     if (BLUEZ_FOUND)
566         message(STATUS "native BT support: Bluez found, enabled")
567     else (BLUEZ_FOUND)
568         message(STATUS "native BT support: Bluez not found, disabled")
569     endif (BLUEZ_FOUND)
570 endif(SKIPBT EQUAL 1)
572 if (BZIP2_FOUND)
573     if (EMBED_BZIP2)
574         message(STATUS "Bzip2 library:     embedded")
575     else (EMBED_BZIP2)
576         message(STATUS "Bzip2 library:     system library found")
577     endif (EMBED_BZIP2)
578 else (BZIP2_FOUND)
579     message(SEND_ERROR "Bzip2 library:     Bzip2 not found")
580 endif (BZIP2_FOUND)
582 if (LZ4_FOUND)
583     if (EMBED_LZ4)
584         message(STATUS "LZ4 library:       embedded")
585     else (EMBED_LZ4)
586         message(STATUS "LZ4 library:       system library found")
587     endif (EMBED_LZ4)
588 else (LZ4_FOUND)
589     message(SEND_ERROR "LZ4 library:       LZ4 not found")
590 endif (LZ4_FOUND)
592 if (SKIPGD EQUAL 1)
593     message(STATUS "GD library:        skipped")
594 elseif (GD_FOUND)
595     if (EMBED_GD)
596         message(STATUS "GD library:        embedded")
597     else (EMBED_GD)
598         message(STATUS "GD library:        system library found")
599     endif (EMBED_GD)
600 else (SKIPGD EQUAL 1)
601     message(STATUS "GD library:        GD not found, disabled")
602 endif (SKIPGD EQUAL 1)
604 if (SKIPJANSSONSYSTEM EQUAL 1)
605     message(STATUS "Jansson library:   local library forced")
606 else (SKIPJANSSONSYSTEM EQUAL 1)
607     if (JANSSON_FOUND)
608         message(STATUS "Jansson library:   system library found")
609     else (JANSSON_FOUND)
610         message(STATUS "Jansson library:   system library not found, using local library")
611     endif (JANSSON_FOUND)
612 endif (SKIPJANSSONSYSTEM EQUAL 1)
614 if (SKIPPYTHON EQUAL 1)
615     message(STATUS "Python3 library:   skipped")
616 else (SKIPPYTHON EQUAL 1)
617     if (PYTHON3EMBED_FOUND)
618         message(STATUS "Python3 library:   ${PYTHON3_PKGCONFIG}-embed found, enabled")
619     elseif (PYTHON3_FOUND)
620         message(STATUS "Python3 library:   ${PYTHON3_PKGCONFIG} found, enabled")
621     else (PYTHON3EMBED_FOUND)
622         message(STATUS "Python3 library:   ${PYTHON3_PKGCONFIG} not found, disabled")
623     endif (PYTHON3EMBED_FOUND)
624 endif(SKIPPYTHON EQUAL 1)
626 if (SKIPREADLINE EQUAL 1)
627     message(STATUS "Readline library:  skipped")
628 else (SKIPREADLINE EQUAL 1)
629     if (READLINE_FOUND)
630         if (EMBED_READLINE)
631             message(STATUS "Readline library:  embedded")
632         else (EMBED_READLINE)
633             message(STATUS "Readline library:  system library found")
634         endif (EMBED_READLINE)
635     else (READLINE_FOUND)
636         message(STATUS "Readline library:  Readline not found, disabled")
637     endif (READLINE_FOUND)
638 endif(SKIPREADLINE EQUAL 1)
640 if (NOT READLINE_FOUND)
641     if (SKIPLINENOISE EQUAL 1)
642         message(STATUS "Linenoise library: skipped")
643     else (SKIPLINENOISE EQUAL 1)
644         if (LINENOISE_LOCAL_FOUND)
645             message(STATUS "Linenoise library: enabled")
646         else (LINENOISE_LOCAL_FOUND)
647             message(STATUS "Linenoise library: Linenoise not found, disabled")
648         endif (LINENOISE_LOCAL_FOUND)
649     endif (SKIPLINENOISE EQUAL 1)
650 endif (NOT READLINE_FOUND)
652 if (SKIPWHEREAMISYSTEM EQUAL 1)
653     message(STATUS "Whereami library:  local library forced")
654 else (SKIPWHEREAMISYSTEM EQUAL 1)
655     if (WHEREAMI_FOUND)
656         message(STATUS "Whereami library:  system library found")
657     else (WHEREAMI_FOUND)
658         message(STATUS "Whereami library:  system library not found, using local library")
659     endif (WHEREAMI_FOUND)
660 endif (SKIPWHEREAMISYSTEM EQUAL 1)
662 # Lua SWIG
663 if (EXISTS ${PM3_ROOT}/client/src/pm3_luawrap.c)
664     set (TARGET_SOURCES
665             ${PM3_ROOT}/client/src/pm3_luawrap.c
666             ${TARGET_SOURCES})
667     add_definitions(-DHAVE_LUA_SWIG)
668     message(STATUS "Lua SWIG:          wrapper found")
669 endif (EXISTS ${PM3_ROOT}/client/src/pm3_luawrap.c)
671 # Python SWIG
672 if (NOT SKIPPYTHON EQUAL 1)
673     if (PYTHON3EMBED_FOUND OR PYTHON3_FOUND)
674         if (EXISTS ${PM3_ROOT}/client/src/pm3_pywrap.c)
675             set (TARGET_SOURCES
676                     ${PM3_ROOT}/client/src/pm3_pywrap.c
677                     ${TARGET_SOURCES})
678             add_definitions(-DHAVE_PYTHON_SWIG)
679             message(STATUS "Python SWIG:       wrapper found")
680         endif (EXISTS ${PM3_ROOT}/client/src/pm3_pywrap.c)
681     endif (PYTHON3EMBED_FOUND OR PYTHON3_FOUND)
682 endif (NOT SKIPPYTHON EQUAL 1)
683 message(STATUS "===================================================================")
685 add_definitions(-DHAVE_SNPRINTF)
687 add_executable(proxmark3
688         ${PM3_ROOT}/client/src/proxmark3.c
689         ${TARGET_SOURCES}
690         ${ADDITIONAL_SRC}
693 target_compile_options(proxmark3 PUBLIC -Wall -Werror -O3)
694 if (EMBED_READLINE)
695     if (NOT SKIPREADLINE EQUAL 1)
696         add_dependencies(proxmark3 ncurses readline)
697     endif (NOT SKIPREADLINE EQUAL 1)
698 endif (EMBED_READLINE)
699 if (EMBED_BZIP2)
700     add_dependencies(proxmark3 bzip2)
701 endif (EMBED_BZIP2)
702 if (EMBED_LZ4)
703     add_dependencies(proxmark3 lz4)
704 endif (EMBED_LZ4)
706 if (MINGW)
707     # Mingw uses by default Microsoft printf, we want the GNU printf (e.g. for %z)
708     # and setting _ISOC99_SOURCE sets internally __USE_MINGW_ANSI_STDIO=1
709     # FTR __USE_MINGW_ANSI_STDIO seems deprecated in Mingw32
710     # but not Mingw64 https://fr.osdn.net/projects/mingw/lists/archive/users/2019-January/000199.html
711     target_compile_definitions(proxmark3 PRIVATE _ISOC99_SOURCE)
713     set(CMAKE_C_FLAGS "-mno-ms-bitfields -fexec-charset=cp850 ${CMAKE_C_FLAGS}")
714     set(CMAKE_CXX_FLAGS "-mno-ms-bitfields -fexec-charset=cp850 ${CMAKE_CXX_FLAGS}")
716     # link Winsock2
717     set(ADDITIONAL_LNK ws2_32 ${ADDITIONAL_LNK})
718 endif (MINGW)
720 # GCC 10 has issues with false positives on stringop-overflow,
721 # let's disable them for now (cf https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92955, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94335)
722 # beware these flags didn't exist for GCC < 7
723 if(CMAKE_COMPILER_IS_GNUCXX)
724     execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
725     if (GCC_VERSION VERSION_GREATER 10.0 OR GCC_VERSION VERSION_EQUAL 10.0)
726         set(CMAKE_C_FLAGS "-Wno-stringop-overflow -Wno-error=stringop-overflow ${CMAKE_C_FLAGS}")
727         set(CMAKE_CXX_FLAGS "-Wno-stringop-overflow -Wno-error=stringop-overflow ${CMAKE_CXX_FLAGS}")
728     endif()
729 endif(CMAKE_COMPILER_IS_GNUCXX)
731 target_include_directories(proxmark3 PRIVATE
732         ${PM3_ROOT}/common
733         ${PM3_ROOT}/common_fpga
734         ${PM3_ROOT}/include
735         ${PM3_ROOT}/client/src
736         ${PM3_ROOT}/client/include
737         ${ADDITIONAL_DIRS}
740 if (NOT APPLE)
741     # required for Raspberry Pi, but breaks with clang (OSX). Need to be at the end of the linker line.
742     set(ADDITIONAL_LNK ${ADDITIONAL_LNK} -Wl,--as-needed -latomic -Wl,--no-as-needed)
743 else (NOT APPLE)
744     #set_property(TARGET proxmark3 PROPERTY LINK_FLAGS "-Wl,-undefined dynamic_lookup")
745     set(ADDITIONAL_LNK ${ADDITIONAL_LNK} -Wl,-undefined,dynamic_lookup)
746 endif (NOT APPLE)
748 if (NOT JANSSON_FOUND)
749     set(ADDITIONAL_LNK pm3rrg_rdv4_jansson ${ADDITIONAL_LNK})
750 endif (NOT JANSSON_FOUND)
752 if (NOT READLINE_FOUND)
753     if (LINENOISE_LOCAL_FOUND)
754         add_definitions("-DHAVE_LINENOISE")
755         set(ADDITIONAL_LNK pm3rrg_rdv4_linenoise ${ADDITIONAL_LNK})
756     endif (LINENOISE_LOCAL_FOUND)
757 endif (NOT READLINE_FOUND)
759 if (NOT WHEREAMI_FOUND)
760     set(ADDITIONAL_LNK pm3rrg_rdv4_whereami ${ADDITIONAL_LNK})
761 endif (NOT WHEREAMI_FOUND)
763 target_link_libraries(proxmark3 PRIVATE
764         m
765         pm3rrg_rdv4_mbedtls
766         pm3rrg_rdv4_cliparser
767         pm3rrg_rdv4_lua
768         pm3rrg_rdv4_tinycbor
769         pm3rrg_rdv4_amiibo
770         pm3rrg_rdv4_reveng
771         pm3rrg_rdv4_hardnested
772         pm3rrg_rdv4_id48
773         ${ADDITIONAL_LNK})
775 if (NOT SKIPPTHREAD EQUAL 1)
776     target_link_libraries(proxmark3 PRIVATE pthread)
777 endif (NOT SKIPPTHREAD EQUAL 1)
779 if (NOT SKIPPYTHON EQUAL 1)
780     # OSX have a hard time compiling python3 dependency with older cmake.
781     if (PYTHON3EMBED_FOUND OR PYTHON3_FOUND)
782         if (CMAKE_VERSION VERSION_LESS 3.13)
783             message( SEND_ERROR "Your CMAKE version is too old for Apple platform, please update to a version >=3.13" )
784         endif (CMAKE_VERSION VERSION_LESS 3.13)
785     endif (PYTHON3EMBED_FOUND OR PYTHON3_FOUND)
786 endif (NOT SKIPPYTHON EQUAL 1)
788 target_link_directories(proxmark3 PRIVATE ${ADDITIONAL_LNKDIRS})
790 install(TARGETS proxmark3 DESTINATION "bin")
791 install(DIRECTORY cmdscripts lualibs luascripts pyscripts resources dictionaries DESTINATION "share/proxmark3")
793 add_custom_command(OUTPUT lualibs/pm3_cmd.lua
794         COMMAND "awk -f pm3_cmd_h2lua.awk ../include/pm3_cmd.h >  lualibs/pm3_cmd.lua"
795         COMMENT "Creating lualibs/pm3_cmd.lua"
796         )
798 add_custom_command(OUTPUT lualibs/mfc_default_keys.lua
799         COMMAND "awk -f default_keys_dic2lua.awk mfc_default_keys.dic >  lualibs/mfc_default_keys.lua"
800         COMMENT "Creating lualibs/mfc_default_keys.lua"
801         )
803 #"make package" will trigger this
804 SET(CPACK_GENERATOR "DEB")
805 SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Iceman")
806 INCLUDE(CPack)