From: Joel Holdsworth Date: Mon, 28 May 2012 21:32:36 +0000 (+0100) Subject: Created a CMake build environment X-Git-Tag: pulseview-0.1.0~353 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=df9443999c6b365c37cd254320d7dfa1aa4a815b;p=pulseview.git Created a CMake build environment --- diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..fd932a29 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,68 @@ +cmake_minimum_required(VERSION 2.6) +include(FindPkgConfig) + +project(sigrok-qt2) + +find_package(PkgConfig) +pkg_check_modules(PKGDEPS REQUIRED + libsigrokdecode>=0.1.0 + libsigrok>=0.1.0 +) + +find_package(Qt4 REQUIRED) + +set(VERSION 0.1.0) + +set(sigrok-qt2_SOURCES + about.cpp + main.cpp + mainwindow.cpp + sigview.cpp +) + +set(sigrok-qt2_HEADERS + about.h + mainwindow.h + sigview.h +) + +set(sigrok-qt2_FORMS + about.ui + mainwindow.ui +) + +set(sigrok-qt2_RESOURCES + sigrok-qt2.qrc +) + +set(QT_USE_QTOPENGL TRUE) + +qt4_wrap_cpp(sigrok-qt2_HEADERS_MOC ${sigrok-qt2_HEADERS}) +qt4_wrap_ui(sigrok-qt2_FORMS_HEADERS ${sigrok-qt2_FORMS}) +qt4_add_resources(sigrok-qt2_RESOURCES_RCC ${sigrok-qt2_RESOURCES}) + +include(${QT_USE_FILE}) + +add_definitions(${QT_DEFINITIONS}) +add_definitions(-DAPP_VERSION="${VERSION}") + +include_directories( + ${include_directories} + ${PKGDEPS_INCLUDE_DIRS} +) + +link_directories( + ${PKGDEPS_LIBRARY_DIRS} +) + +add_executable(sigrok-qt2 + ${sigrok-qt2_SOURCES} + ${sigrok-qt2_HEADERS_MOC} + ${sigrok-qt2_FORMS_HEADERS} + ${sigrok-qt2_RESOURCES_RCC} +) + +target_link_libraries(sigrok-qt2 + ${PKGDEPS_LIBRARIES} + ${QT_LIBRARIES} +) diff --git a/sigrok-qt2.pro b/sigrok-qt2.pro deleted file mode 100644 index 7993c936..00000000 --- a/sigrok-qt2.pro +++ /dev/null @@ -1,44 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2012-05-10T21:19:20 -# -#------------------------------------------------- - -QT += core gui opengl - -TARGET = sigrok-qt2 -TEMPLATE = app - -# The sigrok-qt version number. Define APP_VERSION macro for use in the code. -VERSION = 0.1.0 -DEFINES += APP_VERSION=\\\"$$VERSION\\\" - -SOURCES += main.cpp\ - mainwindow.cpp \ - about.cpp \ - sigview.cpp - -HEADERS += mainwindow.h \ - about.h \ - sigview.h - -FORMS += mainwindow.ui \ - about.ui - -RESOURCES += sigrok-qt2.qrc - -# libsigrok and libsigrokdecode -# TODO: Check for the minimum versions of libsigrok/libsigrokdecode we need. -win32 { - # On Windows/MinGW we need to use '--libs --static'. - # We also need to strip some stray '\n' characters here. - QMAKE_CXXFLAGS += $$system(pkg-config --cflags libsigrokdecode \ - libsigrok | sed s/\n//g) - LIBS += $$system(pkg-config --libs --static libsigrokdecode \ - libsigrok | sed s/\n//g) -} else { - QMAKE_CXXFLAGS += $$system(pkg-config --cflags libsigrokdecode) - QMAKE_CXXFLAGS += $$system(pkg-config --cflags libsigrok) - LIBS += $$system(pkg-config --libs libsigrokdecode) - LIBS += $$system(pkg-config --libs libsigrok) -}