mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
Add SKIPQT support to cmake
This commit is contained in:
parent
45b5bbed7b
commit
6358c07ec1
1 changed files with 40 additions and 30 deletions
|
@ -13,29 +13,31 @@ if(CMAKE_VERSION VERSION_LESS "3.7.0")
|
|||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
endif()
|
||||
|
||||
if(APPLE AND EXISTS /usr/local/opt/qt5)
|
||||
# Homebrew installs Qt5 (up to at least 5.11.0) in
|
||||
# /usr/local/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 /usr/local/opt/qt5)
|
||||
endif()
|
||||
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()
|
||||
if (NOT SKIPQT EQUAL 1)
|
||||
if(APPLE AND EXISTS /usr/local/opt/qt5)
|
||||
# Homebrew installs Qt5 (up to at least 5.11.0) in
|
||||
# /usr/local/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 /usr/local/opt/qt5)
|
||||
endif(APPLE AND EXISTS /usr/local/opt/qt5)
|
||||
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)
|
||||
|
||||
find_package(PkgConfig)
|
||||
if (NOT SKIPBT EQUAL 1)
|
||||
|
@ -203,8 +205,7 @@ if (APPLE)
|
|||
set(ADDITIONAL_LNK "-framework Foundation" "-framework AppKit")
|
||||
endif (APPLE)
|
||||
|
||||
if (Qt5_FOUND)
|
||||
message("Qt5 library found, building gui :)")
|
||||
if ((NOT SKIPQT EQUAL 1) AND (Qt5_FOUND))
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
@ -215,12 +216,11 @@ if (Qt5_FOUND)
|
|||
|
||||
add_definitions("-DHAVE_GUI")
|
||||
set(ADDITIONAL_LNK ${Qt5_LIBRARIES} ${ADDITIONAL_LNK})
|
||||
else (Qt5_FOUND)
|
||||
message("Qt5 library not found, not building gui")
|
||||
else ((NOT SKIPQT EQUAL 1) AND (Qt5_FOUND))
|
||||
set(TARGET_SOURCES
|
||||
${PM3_ROOT}/client/src/guidummy.cpp
|
||||
${TARGET_SOURCES})
|
||||
endif (Qt5_FOUND)
|
||||
endif ((NOT SKIPQT EQUAL 1) AND (Qt5_FOUND))
|
||||
|
||||
if (NOT SKIPBT EQUAL 1)
|
||||
if (BLUEZ_FOUND)
|
||||
|
@ -243,7 +243,17 @@ elseif (PYTHON3_FOUND)
|
|||
set(ADDITIONAL_LNKDIRS ${PYTHON3_LIBRARY_DIRS} ${ADDITIONAL_LNKDIRS})
|
||||
endif (PYTHON3EMBED_FOUND)
|
||||
|
||||
message(" ===================================================================)")
|
||||
message("===================================================================")
|
||||
if (SKIPQT EQUAL 1)
|
||||
message("GUI support: skipped")
|
||||
else (SKIPQT EQUAL 1)
|
||||
if (Qt5_FOUND)
|
||||
message("GUI support: QT5 found, enabled")
|
||||
else (Qt5_FOUND)
|
||||
message("GUI support: QT5 not found, disabled")
|
||||
endif (Qt5_FOUND)
|
||||
endif (SKIPQT EQUAL 1)
|
||||
|
||||
if (SKIPBT EQUAL 1)
|
||||
message("native BT support: skipped")
|
||||
else (SKIPBT EQUAL 1)
|
||||
|
@ -253,7 +263,7 @@ else (SKIPBT EQUAL 1)
|
|||
message("native BT support: Bluez not found, disabled")
|
||||
endif (BLUEZ_FOUND)
|
||||
endif(SKIPBT EQUAL 1)
|
||||
message(" ===================================================================)")
|
||||
message("===================================================================")
|
||||
|
||||
add_executable(proxmark3
|
||||
${PM3_ROOT}/client/src/proxmark3.c
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue