qt5 CMakeList文件
程序员文章站
2022-03-15 21:08:25
...
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
#add_subdirectory(ADMIN)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
PROJECT(TestCapture)
SET(PROJECT_NAME TestCapture)
set (CMAKE_BUILD_TYPE "Debug")
#add_definitions (-Wall)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
IF (NOT CMAKE_HOST_UNIX)
MESSAGE(FATAL_ERROR "Not able to build on ${CMAKE_HOST_SYSTEM} ${CMAKE_SYSTEM_VERSION}")
ENDIF (NOT CMAKE_HOST_UNIX)
add_definitions("-g -std=c++11")
# We need Qt4 and other libraries for the mviewer
#SET(CMAKE_MODULE_PATH ./CMakeModules)
set(CMAKE_PREFIX_PATH "/opt/spmlib/qt-5.11.2/lib/cmake/Qt5/")
find_package(Qt5 COMPONENTS Widgets)
INCLUDE_DIRECTORIES(
./include
./include/LibMWCapture)
link_directories(${CMAKE_SOURCE_DIR}/lib64
)
add_executable (TestCapture
main.cpp
mainwindow.cpp
mainwindow.h
myopenglwidget.cpp
myopenglwidget.h
mainwindow.ui)
#target_compile_options(spm -fsanitize=address -fno-omit-frame-pointer )
# For datatk use this:
#target_link_libraries (spm vtkGraphics vtkImaging vtkCommon vtkRendering vtkHybrid QVTK cad ${DCMTK_LIBS} oflog ofstd ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTXML_LIBRARY} datatk pugixml)
# Without datatk use this
target_link_libraries (TestCapture Qt5::Widgets -lpthread -lMWCapture -lm -ludev -lasound -lv4l2)