2022-01-07 08:58:03 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
|
|
|
|
#
|
|
|
|
# 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 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# See LICENSE.txt for the text of the license.
|
|
|
|
#-----------------------------------------------------------------------------
|
2020-06-18 16:00:44 +08:00
|
|
|
# Usage:
|
|
|
|
# mkdir build
|
|
|
|
# cd build
|
|
|
|
# cmake .. (see below for options)
|
|
|
|
# make (VERBOSE=1 if needed)
|
|
|
|
#
|
2020-04-23 00:58:53 +08:00
|
|
|
# MINGW:
|
|
|
|
# On ProxSpace 3.4:
|
|
|
|
# cmake -G"MSYS Makefiles" ..
|
|
|
|
# On Proxspace 3.3 or less, you need to install cmake:
|
|
|
|
# pacman -S mingw-w64-x86_64-cmake
|
|
|
|
# /mingw64/bin/cmake -G"MSYS Makefiles" ..
|
2020-06-11 18:38:07 +08:00
|
|
|
#
|
2020-06-18 15:57:50 +08:00
|
|
|
# Android cross-compilation: (ANDROID_ABI=arm64-v8a for a 64b version)
|
2020-06-11 18:38:07 +08:00
|
|
|
# cmake \
|
|
|
|
# -DCMAKE_TOOLCHAIN_FILE=<path-to-your-android-ndk>/build/cmake/android.toolchain.cmake \
|
|
|
|
# -DANDROID_ABI=armeabi-v7a \
|
|
|
|
# -DANDROID_NATIVE_API_LEVEL=android-19 \
|
|
|
|
# -DSKIPBT=1 -DSKIPPYTHON=1 -DSKIPPTHREAD=1 ..
|
2020-04-23 00:58:53 +08:00
|
|
|
|
2020-10-21 02:54:48 +08:00
|
|
|
message(STATUS "CMake ${CMAKE_VERSION}")
|
2020-04-17 20:31:29 +08:00
|
|
|
cmake_minimum_required(VERSION 3.10)
|
2020-04-16 16:57:53 +08:00
|
|
|
project(proxmark3)
|
2020-06-02 07:16:21 +08:00
|
|
|
SET (PM3_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
2020-04-16 16:57:53 +08:00
|
|
|
|
2020-04-16 22:44:15 +08:00
|
|
|
if(CMAKE_VERSION VERSION_LESS "3.7.0")
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
endif()
|
|
|
|
|
2020-06-18 08:06:03 +08:00
|
|
|
find_package(PkgConfig)
|
|
|
|
|
2020-06-09 06:34:41 +08:00
|
|
|
if (NOT SKIPQT EQUAL 1)
|
|
|
|
if(APPLE AND EXISTS /usr/local/opt/qt5)
|
|
|
|
# Homebrew installs Qt5 (up to at least 5.11.0) in
|
2021-01-04 08:27:20 +08:00
|
|
|
# /usr/local/opt/qt5. Ensure that it can be found by CMake
|
2020-06-09 06:34:41 +08:00
|
|
|
# since it is not in the default /usr/local prefix.
|
|
|
|
# Add it to PATHS so that it doesn't override the
|
|
|
|
# CMAKE_PREFIX_PATH environment variable.
|
|
|
|
# QT_FIND_PACKAGE_OPTIONS should be passed to find_package,
|
|
|
|
# e.g. find_package(Qt5Core ${QT_FIND_PACKAGE_OPTIONS})
|
|
|
|
list(APPEND QT_FIND_PACKAGE_OPTIONS PATHS /usr/local/opt/qt5)
|
|
|
|
endif(APPLE AND EXISTS /usr/local/opt/qt5)
|
2021-01-04 08:27:20 +08:00
|
|
|
if(APPLE AND EXISTS /opt/homebrew/opt/qt5)
|
|
|
|
# Homebrew on Apple Silicon installs Qt5 in
|
|
|
|
# /opt/homebrew/opt/qt5. Ensure that it can be found by CMake
|
|
|
|
# since it is not in the default /usr/local prefix.
|
|
|
|
# Add it to PATHS so that it doesn't override the
|
|
|
|
# CMAKE_PREFIX_PATH environment variable.
|
|
|
|
# QT_FIND_PACKAGE_OPTIONS should be passed to find_package,
|
|
|
|
# e.g. find_package(Qt5Core ${QT_FIND_PACKAGE_OPTIONS})
|
|
|
|
list(APPEND QT_FIND_PACKAGE_OPTIONS PATHS /opt/homebrew/opt/qt5)
|
|
|
|
endif(APPLE AND EXISTS /opt/homebrew/opt/qt5)
|
2020-06-09 06:34:41 +08:00
|
|
|
set(QT_PACKAGELIST
|
|
|
|
Qt5Core
|
|
|
|
Qt5Widgets
|
|
|
|
Qt5Gui
|
|
|
|
)
|
|
|
|
set(Qt5_FOUND ON)
|
|
|
|
foreach(_qt_package IN LISTS QT_PACKAGELIST)
|
|
|
|
find_package(${_qt_package} QUIET ${QT_FIND_PACKAGE_OPTIONS})
|
|
|
|
set(Qt5_LIBRARIES ${${_qt_package}_LIBRARIES} ${Qt5_LIBRARIES})
|
|
|
|
if(NOT ${_qt_package}_FOUND)
|
|
|
|
set(Qt5_FOUND OFF)
|
|
|
|
endif(NOT ${_qt_package}_FOUND)
|
|
|
|
endforeach()
|
|
|
|
endif (NOT SKIPQT EQUAL 1)
|
2020-04-16 16:57:53 +08:00
|
|
|
|
2020-06-09 06:16:42 +08:00
|
|
|
if (NOT SKIPBT EQUAL 1)
|
|
|
|
pkg_search_module(BLUEZ QUIET bluez)
|
2020-06-09 06:47:34 +08:00
|
|
|
endif (NOT SKIPBT EQUAL 1)
|
|
|
|
|
|
|
|
if (NOT SKIPPYTHON EQUAL 1)
|
|
|
|
pkg_search_module(PYTHON3 QUIET python3)
|
|
|
|
pkg_search_module(PYTHON3EMBED QUIET python3-embed)
|
|
|
|
endif (NOT SKIPPYTHON EQUAL 1)
|
2020-05-26 21:49:28 +08:00
|
|
|
|
2020-06-23 16:12:36 +08:00
|
|
|
# If cross-compiled, we need to init source and build.
|
|
|
|
if (CMAKE_TOOLCHAIN_FILE)
|
2021-07-14 07:35:18 +08:00
|
|
|
if (ANDROID)
|
|
|
|
set(CFLAGS_EXTERNAL_LIB "CFLAGS=--target=${CMAKE_C_COMPILER_TARGET} -w")
|
|
|
|
endif (ANDROID)
|
2020-06-23 16:12:36 +08:00
|
|
|
set(EMBED_READLINE ON)
|
|
|
|
set(EMBED_BZIP2 ON)
|
|
|
|
endif (CMAKE_TOOLCHAIN_FILE)
|
|
|
|
|
|
|
|
if (EMBED_READLINE OR EMBED_BZIP2)
|
2020-06-11 18:38:07 +08:00
|
|
|
include(ExternalProject)
|
2020-06-23 16:12:36 +08:00
|
|
|
endif (EMBED_READLINE OR EMBED_BZIP2)
|
2020-06-11 18:38:07 +08:00
|
|
|
|
2020-06-09 04:15:47 +08:00
|
|
|
if (NOT SKIPREADLINE EQUAL 1)
|
|
|
|
if (APPLE)
|
2021-01-04 08:27:20 +08:00
|
|
|
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)
|
|
|
|
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)
|
2020-06-09 04:15:47 +08:00
|
|
|
endif (APPLE)
|
2020-06-23 16:12:36 +08:00
|
|
|
if (EMBED_READLINE)
|
2020-06-11 18:38:07 +08:00
|
|
|
ExternalProject_Add(ncurses
|
2020-12-23 05:56:57 +08:00
|
|
|
URL http://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.1.tar.gz
|
2020-06-11 18:38:07 +08:00
|
|
|
PREFIX deps/ncurses
|
|
|
|
DOWNLOAD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/deps/ncurses
|
2020-06-18 22:19:54 +08:00
|
|
|
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
|
2020-06-11 18:38:07 +08:00
|
|
|
BUILD_IN_SOURCE ON
|
2020-06-18 22:02:27 +08:00
|
|
|
BUILD_COMMAND make libs
|
2020-06-11 18:38:07 +08:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
LOG_DOWNLOAD ON
|
|
|
|
)
|
|
|
|
ExternalProject_Add_StepTargets(ncurses configure build install)
|
|
|
|
|
|
|
|
ExternalProject_Add(readline
|
2023-02-15 04:16:38 +08:00
|
|
|
URL ftp://ftp.gnu.org/gnu/readline/readline-8.2.tar.gz
|
2020-06-11 18:38:07 +08:00
|
|
|
PREFIX deps/readline
|
|
|
|
DOWNLOAD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/deps/readline
|
|
|
|
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
|
|
|
|
BUILD_IN_SOURCE ON
|
2020-06-18 22:02:27 +08:00
|
|
|
BUILD_COMMAND make
|
2020-06-11 18:38:07 +08:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
LOG_DOWNLOAD ON
|
|
|
|
)
|
|
|
|
ExternalProject_Add_StepTargets(readline configure build install)
|
|
|
|
set(READLINE_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/deps/readline/src/)
|
2020-06-18 22:19:54 +08:00
|
|
|
set(READLINE_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/deps/readline/src/readline/libreadline.a ${CMAKE_CURRENT_BINARY_DIR}/deps/ncurses/src/ncurses/lib/libtinfo.a)
|
2020-06-23 16:12:36 +08:00
|
|
|
else (EMBED_READLINE)
|
2020-06-11 18:38:07 +08:00
|
|
|
find_path(READLINE_INCLUDE_DIRS readline/readline.h)
|
|
|
|
find_library(READLINE_LIBRARIES readline)
|
2020-06-23 16:12:36 +08:00
|
|
|
endif (EMBED_READLINE)
|
2020-06-09 04:15:47 +08:00
|
|
|
if (READLINE_INCLUDE_DIRS AND READLINE_LIBRARIES)
|
|
|
|
set(READLINE_FOUND ON)
|
|
|
|
endif (READLINE_INCLUDE_DIRS AND READLINE_LIBRARIES)
|
2022-01-11 06:53:01 +08:00
|
|
|
else (NOT SKIPREADLINE EQUAL 1)
|
|
|
|
if (NOT SKIPLINENOISE EQUAL 1)
|
|
|
|
if (EXISTS ${PM3_ROOT}/client/deps/linenoise/)
|
|
|
|
set(LINENOISE_LOCAL_FOUND ON)
|
|
|
|
endif (EXISTS ${PM3_ROOT}/client/deps/linenoise/)
|
|
|
|
endif (NOT SKIPLINENOISE EQUAL 1)
|
2020-06-09 04:15:47 +08:00
|
|
|
endif (NOT SKIPREADLINE EQUAL 1)
|
|
|
|
|
2020-06-18 08:06:03 +08:00
|
|
|
if (NOT SKIPJANSSONSYSTEM EQUAL 1)
|
|
|
|
pkg_check_modules(PC_JANSSON QUIET jansson)
|
|
|
|
find_path(JANSSON_INCLUDE_DIRS
|
|
|
|
NAMES jansson.h
|
|
|
|
HINTS ${PC_JANSSON_INCLUDEDIR} ${PC_JANSSON_INCLUDE_DIRS})
|
|
|
|
find_library(JANSSON_LIBRARIES
|
|
|
|
NAMES jansson libjansson
|
|
|
|
HINTS ${PC_JANSSON_LIBDIR} ${PC_JANSSON_LIBRARY_DIRS})
|
|
|
|
if (JANSSON_INCLUDE_DIRS AND JANSSON_LIBRARIES)
|
|
|
|
set(JANSSON_FOUND ON)
|
|
|
|
endif (JANSSON_INCLUDE_DIRS AND JANSSON_LIBRARIES)
|
|
|
|
endif (NOT SKIPJANSSONSYSTEM EQUAL 1)
|
|
|
|
|
2020-06-23 16:12:36 +08:00
|
|
|
if(EMBED_BZIP2)
|
2020-06-11 18:38:07 +08:00
|
|
|
set(BZIP2_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/deps/bzip2/src/bzip2)
|
2023-03-11 00:27:48 +08:00
|
|
|
# Specify SOURCE_DIR will cause some errors
|
2020-06-11 18:38:07 +08:00
|
|
|
ExternalProject_Add(bzip2
|
|
|
|
GIT_REPOSITORY https://android.googlesource.com/platform/external/bzip2
|
|
|
|
GIT_TAG platform-tools-30.0.2
|
|
|
|
PREFIX deps/bzip2
|
2023-03-11 00:27:48 +08:00
|
|
|
# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/deps/bzip2
|
2020-06-11 18:38:07 +08:00
|
|
|
CONFIGURE_COMMAND mkdir -p ${BZIP2_BUILD_DIR} && git archive --format tar HEAD | tar -C ${BZIP2_BUILD_DIR} -x
|
|
|
|
BUILD_IN_SOURCE ON
|
|
|
|
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
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
LOG_DOWNLOAD ON
|
|
|
|
)
|
|
|
|
ExternalProject_Add_StepTargets(bzip2 configure build install)
|
|
|
|
set(BZIP2_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/deps/bzip2/src/bzip2)
|
|
|
|
set(BZIP2_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/deps/bzip2/src/bzip2/libbz2.a)
|
2020-06-18 06:50:52 +08:00
|
|
|
set(BZIP2_FOUND ON)
|
2020-06-23 16:12:36 +08:00
|
|
|
else(EMBED_BZIP2)
|
2020-06-18 06:50:52 +08:00
|
|
|
find_package (BZip2 REQUIRED)
|
2020-06-23 16:12:36 +08:00
|
|
|
endif(EMBED_BZIP2)
|
2020-06-11 18:38:07 +08:00
|
|
|
|
2020-06-18 07:51:36 +08:00
|
|
|
if (NOT SKIPWHEREAMISYSTEM EQUAL 1)
|
|
|
|
find_path(WHEREAMI_INCLUDE_DIRS whereami.h)
|
|
|
|
find_library(WHEREAMI_LIBRARIES whereami)
|
|
|
|
if (WHEREAMI_INCLUDE_DIRS AND WHEREAMI_LIBRARIES)
|
|
|
|
set(WHEREAMI_FOUND ON)
|
|
|
|
endif (WHEREAMI_INCLUDE_DIRS AND WHEREAMI_LIBRARIES)
|
|
|
|
endif (NOT SKIPWHEREAMISYSTEM EQUAL 1)
|
2020-06-11 18:38:07 +08:00
|
|
|
|
2020-06-02 07:16:21 +08:00
|
|
|
add_subdirectory(${PM3_ROOT}/client/deps deps)
|
2020-04-16 16:57:53 +08:00
|
|
|
|
|
|
|
set (TARGET_SOURCES
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/common/commonutil.c
|
|
|
|
${PM3_ROOT}/common/util_posix.c
|
|
|
|
${PM3_ROOT}/common/bucketsort.c
|
|
|
|
${PM3_ROOT}/common/crapto1/crapto1.c
|
|
|
|
${PM3_ROOT}/common/crapto1/crypto1.c
|
|
|
|
${PM3_ROOT}/common/crc.c
|
|
|
|
${PM3_ROOT}/common/crc16.c
|
|
|
|
${PM3_ROOT}/common/crc32.c
|
|
|
|
${PM3_ROOT}/common/crc64.c
|
|
|
|
${PM3_ROOT}/common/lfdemod.c
|
|
|
|
${PM3_ROOT}/common/legic_prng.c
|
|
|
|
${PM3_ROOT}/common/iso15693tools.c
|
|
|
|
${PM3_ROOT}/common/cardhelper.c
|
|
|
|
${PM3_ROOT}/common/generator.c
|
|
|
|
${PM3_ROOT}/client/src/crypto/asn1dump.c
|
|
|
|
${PM3_ROOT}/client/src/crypto/asn1utils.c
|
|
|
|
${PM3_ROOT}/client/src/crypto/libpcrypto.c
|
|
|
|
${PM3_ROOT}/client/src/emv/test/cda_test.c
|
|
|
|
${PM3_ROOT}/client/src/emv/test/crypto_test.c
|
|
|
|
${PM3_ROOT}/client/src/emv/test/cryptotest.c
|
|
|
|
${PM3_ROOT}/client/src/emv/test/dda_test.c
|
|
|
|
${PM3_ROOT}/client/src/emv/test/sda_test.c
|
|
|
|
${PM3_ROOT}/client/src/emv/cmdemv.c
|
|
|
|
${PM3_ROOT}/client/src/emv/crypto.c
|
|
|
|
${PM3_ROOT}/client/src/emv/crypto_polarssl.c
|
|
|
|
${PM3_ROOT}/client/src/emv/dol.c
|
|
|
|
${PM3_ROOT}/client/src/emv/emv_pk.c
|
|
|
|
${PM3_ROOT}/client/src/emv/emv_pki.c
|
|
|
|
${PM3_ROOT}/client/src/emv/emv_pki_priv.c
|
|
|
|
${PM3_ROOT}/client/src/emv/emv_roca.c
|
|
|
|
${PM3_ROOT}/client/src/emv/emv_tags.c
|
|
|
|
${PM3_ROOT}/client/src/emv/emvcore.c
|
|
|
|
${PM3_ROOT}/client/src/emv/emvjson.c
|
|
|
|
${PM3_ROOT}/client/src/emv/tlv.c
|
|
|
|
${PM3_ROOT}/client/src/fido/additional_ca.c
|
|
|
|
${PM3_ROOT}/client/src/fido/cbortools.c
|
|
|
|
${PM3_ROOT}/client/src/fido/cose.c
|
|
|
|
${PM3_ROOT}/client/src/fido/fidocore.c
|
2021-05-31 00:56:33 +08:00
|
|
|
${PM3_ROOT}/client/src/iso7816/apduinfo.c
|
|
|
|
${PM3_ROOT}/client/src/iso7816/iso7816core.c
|
2021-12-27 08:30:49 +08:00
|
|
|
${PM3_ROOT}/client/src/ksx6924/ksx6924core.c
|
2021-05-30 01:26:31 +08:00
|
|
|
${PM3_ROOT}/client/src/cipurse/cipursecrypto.c
|
2021-05-29 00:06:14 +08:00
|
|
|
${PM3_ROOT}/client/src/cipurse/cipursecore.c
|
2021-06-23 23:20:30 +08:00
|
|
|
${PM3_ROOT}/client/src/cipurse/cipursetest.c
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/loclass/cipher.c
|
|
|
|
${PM3_ROOT}/client/src/loclass/cipherutils.c
|
|
|
|
${PM3_ROOT}/client/src/loclass/elite_crack.c
|
|
|
|
${PM3_ROOT}/client/src/loclass/hash1_brute.c
|
|
|
|
${PM3_ROOT}/client/src/loclass/ikeys.c
|
|
|
|
${PM3_ROOT}/client/src/mifare/mad.c
|
2021-08-02 21:41:49 +08:00
|
|
|
${PM3_ROOT}/client/src/mifare/aiddesfire.c
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/mifare/mfkey.c
|
|
|
|
${PM3_ROOT}/client/src/mifare/mifare4.c
|
|
|
|
${PM3_ROOT}/client/src/mifare/mifaredefault.c
|
|
|
|
${PM3_ROOT}/client/src/mifare/mifarehost.c
|
2021-05-29 04:35:42 +08:00
|
|
|
${PM3_ROOT}/client/src/nfc/ndef.c
|
2021-08-14 02:27:46 +08:00
|
|
|
${PM3_ROOT}/client/src/mifare/lrpcrypto.c
|
2021-07-06 17:39:06 +08:00
|
|
|
${PM3_ROOT}/client/src/mifare/desfirecrypto.c
|
2021-07-06 00:31:42 +08:00
|
|
|
${PM3_ROOT}/client/src/mifare/desfiresecurechan.c
|
2021-07-02 00:53:57 +08:00
|
|
|
${PM3_ROOT}/client/src/mifare/desfirecore.c
|
2021-07-09 20:15:16 +08:00
|
|
|
${PM3_ROOT}/client/src/mifare/desfiretest.c
|
2021-12-29 15:54:03 +08:00
|
|
|
${PM3_ROOT}/client/src/mifare/gallaghercore.c
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/uart/uart_posix.c
|
|
|
|
${PM3_ROOT}/client/src/uart/uart_win32.c
|
|
|
|
${PM3_ROOT}/client/src/ui/overlays.ui
|
2021-07-05 19:42:33 +08:00
|
|
|
${PM3_ROOT}/client/src/ui/image.ui
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/aidsearch.c
|
2021-10-10 15:37:39 +08:00
|
|
|
${PM3_ROOT}/client/src/atrs.c
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdanalyse.c
|
|
|
|
${PM3_ROOT}/client/src/cmdcrc.c
|
|
|
|
${PM3_ROOT}/client/src/cmddata.c
|
|
|
|
${PM3_ROOT}/client/src/cmdflashmem.c
|
|
|
|
${PM3_ROOT}/client/src/cmdflashmemspiffs.c
|
|
|
|
${PM3_ROOT}/client/src/cmdhf.c
|
|
|
|
${PM3_ROOT}/client/src/cmdhf14a.c
|
|
|
|
${PM3_ROOT}/client/src/cmdhf14b.c
|
|
|
|
${PM3_ROOT}/client/src/cmdhf15.c
|
|
|
|
${PM3_ROOT}/client/src/cmdhfcryptorf.c
|
2020-12-06 08:22:20 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhfemrtd.c
|
2021-04-20 18:06:53 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhfepa.c
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhffelica.c
|
|
|
|
${PM3_ROOT}/client/src/cmdhffido.c
|
2022-07-09 18:25:03 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhffudan.c
|
2021-12-29 18:42:06 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhfgallagher.c
|
2021-05-28 23:54:44 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhfcipurse.c
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhficlass.c
|
2021-02-12 05:08:51 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhfjooki.c
|
2021-12-27 08:30:49 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhfksx6924.c
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhflegic.c
|
|
|
|
${PM3_ROOT}/client/src/cmdhflist.c
|
|
|
|
${PM3_ROOT}/client/src/cmdhflto.c
|
|
|
|
${PM3_ROOT}/client/src/cmdhfmf.c
|
|
|
|
${PM3_ROOT}/client/src/cmdhfmfdes.c
|
|
|
|
${PM3_ROOT}/client/src/cmdhfmfhard.c
|
|
|
|
${PM3_ROOT}/client/src/cmdhfmfp.c
|
|
|
|
${PM3_ROOT}/client/src/cmdhfmfu.c
|
2022-04-02 20:06:16 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhfntag424.c
|
2021-05-20 16:07:04 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhfseos.c
|
2020-09-13 02:57:07 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhfst.c
|
2021-05-30 20:55:58 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhfst25ta.c
|
2023-01-22 03:04:27 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhftesla.c
|
2023-01-15 09:40:58 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhftexkom.c
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhfthinfilm.c
|
|
|
|
${PM3_ROOT}/client/src/cmdhftopaz.c
|
2020-09-13 01:38:29 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhfwaveshare.c
|
2022-07-01 05:38:40 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhfxerox.c
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdhw.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlf.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfawid.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfcotag.c
|
2020-10-12 18:27:00 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdlfdestron.c
|
2020-12-04 07:11:57 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdlfem.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfem410x.c
|
2020-10-17 01:13:40 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdlfem4x05.c
|
2020-06-20 21:37:56 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdlfem4x50.c
|
2020-12-06 06:47:03 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdlfem4x70.c
|
2020-10-12 04:38:52 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdlffdxb.c
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdlfgallagher.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfguard.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfhid.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfhitag.c
|
2020-09-29 03:09:26 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdlfidteck.c
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdlfindala.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfio.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfjablotron.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfkeri.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfmotorola.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfnedap.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfnexwatch.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfnoralsy.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfpac.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfparadox.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfpcf7931.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfpresco.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfpyramid.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfsecurakey.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlft55xx.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfti.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfviking.c
|
|
|
|
${PM3_ROOT}/client/src/cmdlfvisa2000.c
|
2021-12-24 20:32:28 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdlfzx8211.c
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdmain.c
|
2021-05-29 04:35:42 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdnfc.c
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdparser.c
|
2023-01-07 01:19:31 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdpiv.c
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/cmdscript.c
|
|
|
|
${PM3_ROOT}/client/src/cmdsmartcard.c
|
|
|
|
${PM3_ROOT}/client/src/cmdtrace.c
|
|
|
|
${PM3_ROOT}/client/src/cmdusart.c
|
|
|
|
${PM3_ROOT}/client/src/cmdwiegand.c
|
|
|
|
${PM3_ROOT}/client/src/comms.c
|
|
|
|
${PM3_ROOT}/client/src/fileutils.c
|
|
|
|
${PM3_ROOT}/client/src/flash.c
|
|
|
|
${PM3_ROOT}/client/src/graph.c
|
2020-10-07 07:11:40 +08:00
|
|
|
${PM3_ROOT}/client/src/jansson_path.c
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/preferences.c
|
2020-05-28 08:13:21 +08:00
|
|
|
${PM3_ROOT}/client/src/pm3.c
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/pm3_binlib.c
|
|
|
|
${PM3_ROOT}/client/src/pm3_bitlib.c
|
2022-01-11 06:53:01 +08:00
|
|
|
${PM3_ROOT}/client/src/pm3line.c
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/scandir.c
|
|
|
|
${PM3_ROOT}/client/src/scripting.c
|
|
|
|
${PM3_ROOT}/client/src/ui.c
|
|
|
|
${PM3_ROOT}/client/src/util.c
|
|
|
|
${PM3_ROOT}/client/src/wiegand_formats.c
|
|
|
|
${PM3_ROOT}/client/src/wiegand_formatutils.c
|
2021-05-21 06:15:20 +08:00
|
|
|
${CMAKE_BINARY_DIR}/version_pm3.c
|
2020-04-16 16:57:53 +08:00
|
|
|
)
|
|
|
|
|
2020-05-21 01:07:46 +08:00
|
|
|
add_custom_command(
|
2021-05-21 06:15:20 +08:00
|
|
|
OUTPUT ${CMAKE_BINARY_DIR}/version_pm3.c
|
2023-06-26 19:10:45 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${PM3_ROOT}/common/default_version_pm3.c ${CMAKE_BINARY_DIR}/version_pm3.c
|
2021-05-21 06:15:20 +08:00
|
|
|
DEPENDS ${PM3_ROOT}/common/default_version_pm3.c
|
2020-05-21 01:07:46 +08:00
|
|
|
)
|
|
|
|
|
2020-04-16 16:57:53 +08:00
|
|
|
set(ADDITIONAL_SRC "")
|
|
|
|
set(ADDITIONAL_LNK "")
|
2020-05-26 22:57:54 +08:00
|
|
|
set(ADDITIONAL_DIRS "")
|
2020-05-27 03:57:26 +08:00
|
|
|
set(ADDITIONAL_LNKDIRS "")
|
2020-04-16 16:57:53 +08:00
|
|
|
set(X86_CPUS x86 x86_64 i686)
|
|
|
|
|
|
|
|
message(STATUS "CMAKE_SYSTEM_PROCESSOR := ${CMAKE_SYSTEM_PROCESSOR}")
|
|
|
|
|
|
|
|
if (APPLE)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "Apple device detected.")
|
2020-06-02 07:16:21 +08:00
|
|
|
set(ADDITIONAL_SRC ${PM3_ROOT}/client/src/util_darwin.h ${PM3_ROOT}/client/src/util_darwin.m ${ADDITIONAL_SRC})
|
2023-06-25 15:04:45 +08:00
|
|
|
|
2023-06-25 18:42:34 +08:00
|
|
|
find_library(UIKIT_LIBRARY UIKit)
|
|
|
|
if (NOT UIKIT_LIBRARY)
|
|
|
|
message(STATUS "UIKit.framework NOT found!")
|
|
|
|
else()
|
|
|
|
message(STATUS "UIKit.framework found! ${UIKIT_LIBRARY}")
|
2023-06-25 08:19:46 +08:00
|
|
|
set(ADDITIONAL_LNK "-framework Foundation" "-framework UIKit")
|
2023-06-25 18:42:34 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
find_library(APPKIT_LIBRARY AppKit)
|
|
|
|
if (NOT APPKIT_LIBRARY)
|
|
|
|
message(STATUS "AppKit.framework NOT found!")
|
|
|
|
else()
|
|
|
|
message(STATUS "AppKit.framework found! ${APPKIT_LIBRARY}")
|
|
|
|
set(ADDITIONAL_LNK "-framework Foundation" "-framework AppKit")
|
|
|
|
endif()
|
2023-06-25 15:04:45 +08:00
|
|
|
|
2020-04-16 16:57:53 +08:00
|
|
|
endif (APPLE)
|
|
|
|
|
2020-06-09 06:34:41 +08:00
|
|
|
if ((NOT SKIPQT EQUAL 1) AND (Qt5_FOUND))
|
2020-04-22 19:55:28 +08:00
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
set(CMAKE_AUTOUIC ON)
|
2020-04-16 22:44:15 +08:00
|
|
|
set (TARGET_SOURCES
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/proxgui.cpp
|
|
|
|
${PM3_ROOT}/client/src/proxguiqt.cpp
|
2020-04-16 22:44:15 +08:00
|
|
|
${TARGET_SOURCES})
|
2020-04-17 16:59:01 +08:00
|
|
|
|
2020-04-16 22:44:15 +08:00
|
|
|
add_definitions("-DHAVE_GUI")
|
2020-05-27 01:06:08 +08:00
|
|
|
set(ADDITIONAL_LNK ${Qt5_LIBRARIES} ${ADDITIONAL_LNK})
|
2020-06-09 06:34:41 +08:00
|
|
|
else ((NOT SKIPQT EQUAL 1) AND (Qt5_FOUND))
|
2020-04-19 02:42:38 +08:00
|
|
|
set(TARGET_SOURCES
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/client/src/guidummy.cpp
|
2020-04-19 02:42:38 +08:00
|
|
|
${TARGET_SOURCES})
|
2020-06-09 06:34:41 +08:00
|
|
|
endif ((NOT SKIPQT EQUAL 1) AND (Qt5_FOUND))
|
2020-04-16 16:57:53 +08:00
|
|
|
|
2020-06-09 06:16:42 +08:00
|
|
|
if (NOT SKIPBT EQUAL 1)
|
|
|
|
if (BLUEZ_FOUND)
|
|
|
|
add_definitions("-DHAVE_BLUEZ")
|
|
|
|
set(ADDITIONAL_LNK ${BLUEZ_LIBRARIES} ${ADDITIONAL_LNK})
|
|
|
|
endif (BLUEZ_FOUND)
|
|
|
|
endif(NOT SKIPBT EQUAL 1)
|
2020-04-29 07:41:22 +08:00
|
|
|
|
2020-06-18 08:06:03 +08:00
|
|
|
if (JANSSON_FOUND)
|
|
|
|
set(ADDITIONAL_DIRS ${JANSSON_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
|
|
|
|
set(ADDITIONAL_LNK ${JANSSON_LIBRARIES} ${ADDITIONAL_LNK})
|
|
|
|
endif (JANSSON_FOUND)
|
|
|
|
|
2020-06-09 06:47:34 +08:00
|
|
|
if (NOT SKIPPYTHON EQUAL 1)
|
|
|
|
if (PYTHON3EMBED_FOUND)
|
|
|
|
add_definitions(-DHAVE_PYTHON)
|
|
|
|
set(ADDITIONAL_DIRS ${PYTHON3EMBED_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
|
|
|
|
set(ADDITIONAL_LNK ${PYTHON3EMBED_LIBRARIES} ${ADDITIONAL_LNK})
|
|
|
|
set(ADDITIONAL_LNKDIRS ${PYTHON3EMBED_LIBRARY_DIRS} ${ADDITIONAL_LNKDIRS})
|
|
|
|
elseif (PYTHON3_FOUND)
|
|
|
|
add_definitions(-DHAVE_PYTHON)
|
|
|
|
set(ADDITIONAL_DIRS ${PYTHON3_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
|
|
|
|
set(ADDITIONAL_LNK ${PYTHON3_LIBRARIES} ${ADDITIONAL_LNK})
|
2020-05-28 08:13:21 +08:00
|
|
|
set(ADDITIONAL_LNKDIRS ${PYTHON3_LIBRARY_DIRS} ${ADDITIONAL_LNKDIRS})
|
2020-06-09 06:47:34 +08:00
|
|
|
endif (PYTHON3EMBED_FOUND)
|
|
|
|
endif (NOT SKIPPYTHON EQUAL 1)
|
2020-05-26 21:49:28 +08:00
|
|
|
|
2020-06-09 04:15:47 +08:00
|
|
|
if (NOT SKIPREADLINE EQUAL 1)
|
|
|
|
if (READLINE_FOUND)
|
|
|
|
add_definitions("-DHAVE_READLINE")
|
|
|
|
set(ADDITIONAL_DIRS ${READLINE_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
|
|
|
|
set(ADDITIONAL_LNK ${READLINE_LIBRARIES} ${ADDITIONAL_LNK})
|
|
|
|
endif (READLINE_FOUND)
|
|
|
|
endif(NOT SKIPREADLINE EQUAL 1)
|
2020-06-18 07:51:36 +08:00
|
|
|
|
2020-06-11 18:38:07 +08:00
|
|
|
if (BZIP2_FOUND)
|
|
|
|
set(ADDITIONAL_DIRS ${BZIP2_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
|
|
|
|
set(ADDITIONAL_LNK ${BZIP2_LIBRARIES} ${ADDITIONAL_LNK})
|
|
|
|
endif (BZIP2_FOUND)
|
2020-06-09 04:15:47 +08:00
|
|
|
|
2020-06-18 07:51:36 +08:00
|
|
|
if (WHEREAMI_FOUND)
|
|
|
|
set(ADDITIONAL_DIRS ${WHEREAMI_INCLUDE_DIRS} ${ADDITIONAL_DIRS})
|
|
|
|
set(ADDITIONAL_LNK ${WHEREAMI_LIBRARIES} ${ADDITIONAL_LNK})
|
|
|
|
endif (WHEREAMI_FOUND)
|
|
|
|
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "===================================================================")
|
2021-09-05 07:29:55 +08:00
|
|
|
execute_process(
|
|
|
|
COMMAND sh ${PM3_ROOT}/tools/mkversion.sh --short
|
|
|
|
OUTPUT_VARIABLE version_pm3
|
|
|
|
)
|
|
|
|
string(STRIP ${version_pm3} version_pm3)
|
|
|
|
message(STATUS "Version info: ${version_pm3}")
|
2020-06-09 06:34:41 +08:00
|
|
|
if (SKIPQT EQUAL 1)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "GUI support: skipped")
|
2020-06-09 06:34:41 +08:00
|
|
|
else (SKIPQT EQUAL 1)
|
|
|
|
if (Qt5_FOUND)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "GUI support: QT5 found, enabled")
|
2020-06-09 06:34:41 +08:00
|
|
|
else (Qt5_FOUND)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "GUI support: QT5 not found, disabled")
|
2020-06-09 06:34:41 +08:00
|
|
|
endif (Qt5_FOUND)
|
|
|
|
endif (SKIPQT EQUAL 1)
|
|
|
|
|
2020-06-09 06:16:42 +08:00
|
|
|
if (SKIPBT EQUAL 1)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "native BT support: skipped")
|
2020-06-09 06:16:42 +08:00
|
|
|
else (SKIPBT EQUAL 1)
|
|
|
|
if (BLUEZ_FOUND)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "native BT support: Bluez found, enabled")
|
2020-06-09 06:16:42 +08:00
|
|
|
else (BLUEZ_FOUND)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "native BT support: Bluez not found, disabled")
|
2020-06-09 06:16:42 +08:00
|
|
|
endif (BLUEZ_FOUND)
|
|
|
|
endif(SKIPBT EQUAL 1)
|
2020-06-09 06:47:34 +08:00
|
|
|
|
2020-06-23 16:12:36 +08:00
|
|
|
if (EMBED_BZIP2)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "Bzip2 library: embedded")
|
2020-06-23 16:12:36 +08:00
|
|
|
else (EMBED_BZIP2)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "Bzip2 library: system library found")
|
2020-06-23 16:12:36 +08:00
|
|
|
endif (EMBED_BZIP2)
|
|
|
|
|
2020-06-18 08:06:03 +08:00
|
|
|
if (SKIPJANSSONSYSTEM EQUAL 1)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "Jansson library: local library forced")
|
2020-06-18 08:06:03 +08:00
|
|
|
else (SKIPJANSSONSYSTEM EQUAL 1)
|
|
|
|
if (JANSSON_FOUND)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "Jansson library: system library found")
|
2020-06-18 08:06:03 +08:00
|
|
|
else (JANSSON_FOUND)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "Jansson library: system library not found, using local library")
|
2020-06-18 08:06:03 +08:00
|
|
|
endif (JANSSON_FOUND)
|
|
|
|
endif (SKIPJANSSONSYSTEM EQUAL 1)
|
|
|
|
|
2020-06-09 06:47:34 +08:00
|
|
|
if (SKIPPYTHON EQUAL 1)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "Python3 library: skipped")
|
2020-06-09 06:47:34 +08:00
|
|
|
else (SKIPPYTHON EQUAL 1)
|
|
|
|
if (PYTHON3EMBED_FOUND)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "Python3 library: Python3 embed found, enabled")
|
2020-11-14 18:59:48 +08:00
|
|
|
elseif (PYTHON3_FOUND)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "Python3 library: Python3 found, enabled")
|
2020-06-09 06:47:34 +08:00
|
|
|
else (PYTHON3EMBED_FOUND)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "Python3 library: Python3 not found, disabled")
|
2020-06-09 06:47:34 +08:00
|
|
|
endif (PYTHON3EMBED_FOUND)
|
|
|
|
endif(SKIPPYTHON EQUAL 1)
|
2020-06-09 04:15:47 +08:00
|
|
|
|
|
|
|
if (SKIPREADLINE EQUAL 1)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "Readline library: skipped")
|
2020-06-09 04:15:47 +08:00
|
|
|
else (SKIPREADLINE EQUAL 1)
|
|
|
|
if (READLINE_FOUND)
|
2020-06-23 16:12:36 +08:00
|
|
|
if (EMBED_READLINE)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "Readline library: embedded")
|
2020-06-23 16:12:36 +08:00
|
|
|
else (EMBED_READLINE)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "Readline library: system library found")
|
2020-06-23 16:12:36 +08:00
|
|
|
endif (EMBED_READLINE)
|
2020-06-09 04:15:47 +08:00
|
|
|
else (READLINE_FOUND)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "Readline library: Readline not found, disabled")
|
2020-06-09 04:15:47 +08:00
|
|
|
endif (READLINE_FOUND)
|
|
|
|
endif(SKIPREADLINE EQUAL 1)
|
2020-06-18 07:51:36 +08:00
|
|
|
|
2022-01-11 06:53:01 +08:00
|
|
|
if (NOT READLINE_FOUND)
|
|
|
|
if (SKIPLINENOISE EQUAL 1)
|
|
|
|
message(STATUS "Linenoise library: skipped")
|
|
|
|
else (SKIPLINENOISE EQUAL 1)
|
|
|
|
if (LINENOISE_LOCAL_FOUND)
|
|
|
|
message(STATUS "Linenoise library: enabled")
|
|
|
|
else (LINENOISE_LOCAL_FOUND)
|
|
|
|
message(STATUS "Linenoise library: Linenoise not found, disabled")
|
|
|
|
endif (LINENOISE_LOCAL_FOUND)
|
|
|
|
endif (SKIPLINENOISE EQUAL 1)
|
|
|
|
endif (NOT READLINE_FOUND)
|
|
|
|
|
2020-06-18 07:51:36 +08:00
|
|
|
if (SKIPWHEREAMISYSTEM EQUAL 1)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "Whereami library: local library forced")
|
2020-06-18 07:51:36 +08:00
|
|
|
else (SKIPWHEREAMISYSTEM EQUAL 1)
|
|
|
|
if (WHEREAMI_FOUND)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "Whereami library: system library found")
|
2020-06-18 07:51:36 +08:00
|
|
|
else (WHEREAMI_FOUND)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "Whereami library: system library not found, using local library")
|
2020-06-18 07:51:36 +08:00
|
|
|
endif (WHEREAMI_FOUND)
|
|
|
|
endif (SKIPWHEREAMISYSTEM EQUAL 1)
|
2020-11-11 07:03:58 +08:00
|
|
|
|
|
|
|
# Lua SWIG
|
|
|
|
if (EXISTS ${PM3_ROOT}/client/src/pm3_luawrap.c)
|
|
|
|
set (TARGET_SOURCES
|
|
|
|
${PM3_ROOT}/client/src/pm3_luawrap.c
|
|
|
|
${TARGET_SOURCES})
|
|
|
|
add_definitions(-DHAVE_LUA_SWIG)
|
|
|
|
message(STATUS "Lua SWIG: wrapper found")
|
|
|
|
endif (EXISTS ${PM3_ROOT}/client/src/pm3_luawrap.c)
|
|
|
|
|
|
|
|
# Python SWIG
|
|
|
|
if (NOT SKIPPYTHON EQUAL 1)
|
|
|
|
if (PYTHON3EMBED_FOUND OR PYTHON3_FOUND)
|
|
|
|
if (EXISTS ${PM3_ROOT}/client/src/pm3_pywrap.c)
|
|
|
|
set (TARGET_SOURCES
|
|
|
|
${PM3_ROOT}/client/src/pm3_pywrap.c
|
|
|
|
${TARGET_SOURCES})
|
|
|
|
add_definitions(-DHAVE_PYTHON_SWIG)
|
|
|
|
message(STATUS "Python SWIG: wrapper found")
|
|
|
|
endif (EXISTS ${PM3_ROOT}/client/src/pm3_pywrap.c)
|
|
|
|
endif (PYTHON3EMBED_FOUND OR PYTHON3_FOUND)
|
|
|
|
endif (NOT SKIPPYTHON EQUAL 1)
|
2020-08-22 01:28:38 +08:00
|
|
|
message(STATUS "===================================================================")
|
2020-06-09 06:16:42 +08:00
|
|
|
|
2022-06-12 07:16:56 +08:00
|
|
|
add_definitions(-DHAVE_SNPRINTF)
|
|
|
|
|
2020-06-02 07:16:21 +08:00
|
|
|
add_executable(proxmark3
|
|
|
|
${PM3_ROOT}/client/src/proxmark3.c
|
2020-04-16 22:44:15 +08:00
|
|
|
${TARGET_SOURCES}
|
2020-04-17 12:43:16 +08:00
|
|
|
${ADDITIONAL_SRC}
|
2020-04-16 22:44:15 +08:00
|
|
|
)
|
2020-04-16 16:57:53 +08:00
|
|
|
|
2023-06-26 19:10:45 +08:00
|
|
|
target_compile_options(proxmark3 PUBLIC -Wall -O3)
|
2020-06-23 16:12:36 +08:00
|
|
|
if (EMBED_READLINE)
|
2020-06-11 18:38:07 +08:00
|
|
|
if (NOT SKIPREADLINE EQUAL 1)
|
|
|
|
add_dependencies(proxmark3 ncurses readline)
|
|
|
|
endif (NOT SKIPREADLINE EQUAL 1)
|
2020-06-23 16:12:36 +08:00
|
|
|
endif (EMBED_READLINE)
|
|
|
|
if (EMBED_BZIP2)
|
2020-06-11 18:38:07 +08:00
|
|
|
add_dependencies(proxmark3 bzip2)
|
2020-06-23 16:12:36 +08:00
|
|
|
endif (EMBED_BZIP2)
|
2020-04-18 23:37:11 +08:00
|
|
|
|
2020-04-23 00:58:53 +08:00
|
|
|
if (MINGW)
|
|
|
|
# Mingw uses by default Microsoft printf, we want the GNU printf (e.g. for %z)
|
|
|
|
# and setting _ISOC99_SOURCE sets internally __USE_MINGW_ANSI_STDIO=1
|
|
|
|
# FTR __USE_MINGW_ANSI_STDIO seems deprecated in Mingw32
|
|
|
|
# but not Mingw64 https://fr.osdn.net/projects/mingw/lists/archive/users/2019-January/000199.html
|
|
|
|
target_compile_definitions(proxmark3 PRIVATE _ISOC99_SOURCE)
|
|
|
|
|
|
|
|
set(CMAKE_C_FLAGS "-mno-ms-bitfields -fexec-charset=cp850 ${CMAKE_C_FLAGS}")
|
|
|
|
set(CMAKE_CXX_FLAGS "-mno-ms-bitfields -fexec-charset=cp850 ${CMAKE_CXX_FLAGS}")
|
2023-03-06 22:02:33 +08:00
|
|
|
|
2023-05-25 13:58:43 +08:00
|
|
|
# GCC 10 has issues with false positives on stringop-overflow,
|
|
|
|
# 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)
|
|
|
|
# beware these flags didn't exist for GCC < 7
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
|
|
|
|
if (GCC_VERSION VERSION_GREATER 10.0 OR GCC_VERSION VERSION_EQUAL 10.0)
|
|
|
|
set(CMAKE_C_FLAGS "-Wno-stringop-overflow -Wno-error=stringop-overflow ${CMAKE_C_FLAGS}")
|
|
|
|
set(CMAKE_CXX_FLAGS "-Wno-stringop-overflow -Wno-error=stringop-overflow ${CMAKE_CXX_FLAGS}")
|
|
|
|
endif()
|
|
|
|
endif(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
|
2023-03-06 22:02:33 +08:00
|
|
|
# link Winsock2
|
|
|
|
set(ADDITIONAL_LNK ws2_32 ${ADDITIONAL_LNK})
|
2020-04-23 00:58:53 +08:00
|
|
|
endif (MINGW)
|
|
|
|
|
2020-04-18 21:09:35 +08:00
|
|
|
target_include_directories(proxmark3 PRIVATE
|
2020-06-02 07:16:21 +08:00
|
|
|
${PM3_ROOT}/common
|
|
|
|
${PM3_ROOT}/common_fpga
|
|
|
|
${PM3_ROOT}/include
|
|
|
|
${PM3_ROOT}/client/src
|
|
|
|
${PM3_ROOT}/client/include
|
2020-05-26 22:57:54 +08:00
|
|
|
${ADDITIONAL_DIRS}
|
2020-04-18 21:09:35 +08:00
|
|
|
)
|
|
|
|
|
2020-06-09 04:15:47 +08:00
|
|
|
if (NOT APPLE)
|
2020-04-22 20:57:30 +08:00
|
|
|
# required for Raspberry Pi, but breaks with clang (OSX). Need to be at the end of the linker line.
|
2020-04-22 21:31:44 +08:00
|
|
|
set(ADDITIONAL_LNK ${ADDITIONAL_LNK} -Wl,--as-needed -latomic -Wl,--no-as-needed)
|
2020-06-09 04:15:47 +08:00
|
|
|
endif (NOT APPLE)
|
2020-04-17 16:59:01 +08:00
|
|
|
|
2020-06-18 08:06:03 +08:00
|
|
|
if (NOT JANSSON_FOUND)
|
|
|
|
set(ADDITIONAL_LNK pm3rrg_rdv4_jansson ${ADDITIONAL_LNK})
|
|
|
|
endif (NOT JANSSON_FOUND)
|
2022-01-11 06:53:01 +08:00
|
|
|
|
2022-01-11 06:53:01 +08:00
|
|
|
if (NOT READLINE_FOUND)
|
|
|
|
if (LINENOISE_LOCAL_FOUND)
|
|
|
|
add_definitions("-DHAVE_LINENOISE")
|
|
|
|
set(ADDITIONAL_LNK pm3rrg_rdv4_linenoise ${ADDITIONAL_LNK})
|
|
|
|
endif (LINENOISE_LOCAL_FOUND)
|
|
|
|
endif (NOT READLINE_FOUND)
|
|
|
|
|
2020-06-18 07:51:36 +08:00
|
|
|
if (NOT WHEREAMI_FOUND)
|
|
|
|
set(ADDITIONAL_LNK pm3rrg_rdv4_whereami ${ADDITIONAL_LNK})
|
|
|
|
endif (NOT WHEREAMI_FOUND)
|
2020-04-16 16:57:53 +08:00
|
|
|
|
2020-05-08 21:56:32 +08:00
|
|
|
target_link_libraries(proxmark3 PRIVATE
|
|
|
|
m
|
|
|
|
pm3rrg_rdv4_mbedtls
|
|
|
|
pm3rrg_rdv4_cliparser
|
|
|
|
pm3rrg_rdv4_lua
|
|
|
|
pm3rrg_rdv4_tinycbor
|
|
|
|
pm3rrg_rdv4_amiibo
|
|
|
|
pm3rrg_rdv4_reveng
|
|
|
|
pm3rrg_rdv4_hardnested
|
|
|
|
${ADDITIONAL_LNK})
|
2020-04-16 16:57:53 +08:00
|
|
|
|
2020-06-09 06:39:35 +08:00
|
|
|
if (NOT SKIPPTHREAD EQUAL 1)
|
|
|
|
target_link_libraries(proxmark3 PRIVATE pthread)
|
|
|
|
endif (NOT SKIPPTHREAD EQUAL 1)
|
|
|
|
|
2020-06-09 06:47:34 +08:00
|
|
|
if (NOT SKIPPYTHON EQUAL 1)
|
|
|
|
# OSX have a hard time compiling python3 dependency with older cmake.
|
|
|
|
if (PYTHON3EMBED_FOUND OR PYTHON3_FOUND)
|
|
|
|
if (NOT CMAKE_VERSION VERSION_LESS 3.13)
|
|
|
|
target_link_directories(proxmark3 PRIVATE ${ADDITIONAL_LNKDIRS})
|
|
|
|
elseif (APPLE)
|
|
|
|
message( SEND_ERROR "Your CMAKE version is too old for Apple platform, please update to a version >=3.13" )
|
|
|
|
endif (NOT CMAKE_VERSION VERSION_LESS 3.13)
|
|
|
|
endif (PYTHON3EMBED_FOUND OR PYTHON3_FOUND)
|
|
|
|
endif (NOT SKIPPYTHON EQUAL 1)
|
2020-06-02 07:16:21 +08:00
|
|
|
|
2020-04-16 16:57:53 +08:00
|
|
|
install(TARGETS proxmark3 DESTINATION "bin")
|
2020-05-26 21:49:28 +08:00
|
|
|
install(DIRECTORY cmdscripts lualibs luascripts pyscripts resources dictionaries DESTINATION "share/proxmark3")
|
2020-04-16 16:57:53 +08:00
|
|
|
|
|
|
|
add_custom_command(OUTPUT lualibs/pm3_cmd.lua
|
|
|
|
COMMAND "awk -f pm3_cmd_h2lua.awk ../include/pm3_cmd.h > lualibs/pm3_cmd.lua"
|
|
|
|
COMMENT "Creating lualibs/pm3_cmd.lua"
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_command(OUTPUT lualibs/mfc_default_keys.lua
|
|
|
|
COMMAND "awk -f default_keys_dic2lua.awk mfc_default_keys.dic > lualibs/mfc_default_keys.lua"
|
|
|
|
COMMENT "Creating lualibs/mfc_default_keys.lua"
|
|
|
|
)
|
|
|
|
|
|
|
|
#"make package" will trigger this
|
|
|
|
SET(CPACK_GENERATOR "DEB")
|
|
|
|
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Iceman")
|
2020-04-17 12:43:16 +08:00
|
|
|
INCLUDE(CPack)
|