style
[RRG-proxmark3.git] / client / CMakeLists.txt
blob766014bc9128bb14122f6feab966c4aa7b19a688
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 if (NOT SKIPQT EQUAL 1)
49     if(APPLE AND EXISTS /usr/local/opt/qt5)
50         # Homebrew installs Qt5 (up to at least 5.11.0) in
51         # /usr/local/opt/qt5. Ensure that it can be found by CMake
52         # since it is not in the default /usr/local prefix.
53         # Add it to PATHS so that it doesn't override the
54         # CMAKE_PREFIX_PATH environment variable.
55         # QT_FIND_PACKAGE_OPTIONS should be passed to find_package,
56         # e.g. find_package(Qt5Core ${QT_FIND_PACKAGE_OPTIONS})
57         list(APPEND QT_FIND_PACKAGE_OPTIONS PATHS /usr/local/opt/qt5)
58     endif(APPLE AND EXISTS /usr/local/opt/qt5)
60     if(APPLE AND EXISTS /opt/homebrew/opt/qt@5)
61         # Homebrew on Apple Silicon installs Qt5 in
62         # /opt/homebrew/opt/qt@5. Ensure that it can be found by CMake
63         # since it is not in the default /usr/local prefix.
64         # Add it to PATHS so that it doesn't override the
65         # CMAKE_PREFIX_PATH environment variable.
66         # QT_FIND_PACKAGE_OPTIONS should be passed to find_package,
67         # e.g. find_package(Qt5Core ${QT_FIND_PACKAGE_OPTIONS})
68         list(APPEND QT_FIND_PACKAGE_OPTIONS PATHS /opt/homebrew/opt/qt@5)
69     endif(APPLE AND EXISTS /opt/homebrew/opt/qt@5)
70     set(QT_PACKAGELIST
71         Qt5Core
72         Qt5Widgets
73         Qt5Gui
74     )
75     set(Qt5_FOUND ON)
76     foreach(_qt_package IN LISTS QT_PACKAGELIST)
77         find_package(${_qt_package} QUIET ${QT_FIND_PACKAGE_OPTIONS})
78         set(Qt5_LIBRARIES ${${_qt_package}_LIBRARIES} ${Qt5_LIBRARIES})
79         if(NOT ${_qt_package}_FOUND)
80             set(Qt5_FOUND OFF)
81         endif(NOT ${_qt_package}_FOUND)
82     endforeach()
83 endif (NOT SKIPQT EQUAL 1)
85 if (NOT SKIPBT EQUAL 1)
86     pkg_search_module(BLUEZ QUIET bluez)
87 endif (NOT SKIPBT EQUAL 1)
89 if (NOT SKIPPYTHON EQUAL 1)
90     pkg_search_module(PYTHON3 QUIET python3)
91     pkg_search_module(PYTHON3EMBED QUIET python3-embed)
92 endif (NOT SKIPPYTHON EQUAL 1)
94 # If cross-compiled, we need to init source and build.
95 if (CMAKE_TOOLCHAIN_FILE)
96     if (ANDROID)
97         set(CFLAGS_EXTERNAL_LIB "CFLAGS=--target=${CMAKE_C_COMPILER_TARGET} -w")
98     endif (ANDROID)
99     set(EMBED_READLINE ON)
100     set(EMBED_BZIP2 ON)
101     set(EMBED_LZ4 ON)
102     set(EMBED_GD ON)
103 endif (CMAKE_TOOLCHAIN_FILE)
105 if (EMBED_READLINE OR EMBED_BZIP2 OR EMBED_LZ4 OR EMBED_GD)
106     include(ExternalProject)
107 endif (EMBED_READLINE OR EMBED_BZIP2 OR EMBED_LZ4 OR EMBED_GD)
109 if (NOT SKIPREADLINE EQUAL 1)
110     if (APPLE)
111       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)
112       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)
113     endif (APPLE)
114     if (EMBED_READLINE)
115         ExternalProject_Add(ncurses
116             URL                   http://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.1.tar.gz
117             PREFIX                deps/ncurses
118             DOWNLOAD_DIR          ${CMAKE_CURRENT_SOURCE_DIR}/deps/ncurses
119             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
120             BUILD_IN_SOURCE       ON
121             BUILD_COMMAND         make libs
122             INSTALL_COMMAND       ""
123             LOG_DOWNLOAD          ON
124         )
125         ExternalProject_Add_StepTargets(ncurses configure build install)
127         ExternalProject_Add(readline
128             URL                   https://ftp.gnu.org/gnu/readline/readline-8.2.tar.gz
129             PREFIX                deps/readline
130             DOWNLOAD_DIR          ${CMAKE_CURRENT_SOURCE_DIR}/deps/readline
131             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
132             BUILD_IN_SOURCE       ON
133             BUILD_COMMAND         make
134             INSTALL_COMMAND       ""
135             LOG_DOWNLOAD          ON
136         )
137         ExternalProject_Add_StepTargets(readline configure build install)
138         set(READLINE_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/deps/readline/src/)
139         set(READLINE_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/deps/readline/src/readline/libreadline.a ${CMAKE_CURRENT_BINARY_DIR}/deps/ncurses/src/ncurses/lib/libtinfo.a)
140     else (EMBED_READLINE)
141         find_path(READLINE_INCLUDE_DIRS readline/readline.h)
142         find_library(READLINE_LIBRARIES readline)
143     endif (EMBED_READLINE)
144     if (READLINE_INCLUDE_DIRS AND READLINE_LIBRARIES)
145         set(READLINE_FOUND ON)
146     endif (READLINE_INCLUDE_DIRS AND READLINE_LIBRARIES)
147 else (NOT SKIPREADLINE EQUAL 1)
148     if (NOT SKIPLINENOISE EQUAL 1)
149         if (EXISTS ${PM3_ROOT}/client/deps/linenoise/)
150             set(LINENOISE_LOCAL_FOUND ON)
151         endif (EXISTS ${PM3_ROOT}/client/deps/linenoise/)
152     endif (NOT SKIPLINENOISE EQUAL 1)
153 endif (NOT SKIPREADLINE EQUAL 1)
155 if (NOT SKIPJANSSONSYSTEM EQUAL 1)
156     pkg_check_modules(PC_JANSSON QUIET jansson)
157     find_path(JANSSON_INCLUDE_DIRS
158             NAMES jansson.h
159             HINTS ${PC_JANSSON_INCLUDEDIR} ${PC_JANSSON_INCLUDE_DIRS})
160     find_library(JANSSON_LIBRARIES
161             NAMES jansson libjansson
162             HINTS ${PC_JANSSON_LIBDIR} ${PC_JANSSON_LIBRARY_DIRS})
163     if (JANSSON_INCLUDE_DIRS AND JANSSON_LIBRARIES)
164         set(JANSSON_FOUND ON)
165     endif (JANSSON_INCLUDE_DIRS AND JANSSON_LIBRARIES)
166 endif (NOT SKIPJANSSONSYSTEM EQUAL 1)
168 if(EMBED_BZIP2)
169     cmake_policy(SET CMP0114 NEW)
170     set(BZIP2_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/deps/bzip2/src/bzip2)
171     # Specify SOURCE_DIR will cause some errors
172     ExternalProject_Add(bzip2
173         GIT_REPOSITORY        https://android.googlesource.com/platform/external/bzip2
174         GIT_TAG               platform-tools-30.0.2
175         PREFIX                deps/bzip2
176         # SOURCE_DIR            ${CMAKE_CURRENT_SOURCE_DIR}/deps/bzip2
177         CONFIGURE_COMMAND     mkdir -p ${BZIP2_BUILD_DIR} && git archive --format tar HEAD | tar -C ${BZIP2_BUILD_DIR} -x
178         BUILD_IN_SOURCE       ON
179         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
180         INSTALL_COMMAND       ""
181         LOG_DOWNLOAD          ON
182     )
183     ExternalProject_Add_StepTargets(bzip2 configure build install)
184     set(BZIP2_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/deps/bzip2/src/bzip2)
185     set(BZIP2_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/deps/bzip2/src/bzip2/libbz2.a)
186     set(BZIP2_FOUND ON)
187 else(EMBED_BZIP2)
188     find_package (BZip2 REQUIRED)
189 endif(EMBED_BZIP2)
191 if(EMBED_LZ4)
192     cmake_policy(SET CMP0114 NEW)
193     set(LZ4_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/deps/lz4/src/lz4)
194     # Specify SOURCE_DIR will cause some errors
195     ExternalProject_Add(lz4
196         GIT_REPOSITORY        https://android.googlesource.com/platform/external/lz4
197         GIT_TAG               platform-tools-30.0.2
198         PREFIX                deps/lz4
199         # SOURCE_DIR            ${CMAKE_CURRENT_SOURCE_DIR}/deps/lz4
200         CONFIGURE_COMMAND     mkdir -p ${LZ4_BUILD_DIR} && git archive --format tar HEAD | tar -C ${LZ4_BUILD_DIR} -x
201         BUILD_IN_SOURCE       ON
202         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
203         INSTALL_COMMAND       ""
204         LOG_DOWNLOAD          ON
205     )
206     ExternalProject_Add_StepTargets(lz4 configure build install)
207     set(LZ4_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/deps/lz4/src/lz4/lib)
208     set(LZ4_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/deps/lz4/src/lz4/lib/liblz4.a)
209     set(LZ4_FOUND ON)
210 else(EMBED_LZ4)
211     find_path(LZ4_INCLUDE_DIRS lz4frame.h)
212     find_library(LZ4_LIBRARIES lz4)
213 endif(EMBED_LZ4)
215 if (LZ4_INCLUDE_DIRS AND LZ4_LIBRARIES)
216     set(LZ4_FOUND ON)
217 endif (LZ4_INCLUDE_DIRS AND LZ4_LIBRARIES)
219 if (NOT SKIPGD EQUAL 1)
220     if (EMBED_GD)
221         cmake_policy(SET CMP0114 NEW)
222         set(GD_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/deps/gd)
223         # Specify SOURCE_DIR will cause some errors
224         ExternalProject_Add(gd
225             URL                   https://github.com/libgd/libgd/releases/download/gd-2.3.3/libgd-2.3.3.tar.gz
226             URL_HASH              SHA256=dd3f1f0bb016edcc0b2d082e8229c822ad1d02223511997c80461481759b1ed2
227             PREFIX                deps/gd
228             CMAKE_ARGS            -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DENABLE_CPP=0 -DCMAKE_INSTALL_PREFIX=.
229             PATCH_COMMAND         cat ${CMAKE_CURRENT_SOURCE_DIR}/deps/gd-static.patch | patch -p1
230         )
231         ExternalProject_Add_StepTargets(gd configure build install)
232         set(GD_INCLUDE_DIRS ${GD_BUILD_DIR}/src/gd-build/include)
233         set(GD_LIBRARIES ${GD_BUILD_DIR}/src/gd-build/lib/libgd.a)
234         set(GD_FOUND ON)
235     else (EMBED_GD)
236         pkg_search_module(GD QUIET gdlib)
237     endif (EMBED_GD)
238 endif (NOT SKIPGD EQUAL 1)
240 if (NOT SKIPWHEREAMISYSTEM EQUAL 1)
241     find_path(WHEREAMI_INCLUDE_DIRS whereami.h)
242     find_library(WHEREAMI_LIBRARIES whereami)
243     if (WHEREAMI_INCLUDE_DIRS AND WHEREAMI_LIBRARIES)
244         set(WHEREAMI_FOUND ON)
245     endif (WHEREAMI_INCLUDE_DIRS AND WHEREAMI_LIBRARIES)
246 endif (NOT SKIPWHEREAMISYSTEM EQUAL 1)
248 add_subdirectory(${PM3_ROOT}/client/deps deps)
250 set (TARGET_SOURCES
251         ${PM3_ROOT}/common/commonutil.c
252         ${PM3_ROOT}/common/util_posix.c
253         ${PM3_ROOT}/common/bucketsort.c
254         ${PM3_ROOT}/common/crapto1/crapto1.c
255         ${PM3_ROOT}/common/crapto1/crypto1.c
256         ${PM3_ROOT}/common/crc.c
257         ${PM3_ROOT}/common/crc16.c
258         ${PM3_ROOT}/common/crc32.c
259         ${PM3_ROOT}/common/crc64.c
260         ${PM3_ROOT}/common/lfdemod.c
261         ${PM3_ROOT}/common/legic_prng.c
262         ${PM3_ROOT}/common/iso15693tools.c
263         ${PM3_ROOT}/common/cardhelper.c
264         ${PM3_ROOT}/common/generator.c
265         ${PM3_ROOT}/common/bruteforce.c
266         ${PM3_ROOT}/common/hitag2/hitag2_crypto.c
267         ${PM3_ROOT}/client/src/crypto/asn1dump.c
268         ${PM3_ROOT}/client/src/crypto/asn1utils.c
269         ${PM3_ROOT}/client/src/crypto/libpcrypto.c
270         ${PM3_ROOT}/client/src/emv/test/cda_test.c
271         ${PM3_ROOT}/client/src/emv/test/crypto_test.c
272         ${PM3_ROOT}/client/src/emv/test/cryptotest.c
273         ${PM3_ROOT}/client/src/emv/test/dda_test.c
274         ${PM3_ROOT}/client/src/emv/test/sda_test.c
275         ${PM3_ROOT}/client/src/emv/cmdemv.c
276         ${PM3_ROOT}/client/src/emv/crypto.c
277         ${PM3_ROOT}/client/src/emv/crypto_polarssl.c
278         ${PM3_ROOT}/client/src/emv/dol.c
279         ${PM3_ROOT}/client/src/emv/emv_pk.c
280         ${PM3_ROOT}/client/src/emv/emv_pki.c
281         ${PM3_ROOT}/client/src/emv/emv_pki_priv.c
282         ${PM3_ROOT}/client/src/emv/emv_roca.c
283         ${PM3_ROOT}/client/src/emv/emv_tags.c
284         ${PM3_ROOT}/client/src/emv/emvcore.c
285         ${PM3_ROOT}/client/src/emv/emvjson.c
286         ${PM3_ROOT}/client/src/emv/tlv.c
287         ${PM3_ROOT}/client/src/fido/additional_ca.c
288         ${PM3_ROOT}/client/src/fido/cbortools.c
289         ${PM3_ROOT}/client/src/fido/cose.c
290         ${PM3_ROOT}/client/src/fido/fidocore.c
291         ${PM3_ROOT}/client/src/iso7816/apduinfo.c
292         ${PM3_ROOT}/client/src/iso7816/iso7816core.c
293         ${PM3_ROOT}/client/src/ksx6924/ksx6924core.c
294         ${PM3_ROOT}/client/src/cipurse/cipursecrypto.c
295         ${PM3_ROOT}/client/src/cipurse/cipursecore.c
296         ${PM3_ROOT}/client/src/cipurse/cipursetest.c
297         ${PM3_ROOT}/client/src/loclass/cipher.c
298         ${PM3_ROOT}/client/src/loclass/cipherutils.c
299         ${PM3_ROOT}/client/src/loclass/elite_crack.c
300         ${PM3_ROOT}/client/src/loclass/hash1_brute.c
301         ${PM3_ROOT}/client/src/loclass/ikeys.c
302         ${PM3_ROOT}/client/src/mifare/mad.c
303         ${PM3_ROOT}/client/src/mifare/aiddesfire.c
304         ${PM3_ROOT}/client/src/mifare/mfkey.c
305         ${PM3_ROOT}/client/src/mifare/mifare4.c
306         ${PM3_ROOT}/client/src/mifare/mifaredefault.c
307         ${PM3_ROOT}/client/src/mifare/mifarehost.c
308         ${PM3_ROOT}/client/src/mifare/gen4.c
309         ${PM3_ROOT}/client/src/nfc/ndef.c
310         ${PM3_ROOT}/client/src/mifare/lrpcrypto.c
311         ${PM3_ROOT}/client/src/mifare/desfirecrypto.c
312         ${PM3_ROOT}/client/src/mifare/desfiresecurechan.c
313         ${PM3_ROOT}/client/src/mifare/desfirecore.c
314         ${PM3_ROOT}/client/src/mifare/desfiretest.c
315         ${PM3_ROOT}/client/src/mifare/gallaghercore.c
316         ${PM3_ROOT}/client/src/uart/ringbuffer.c
317         ${PM3_ROOT}/client/src/uart/uart_common.c
318         ${PM3_ROOT}/client/src/uart/uart_posix.c
319         ${PM3_ROOT}/client/src/uart/uart_win32.c
320         ${PM3_ROOT}/client/src/ui/overlays.ui
321         ${PM3_ROOT}/client/src/ui/image.ui
322         ${PM3_ROOT}/client/src/aidsearch.c
323         ${PM3_ROOT}/client/src/atrs.c
324         ${PM3_ROOT}/client/src/cmdanalyse.c
325         ${PM3_ROOT}/client/src/cmdcrc.c
326         ${PM3_ROOT}/client/src/cmddata.c
327         ${PM3_ROOT}/client/src/cmdflashmem.c
328         ${PM3_ROOT}/client/src/cmdflashmemspiffs.c
329         ${PM3_ROOT}/client/src/cmdhf.c
330         ${PM3_ROOT}/client/src/cmdhf14a.c
331         ${PM3_ROOT}/client/src/cmdhf14b.c
332         ${PM3_ROOT}/client/src/cmdhf15.c
333         ${PM3_ROOT}/client/src/cmdhfcryptorf.c
334         ${PM3_ROOT}/client/src/cmdhfemrtd.c
335         ${PM3_ROOT}/client/src/cmdhfepa.c
336         ${PM3_ROOT}/client/src/cmdhffelica.c
337         ${PM3_ROOT}/client/src/cmdhffido.c
338         ${PM3_ROOT}/client/src/cmdhffudan.c
339         ${PM3_ROOT}/client/src/cmdhfgallagher.c
340         ${PM3_ROOT}/client/src/cmdhfcipurse.c
341         ${PM3_ROOT}/client/src/cmdhficlass.c
342         ${PM3_ROOT}/client/src/cmdhfict.c
343         ${PM3_ROOT}/client/src/cmdhfjooki.c
344         ${PM3_ROOT}/client/src/cmdhfksx6924.c
345         ${PM3_ROOT}/client/src/cmdhflegic.c
346         ${PM3_ROOT}/client/src/cmdhflist.c
347         ${PM3_ROOT}/client/src/cmdhflto.c
348         ${PM3_ROOT}/client/src/cmdhfmf.c
349         ${PM3_ROOT}/client/src/cmdhfmfdes.c
350         ${PM3_ROOT}/client/src/cmdhfmfhard.c
351         ${PM3_ROOT}/client/src/cmdhfmfp.c
352         ${PM3_ROOT}/client/src/cmdhfmfu.c
353         ${PM3_ROOT}/client/src/cmdhfntag424.c
354         ${PM3_ROOT}/client/src/cmdhfseos.c
355         ${PM3_ROOT}/client/src/cmdhfst.c
356         ${PM3_ROOT}/client/src/cmdhfst25ta.c
357         ${PM3_ROOT}/client/src/cmdhftesla.c
358         ${PM3_ROOT}/client/src/cmdhftexkom.c
359         ${PM3_ROOT}/client/src/cmdhfthinfilm.c
360         ${PM3_ROOT}/client/src/cmdhftopaz.c
361         ${PM3_ROOT}/client/src/cmdhfvas.c
362         ${PM3_ROOT}/client/src/cmdhfxerox.c
363         ${PM3_ROOT}/client/src/cmdhw.c
364         ${PM3_ROOT}/client/src/cmdlf.c
365         ${PM3_ROOT}/client/src/cmdlfawid.c
366         ${PM3_ROOT}/client/src/cmdlfcotag.c
367         ${PM3_ROOT}/client/src/cmdlfdestron.c
368         ${PM3_ROOT}/client/src/cmdlfem.c
369         ${PM3_ROOT}/client/src/cmdlfem410x.c
370         ${PM3_ROOT}/client/src/cmdlfem4x05.c
371         ${PM3_ROOT}/client/src/cmdlfem4x50.c
372         ${PM3_ROOT}/client/src/cmdlfem4x70.c
373         ${PM3_ROOT}/client/src/cmdlffdxb.c
374         ${PM3_ROOT}/client/src/cmdlfgallagher.c
375         ${PM3_ROOT}/client/src/cmdlfguard.c
376         ${PM3_ROOT}/client/src/cmdlfhid.c
377         ${PM3_ROOT}/client/src/cmdlfhitag.c
378         ${PM3_ROOT}/client/src/cmdlfhitaghts.c
379         ${PM3_ROOT}/client/src/cmdlfidteck.c
380         ${PM3_ROOT}/client/src/cmdlfindala.c
381         ${PM3_ROOT}/client/src/cmdlfio.c
382         ${PM3_ROOT}/client/src/cmdlfjablotron.c
383         ${PM3_ROOT}/client/src/cmdlfkeri.c
384         ${PM3_ROOT}/client/src/cmdlfmotorola.c
385         ${PM3_ROOT}/client/src/cmdlfnedap.c
386         ${PM3_ROOT}/client/src/cmdlfnexwatch.c
387         ${PM3_ROOT}/client/src/cmdlfnoralsy.c
388         ${PM3_ROOT}/client/src/cmdlfpac.c
389         ${PM3_ROOT}/client/src/cmdlfparadox.c
390         ${PM3_ROOT}/client/src/cmdlfpcf7931.c
391         ${PM3_ROOT}/client/src/cmdlfpresco.c
392         ${PM3_ROOT}/client/src/cmdlfpyramid.c
393         ${PM3_ROOT}/client/src/cmdlfsecurakey.c
394         ${PM3_ROOT}/client/src/cmdlft55xx.c
395         ${PM3_ROOT}/client/src/cmdlfti.c
396         ${PM3_ROOT}/client/src/cmdlfviking.c
397         ${PM3_ROOT}/client/src/cmdlfvisa2000.c
398         ${PM3_ROOT}/client/src/cmdlfzx8211.c
399         ${PM3_ROOT}/client/src/cmdmain.c
400         ${PM3_ROOT}/client/src/cmdnfc.c
401         ${PM3_ROOT}/client/src/cmdparser.c
402         ${PM3_ROOT}/client/src/cmdpiv.c
403         ${PM3_ROOT}/client/src/cmdscript.c
404         ${PM3_ROOT}/client/src/cmdsmartcard.c
405         ${PM3_ROOT}/client/src/cmdtrace.c
406         ${PM3_ROOT}/client/src/cmdusart.c
407         ${PM3_ROOT}/client/src/cmdwiegand.c
408         ${PM3_ROOT}/client/src/comms.c
409         ${PM3_ROOT}/client/src/fileutils.c
410         ${PM3_ROOT}/client/src/flash.c
411         ${PM3_ROOT}/client/src/graph.c
412         ${PM3_ROOT}/client/src/iso4217.c
413         ${PM3_ROOT}/client/src/jansson_path.c
414         ${PM3_ROOT}/client/src/lua_bitlib.c
415         ${PM3_ROOT}/client/src/preferences.c
416         ${PM3_ROOT}/client/src/pm3.c
417         ${PM3_ROOT}/client/src/pm3_binlib.c
418         ${PM3_ROOT}/client/src/pm3_bitlib.c
419         ${PM3_ROOT}/client/src/pm3line.c
420         ${PM3_ROOT}/client/src/scandir.c
421         ${PM3_ROOT}/client/src/scripting.c
422         ${PM3_ROOT}/client/src/ui.c
423         ${PM3_ROOT}/client/src/util.c
424         ${PM3_ROOT}/client/src/wiegand_formats.c
425         ${PM3_ROOT}/client/src/wiegand_formatutils.c
426         ${CMAKE_BINARY_DIR}/version_pm3.c
427         )
429 add_custom_command(
430     OUTPUT  ${CMAKE_BINARY_DIR}/version_pm3.c
431     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
432     DEPENDS ${PM3_ROOT}/common/default_version_pm3.c
435 set(ADDITIONAL_SRC "")
436 set(ADDITIONAL_LNK "")
437 set(ADDITIONAL_DIRS "")
438 set(ADDITIONAL_LNKDIRS "")
439 set(X86_CPUS x86 x86_64 i686)
441 message(STATUS "CMAKE_SYSTEM_PROCESSOR := ${CMAKE_SYSTEM_PROCESSOR}")
443 if (APPLE)
444     message(STATUS "Apple device detected.")
445     set(ADDITIONAL_SRC ${PM3_ROOT}/client/src/util_darwin.h  ${PM3_ROOT}/client/src/util_darwin.m ${ADDITIONAL_SRC})
447     find_library(UIKIT_LIBRARY UIKit)
448     if (NOT UIKIT_LIBRARY)
449         message(STATUS "UIKit.framework NOT found!")
450     else()
451         message(STATUS "UIKit.framework found! ${UIKIT_LIBRARY}")
452         set(ADDITIONAL_LNK "-framework Foundation" "-framework UIKit")
453     endif()
455     find_library(APPKIT_LIBRARY AppKit)
456     if (NOT APPKIT_LIBRARY)
457       message(STATUS "AppKit.framework NOT found!")
458     else()
459       message(STATUS "AppKit.framework found! ${APPKIT_LIBRARY}")
460       set(ADDITIONAL_LNK "-framework Foundation" "-framework AppKit")
461     endif()
462 endif (APPLE)
464 if ((NOT SKIPQT EQUAL 1) AND (Qt5_FOUND))
465     set(CMAKE_AUTOMOC ON)
466     set(CMAKE_AUTORCC ON)
467     set(CMAKE_AUTOUIC ON)
468     set (TARGET_SOURCES
469             ${PM3_ROOT}/client/src/proxgui.cpp
470             ${PM3_ROOT}/client/src/proxguiqt.cpp
471             ${TARGET_SOURCES})
473     add_definitions("-DHAVE_GUI")
474     set(ADDITIONAL_LNK ${Qt5_LIBRARIES} ${ADDITIONAL_LNK})
475 else ((NOT SKIPQT EQUAL 1) AND (Qt5_FOUND))
476     set(TARGET_SOURCES
477             ${PM3_ROOT}/client/src/guidummy.cpp
478             ${TARGET_SOURCES})
479 endif ((NOT SKIPQT EQUAL 1) AND (Qt5_FOUND))
481 if (NOT SKIPBT EQUAL 1)
482     if (BLUEZ_FOUND)
483         add_definitions("-DHAVE_BLUEZ")
484         set(ADDITIONAL_LNK ${BLUEZ_LIBRARIES} ${ADDITIONAL_LNK})
485     endif (BLUEZ_FOUND)
486 endif(NOT SKIPBT EQUAL 1)
488 if (JANSSON_FOUND)
489     set(ADDITIONAL_DIRS ${JANSSON_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
490     set(ADDITIONAL_LNK ${JANSSON_LIBRARIES} ${ADDITIONAL_LNK})
491 endif (JANSSON_FOUND)
493 if (NOT SKIPPYTHON EQUAL 1)
494     if (PYTHON3EMBED_FOUND)
495         add_definitions(-DHAVE_PYTHON)
496         set(ADDITIONAL_DIRS ${PYTHON3EMBED_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
497         set(ADDITIONAL_LNK ${PYTHON3EMBED_LIBRARIES} ${ADDITIONAL_LNK})
498         set(ADDITIONAL_LNKDIRS ${PYTHON3EMBED_LIBRARY_DIRS} ${ADDITIONAL_LNKDIRS})
499     elseif (PYTHON3_FOUND)
500         add_definitions(-DHAVE_PYTHON)
501         set(ADDITIONAL_DIRS ${PYTHON3_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
502         set(ADDITIONAL_LNK ${PYTHON3_LIBRARIES} ${ADDITIONAL_LNK})
503         set(ADDITIONAL_LNKDIRS ${PYTHON3_LIBRARY_DIRS} ${ADDITIONAL_LNKDIRS})
504     endif (PYTHON3EMBED_FOUND)
505 endif (NOT SKIPPYTHON EQUAL 1)
507 if (NOT SKIPREADLINE EQUAL 1)
508     if (READLINE_FOUND)
509         add_definitions("-DHAVE_READLINE")
510         set(ADDITIONAL_DIRS ${READLINE_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
511         set(ADDITIONAL_LNK ${READLINE_LIBRARIES} ${ADDITIONAL_LNK})
512     endif (READLINE_FOUND)
513 endif(NOT SKIPREADLINE EQUAL 1)
515 if (BZIP2_FOUND)
516     set(ADDITIONAL_DIRS ${BZIP2_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
517     set(ADDITIONAL_LNK ${BZIP2_LIBRARIES} ${ADDITIONAL_LNK})
518 endif (BZIP2_FOUND)
520 if (LZ4_FOUND)
521     set(ADDITIONAL_DIRS ${LZ4_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
522     set(ADDITIONAL_LNK ${LZ4_LIBRARIES} ${ADDITIONAL_LNK})
523 endif (LZ4_FOUND)
525 if (NOT SKIPGD EQUAL 1 AND GD_FOUND)
526     set(ADDITIONAL_DIRS ${GD_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
527     set(ADDITIONAL_LNK ${GD_LIBRARIES} ${ADDITIONAL_LNK})
528     set(ADDITIONAL_LNKDIRS ${GD_LIBRARY_DIRS} ${ADDITIONAL_LNKDIRS})
529     set(TARGET_SOURCES
530             ${PM3_ROOT}/client/src/imgutils.c
531             ${PM3_ROOT}/client/src/cmdhfwaveshare.c
532             ${TARGET_SOURCES})
533     add_definitions("-DHAVE_GD")
534 endif (NOT SKIPGD EQUAL 1 AND GD_FOUND)
536 if (WHEREAMI_FOUND)
537     set(ADDITIONAL_DIRS ${WHEREAMI_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
538     set(ADDITIONAL_LNK ${WHEREAMI_LIBRARIES} ${ADDITIONAL_LNK})
539 endif (WHEREAMI_FOUND)
541 message(STATUS "===================================================================")
542 execute_process(
543     COMMAND sh ${PM3_ROOT}/tools/mkversion.sh --short
544     OUTPUT_VARIABLE version_pm3
546 string(STRIP ${version_pm3} version_pm3)
547 message(STATUS "Version info:      ${version_pm3}")
548 if (SKIPQT EQUAL 1)
549     message(STATUS "GUI support:       skipped")
550 else (SKIPQT EQUAL 1)
551     if (Qt5_FOUND)
552         message(STATUS "GUI support:       QT5 found, enabled")
553     else (Qt5_FOUND)
554         message(STATUS "GUI support:       QT5 not found, disabled")
555     endif (Qt5_FOUND)
556 endif (SKIPQT EQUAL 1)
558 if (SKIPBT EQUAL 1)
559     message(STATUS "native BT support: skipped")
560 else (SKIPBT EQUAL 1)
561     if (BLUEZ_FOUND)
562         message(STATUS "native BT support: Bluez found, enabled")
563     else (BLUEZ_FOUND)
564         message(STATUS "native BT support: Bluez not found, disabled")
565     endif (BLUEZ_FOUND)
566 endif(SKIPBT EQUAL 1)
568 if (BZIP2_FOUND)
569     if (EMBED_BZIP2)
570         message(STATUS "Bzip2 library:     embedded")
571     else (EMBED_BZIP2)
572         message(STATUS "Bzip2 library:     system library found")
573     endif (EMBED_BZIP2)
574 else (BZIP2_FOUND)
575     message(SEND_ERROR "Bzip2 library:     Bzip2 not found")
576 endif (BZIP2_FOUND)
578 if (LZ4_FOUND)
579     if (EMBED_LZ4)
580         message(STATUS "LZ4 library:       embedded")
581     else (EMBED_LZ4)
582         message(STATUS "LZ4 library:       system library found")
583     endif (EMBED_LZ4)
584 else (LZ4_FOUND)
585     message(SEND_ERROR "LZ4 library:       LZ4 not found")
586 endif (LZ4_FOUND)
588 if (SKIPGD EQUAL 1)
589     message(STATUS "GD library:        skipped")
590 elseif (GD_FOUND)
591     if (EMBED_GD)
592         message(STATUS "GD library:        embedded")
593     else (EMBED_GD)
594         message(STATUS "GD library:        system library found")
595     endif (EMBED_GD)
596 else (SKIPGD EQUAL 1)
597     message(STATUS "GD library:        GD not found, disabled")
598 endif (SKIPGD EQUAL 1)
600 if (SKIPJANSSONSYSTEM EQUAL 1)
601     message(STATUS "Jansson library:   local library forced")
602 else (SKIPJANSSONSYSTEM EQUAL 1)
603     if (JANSSON_FOUND)
604         message(STATUS "Jansson library:   system library found")
605     else (JANSSON_FOUND)
606         message(STATUS "Jansson library:   system library not found, using local library")
607     endif (JANSSON_FOUND)
608 endif (SKIPJANSSONSYSTEM EQUAL 1)
610 if (SKIPPYTHON EQUAL 1)
611     message(STATUS "Python3 library:   skipped")
612 else (SKIPPYTHON EQUAL 1)
613     if (PYTHON3EMBED_FOUND)
614         message(STATUS "Python3 library:   Python3 embed found, enabled")
615     elseif (PYTHON3_FOUND)
616         message(STATUS "Python3 library:   Python3 found, enabled")
617     else (PYTHON3EMBED_FOUND)
618         message(STATUS "Python3 library:   Python3 not found, disabled")
619     endif (PYTHON3EMBED_FOUND)
620 endif(SKIPPYTHON EQUAL 1)
622 if (SKIPREADLINE EQUAL 1)
623     message(STATUS "Readline library:  skipped")
624 else (SKIPREADLINE EQUAL 1)
625     if (READLINE_FOUND)
626         if (EMBED_READLINE)
627             message(STATUS "Readline library:  embedded")
628         else (EMBED_READLINE)
629             message(STATUS "Readline library:  system library found")
630         endif (EMBED_READLINE)
631     else (READLINE_FOUND)
632         message(STATUS "Readline library:  Readline not found, disabled")
633     endif (READLINE_FOUND)
634 endif(SKIPREADLINE EQUAL 1)
636 if (NOT READLINE_FOUND)
637     if (SKIPLINENOISE EQUAL 1)
638         message(STATUS "Linenoise library: skipped")
639     else (SKIPLINENOISE EQUAL 1)
640         if (LINENOISE_LOCAL_FOUND)
641             message(STATUS "Linenoise library: enabled")
642         else (LINENOISE_LOCAL_FOUND)
643             message(STATUS "Linenoise library: Linenoise not found, disabled")
644         endif (LINENOISE_LOCAL_FOUND)
645     endif (SKIPLINENOISE EQUAL 1)
646 endif (NOT READLINE_FOUND)
648 if (SKIPWHEREAMISYSTEM EQUAL 1)
649     message(STATUS "Whereami library:  local library forced")
650 else (SKIPWHEREAMISYSTEM EQUAL 1)
651     if (WHEREAMI_FOUND)
652         message(STATUS "Whereami library:  system library found")
653     else (WHEREAMI_FOUND)
654         message(STATUS "Whereami library:  system library not found, using local library")
655     endif (WHEREAMI_FOUND)
656 endif (SKIPWHEREAMISYSTEM EQUAL 1)
658 # Lua SWIG
659 if (EXISTS ${PM3_ROOT}/client/src/pm3_luawrap.c)
660     set (TARGET_SOURCES
661             ${PM3_ROOT}/client/src/pm3_luawrap.c
662             ${TARGET_SOURCES})
663     add_definitions(-DHAVE_LUA_SWIG)
664     message(STATUS "Lua SWIG:          wrapper found")
665 endif (EXISTS ${PM3_ROOT}/client/src/pm3_luawrap.c)
667 # Python SWIG
668 if (NOT SKIPPYTHON EQUAL 1)
669     if (PYTHON3EMBED_FOUND OR PYTHON3_FOUND)
670         if (EXISTS ${PM3_ROOT}/client/src/pm3_pywrap.c)
671             set (TARGET_SOURCES
672                     ${PM3_ROOT}/client/src/pm3_pywrap.c
673                     ${TARGET_SOURCES})
674             add_definitions(-DHAVE_PYTHON_SWIG)
675             message(STATUS "Python SWIG:       wrapper found")
676         endif (EXISTS ${PM3_ROOT}/client/src/pm3_pywrap.c)
677     endif (PYTHON3EMBED_FOUND OR PYTHON3_FOUND)
678 endif (NOT SKIPPYTHON EQUAL 1)
679 message(STATUS "===================================================================")
681 add_definitions(-DHAVE_SNPRINTF)
683 add_executable(proxmark3
684         ${PM3_ROOT}/client/src/proxmark3.c
685         ${TARGET_SOURCES}
686         ${ADDITIONAL_SRC}
689 target_compile_options(proxmark3 PUBLIC -Wall -Werror -O3)
690 if (EMBED_READLINE)
691     if (NOT SKIPREADLINE EQUAL 1)
692         add_dependencies(proxmark3 ncurses readline)
693     endif (NOT SKIPREADLINE EQUAL 1)
694 endif (EMBED_READLINE)
695 if (EMBED_BZIP2)
696     add_dependencies(proxmark3 bzip2)
697 endif (EMBED_BZIP2)
698 if (EMBED_LZ4)
699     add_dependencies(proxmark3 lz4)
700 endif (EMBED_LZ4)
702 if (MINGW)
703     # Mingw uses by default Microsoft printf, we want the GNU printf (e.g. for %z)
704     # and setting _ISOC99_SOURCE sets internally __USE_MINGW_ANSI_STDIO=1
705     # FTR __USE_MINGW_ANSI_STDIO seems deprecated in Mingw32
706     # but not Mingw64 https://fr.osdn.net/projects/mingw/lists/archive/users/2019-January/000199.html
707     target_compile_definitions(proxmark3 PRIVATE _ISOC99_SOURCE)
709     set(CMAKE_C_FLAGS "-mno-ms-bitfields -fexec-charset=cp850 ${CMAKE_C_FLAGS}")
710     set(CMAKE_CXX_FLAGS "-mno-ms-bitfields -fexec-charset=cp850 ${CMAKE_CXX_FLAGS}")
712     # link Winsock2
713     set(ADDITIONAL_LNK ws2_32 ${ADDITIONAL_LNK})
714 endif (MINGW)
716 # GCC 10 has issues with false positives on stringop-overflow,
717 # 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)
718 # beware these flags didn't exist for GCC < 7
719 if(CMAKE_COMPILER_IS_GNUCXX)
720     execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
721     if (GCC_VERSION VERSION_GREATER 10.0 OR GCC_VERSION VERSION_EQUAL 10.0)
722         set(CMAKE_C_FLAGS "-Wno-stringop-overflow -Wno-error=stringop-overflow ${CMAKE_C_FLAGS}")
723         set(CMAKE_CXX_FLAGS "-Wno-stringop-overflow -Wno-error=stringop-overflow ${CMAKE_CXX_FLAGS}")
724     endif()
725 endif(CMAKE_COMPILER_IS_GNUCXX)
727 target_include_directories(proxmark3 PRIVATE
728         ${PM3_ROOT}/common
729         ${PM3_ROOT}/common_fpga
730         ${PM3_ROOT}/include
731         ${PM3_ROOT}/client/src
732         ${PM3_ROOT}/client/include
733         ${ADDITIONAL_DIRS}
736 if (NOT APPLE)
737     # required for Raspberry Pi, but breaks with clang (OSX). Need to be at the end of the linker line.
738     set(ADDITIONAL_LNK ${ADDITIONAL_LNK} -Wl,--as-needed -latomic -Wl,--no-as-needed)
739 else (NOT APPLE)
740     #set_property(TARGET proxmark3 PROPERTY LINK_FLAGS "-Wl,-undefined dynamic_lookup")
741     set(ADDITIONAL_LNK ${ADDITIONAL_LNK} -Wl,-undefined,dynamic_lookup)
742 endif (NOT APPLE)
744 if (NOT JANSSON_FOUND)
745     set(ADDITIONAL_LNK pm3rrg_rdv4_jansson ${ADDITIONAL_LNK})
746 endif (NOT JANSSON_FOUND)
748 if (NOT READLINE_FOUND)
749     if (LINENOISE_LOCAL_FOUND)
750         add_definitions("-DHAVE_LINENOISE")
751         set(ADDITIONAL_LNK pm3rrg_rdv4_linenoise ${ADDITIONAL_LNK})
752     endif (LINENOISE_LOCAL_FOUND)
753 endif (NOT READLINE_FOUND)
755 if (NOT WHEREAMI_FOUND)
756     set(ADDITIONAL_LNK pm3rrg_rdv4_whereami ${ADDITIONAL_LNK})
757 endif (NOT WHEREAMI_FOUND)
759 target_link_libraries(proxmark3 PRIVATE
760         m
761         pm3rrg_rdv4_mbedtls
762         pm3rrg_rdv4_cliparser
763         pm3rrg_rdv4_lua
764         pm3rrg_rdv4_tinycbor
765         pm3rrg_rdv4_amiibo
766         pm3rrg_rdv4_reveng
767         pm3rrg_rdv4_hardnested
768         pm3rrg_rdv4_id48
769         ${ADDITIONAL_LNK})
771 if (NOT SKIPPTHREAD EQUAL 1)
772     target_link_libraries(proxmark3 PRIVATE pthread)
773 endif (NOT SKIPPTHREAD EQUAL 1)
775 if (NOT SKIPPYTHON EQUAL 1)
776     # OSX have a hard time compiling python3 dependency with older cmake.
777     if (PYTHON3EMBED_FOUND OR PYTHON3_FOUND)
778         if (CMAKE_VERSION VERSION_LESS 3.13)
779             message( SEND_ERROR "Your CMAKE version is too old for Apple platform, please update to a version >=3.13" )
780         endif (CMAKE_VERSION VERSION_LESS 3.13)
781     endif (PYTHON3EMBED_FOUND OR PYTHON3_FOUND)
782 endif (NOT SKIPPYTHON EQUAL 1)
784 target_link_directories(proxmark3 PRIVATE ${ADDITIONAL_LNKDIRS})
786 install(TARGETS proxmark3 DESTINATION "bin")
787 install(DIRECTORY cmdscripts lualibs luascripts pyscripts resources dictionaries DESTINATION "share/proxmark3")
789 add_custom_command(OUTPUT lualibs/pm3_cmd.lua
790         COMMAND "awk -f pm3_cmd_h2lua.awk ../include/pm3_cmd.h >  lualibs/pm3_cmd.lua"
791         COMMENT "Creating lualibs/pm3_cmd.lua"
792         )
794 add_custom_command(OUTPUT lualibs/mfc_default_keys.lua
795         COMMAND "awk -f default_keys_dic2lua.awk mfc_default_keys.dic >  lualibs/mfc_default_keys.lua"
796         COMMENT "Creating lualibs/mfc_default_keys.lua"
797         )
799 #"make package" will trigger this
800 SET(CPACK_GENERATOR "DEB")
801 SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Iceman")
802 INCLUDE(CPack)