mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-23 07:37:23 +08:00
Fix QT5 GUI CMake
This commit is contained in:
parent
6b1a8b8390
commit
78a5e666bb
1 changed files with 34 additions and 31 deletions
|
@ -1,25 +1,23 @@
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(proxmark3)
|
project(proxmark3)
|
||||||
|
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
|
||||||
|
if(CMAKE_VERSION VERSION_LESS "3.7.0")
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
|
|
||||||
find_package(Qt5 COMPONENTS Widgets Gui)
|
#set(Qt5_DIR "/opt/Qt/5.13.0/gcc_64/lib/cmake/Qt5")
|
||||||
|
|
||||||
|
find_package(Qt5 COMPONENTS Core Widgets Gui)
|
||||||
|
|
||||||
SET (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
SET (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
INCLUDE(FindSSE)
|
INCLUDE(FindSSE)
|
||||||
#[[
|
|
||||||
IF(SSE3_FOUND)
|
|
||||||
IF(SSSE3_FOUND)
|
|
||||||
SET(CXX_DFLAGS -msse3 -mssse3)
|
|
||||||
ENDIF(SSSE3_FOUND)
|
|
||||||
ENDIF(SSE3_FOUND)
|
|
||||||
|
|
||||||
IF(SSE4_2_FOUND)
|
|
||||||
SET(CXX_DFLAGS -msse4.2 -mpopcnt)
|
|
||||||
ENDIF(SSE4_2_FOUND)
|
|
||||||
ADD_DEFINITIONS(${CXX_DFLAGS})
|
|
||||||
]]
|
|
||||||
if(NOT SSE2_FOUND)
|
if(NOT SSE2_FOUND)
|
||||||
MESSAGE(STATUS "Could not find hardware support for SSE2 on this machine.")
|
MESSAGE(STATUS "Could not find hardware support for SSE2 on this machine.")
|
||||||
endif(NOT SSE2_FOUND)
|
endif(NOT SSE2_FOUND)
|
||||||
|
@ -317,7 +315,6 @@ set (TARGET_SOURCES
|
||||||
src/flash.h
|
src/flash.h
|
||||||
src/graph.c
|
src/graph.c
|
||||||
src/graph.h
|
src/graph.h
|
||||||
src/guidummy.cpp
|
|
||||||
src/preferences.c
|
src/preferences.c
|
||||||
src/preferences.h
|
src/preferences.h
|
||||||
src/pm3_binlib.c
|
src/pm3_binlib.c
|
||||||
|
@ -367,23 +364,34 @@ endif (MINGW)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "-Wall -Werror -O3")
|
set(CMAKE_CXX_FLAGS "-Wall -Werror -O3")
|
||||||
|
|
||||||
|
|
||||||
|
if(NOT Qt5_FOUND)
|
||||||
|
message("Qt5 library not found, not building gui")
|
||||||
|
set(TARGET_SOURCES
|
||||||
|
src/guidummy.cpp
|
||||||
|
${TARGET_SOURCES})
|
||||||
|
endif(NOT Qt5_FOUND)
|
||||||
|
if (Qt5_FOUND)
|
||||||
|
message("Qt5 library found, building gui :)")
|
||||||
|
set (TARGET_SOURCES
|
||||||
|
src/proxgui.cpp
|
||||||
|
src/proxgui.h
|
||||||
|
src/proxguiqt.cpp
|
||||||
|
src/proxguiqt.h
|
||||||
|
${TARGET_SOURCES})
|
||||||
|
add_custom_command(OUTPUT src/proxguiqt.moc.cpp
|
||||||
|
COMMAND "$(MOC) -o src/proxguiqt.moc.cpp proxguiqt.h"
|
||||||
|
COMMENT "Creating src/proxguiqt.moc.cpp"
|
||||||
|
)
|
||||||
|
add_definitions("-DHAVE_GUI")
|
||||||
|
set(ADDITIONAL_LNK Qt5::Core Qt5::Widgets Qt5::Gui ${ADDITIONAL_LNK})
|
||||||
|
endif (Qt5_FOUND)
|
||||||
|
|
||||||
add_executable(
|
add_executable(
|
||||||
proxmark3
|
proxmark3
|
||||||
${TARGET_SOURCES}
|
${TARGET_SOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
if(NOT Qt5_LIB)
|
|
||||||
message("Qt5 library not found, not building gui")
|
|
||||||
endif()
|
|
||||||
if (Qt5_LIB)
|
|
||||||
add_executable(proxguiqt
|
|
||||||
src/proxgui.cpp
|
|
||||||
src/proxgui.h
|
|
||||||
src/proxguiqt.cpp
|
|
||||||
src/proxguiqt.h)
|
|
||||||
endif (Qt5_LIB)
|
|
||||||
|
|
||||||
|
|
||||||
find_library(jansson REQUIRED)
|
find_library(jansson REQUIRED)
|
||||||
find_library(tinycbor REQUIRED)
|
find_library(tinycbor REQUIRED)
|
||||||
find_library(lua REQUIRED)
|
find_library(lua REQUIRED)
|
||||||
|
@ -408,11 +416,6 @@ add_custom_command(OUTPUT lualibs/mfc_default_keys.lua
|
||||||
COMMENT "Creating lualibs/mfc_default_keys.lua"
|
COMMENT "Creating lualibs/mfc_default_keys.lua"
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_command(OUTPUT src/proxguiqt.moc.cpp
|
|
||||||
COMMAND "$(MOC) -o src/proxguiqt.moc.cpp proxguiqt.h"
|
|
||||||
COMMENT "Creating src/proxguiqt.moc.cpp"
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_command(OUTPUT src/ui/ui_overlays.h
|
add_custom_command(OUTPUT src/ui/ui_overlays.h
|
||||||
COMMAND "$(UIC) src/ui/overlays.ui > src/ui/ui_overlays.h"
|
COMMAND "$(UIC) src/ui/overlays.ui > src/ui/ui_overlays.h"
|
||||||
COMMENT "Creating ui/ui_overlays.h"
|
COMMENT "Creating ui/ui_overlays.h"
|
||||||
|
|
Loading…
Reference in a new issue