SlideShare a Scribd company logo
Basics of CMake and Git for
  a Hello Qt Application


            :Dinesh
Hello world
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main (int argc, char *argv[]){
  if (argc < 2) {
    printf("Usage: %s numbern",argv[0]);
    return 1;
    }
  double inputValue = atof(argv[1]);
  double outputValue = sqrt(inputValue);
  printf("The square root of %g is %gn", inputValue, outputValue);
  return 0;
}

 /*                              How to Compile?
 ---------------------------------------------------------------------------------------
 $ gcc -c hello.c
 $ gcc -o hello hello.o -lm
 */
A little flashback...
Hello CMake
CMakeLists.txt:

cmake_minimum_required                                      (VERSION                               2.6)
project                                                                                          (Hello)
add_executable(Hello hello.c)
target_link_libraries(Hello m)

--------------------------------------------------------------------------------------------------------
# What to do? :
$ mkdir build
$ cd build
$ cmake ..
$ make
Other nice little things with CMake?
  IF (UNIX)
   CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/libvsxu.pc.in
            ${CMAKE_CURRENT_BINARY_DIR}/libvsxu.pc
            @ONLY)
   INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/libvsxu.pc
        DESTINATION ${VSXU_INSTALL_LIB_DIR}/pkgconfig)
  ENDIF (UNIX)
  #####################

  find_package( OpenCV )
  if(OpenCV_FOUND)
    add_subdirectory(src/video.camera)
  endif(OpenCV_FOUND)

  ########################################
  #For the make install...
  install         (TARGETS            MathFunctions     DESTINATION   bin)
  install (FILES MathFunctions.h DESTINATION include)
Hello Qt
#include <QApplication>
#include <QLabel>

 int main(int argc, char *argv[])
 {
    QApplication app(argc, argv);
    QLabel *label = new QLabel("Hello Qt!");
    label->show();
    return app.exec();
 }
/*                              How to Compile?
---------------------------------------------------------------------------------------
$ g++ -I/usr/include/qt4/QtGui -I/usr/include/qt4/ -c helloqt.cpp
$ g++ -o helloqt helloqt.o -L/usr/lib/i386-linux-gnu -lQtCore -lQtGui -lpthread

*/
CMake to the rescue...
cmake_minimum_required (VERSION 2.6)
project (Hello)
#Find our needed libraries
find_package(Qt4 REQUIRED)

#Tell our compiler to get the headers from the found headers
include(${QT_USE_FILE})

#Tell the compiler how to compile our code
add_executable(HelloQt helloqt.cpp)

#Tell the compiler to link our code with the found libraries
target_link_libraries(HelloQt ${QT_LIBRARIES})
And other Qt Modules?
QT_DONT_USE_QTCORE
QT_DONT_USE_QTGUI
QT_USE_QT3SUPPORT
QT_USE_QTASSISTANT
QT_USE_QAXCONTAINER
QT_USE_QAXSERVER
QT_USE_QTDESIGNER
QT_USE_QTMOTIF
QT_USE_QTMAIN
QT_USE_QTNETWORK
QT_USE_QTNSPLUGIN
QT_USE_QTOPENGL
QT_USE_QTSQL
QT_USE_QTXML
QT_USE_QTSVG
QT_USE_QTTEST
QT_USE_QTUITOOLS
QT_USE_QTDBUS
QT_USE_QTSCRIPT
QT_USE_QTASSISTANTCLIENT
QT_USE_QTHELP
QT_USE_QTWEBKIT
QT_USE_QTXMLPATTERNS
QT_USE_PHONON


# set (QT_USE_QTOPENGL TRUE)
But moc?




SET(foo_MOC_HDRS
  Class1.h
  Class2.h
  Class3.h
)

# After this call, foo_MOC_SRCS = moc_Class1.cxx moc_Class2.cxx moc_Class3.cxx.
QT4_WRAP_CPP(foo_MOC_SRCS ${foo_MOC_HDRS})

ADD_EXECUTABLE(foo ${foo_SRCS} ${foo_MOC_SRCS})
and uic and rcc?
SET(qtproject_UIS main_window.ui)
SET(QtApp_RCCS application.qrc)
QT4_ADD_RESOURCES(QtApp_RCC_SRCS ${QtApp_RCCS})
QT4_WRAP_UI(qtproject_UIS_H ${qtproject_UIS})
# Don't forget to include output directory, otherwise the UI file won't be wrapped!
include_directories(${CMAKE_CURRENT_BINARY_DIR})

#Now add these generated files to the ADD_EXECUTABLE step
# If this is NOT done, then the ui_*.h files will not be generated

add_executable( qtproject ${qtproject_SRCS} ${qtproject_UIS_H} ${QtApp_RCC_SRCS})
Hello Git
Because this is just too ridiculous!
The Git object model...
So... git?
#Creating an empty repository
$git init

# Viewing changes
$ git diff
$ git status

# Asking git to store files
$ git add hello.c

# Finally Saving a state
$ git commit -m "Commit Message"

# Listing all branches
$ git branch

#Creating a Local branch
$ git branch mywork

#Switching to a local branch
$ git checkout mywork

# deleting a branch
$ git branch -d mywork
and now... git merge
$ git checkout mywork
$ git merge origin
and... git rebase
$ git checkout mywork
$ git rebase origin
Useful resources:
●   http://www.cmake.org/cmake/help/cmake_tutorial.html
●   http://qtnode.net/wiki/Qt4_with_cmake
●   http://qt.nokia.com/learning/education/course-materials
●   http://book.git-scm.com/3_distributed_workflows.html
●   http://www.tenouk.com/ModuleW.html

More Related Content

What's hot

GoLang & GoatCore
GoLang & GoatCore GoLang & GoatCore
GoLang & GoatCore
Sebastian Pożoga
 
Tt presentation.ppt
Tt presentation.pptTt presentation.ppt
Tt presentation.ppt
Volodymyr Vitvitskyi
 
Unleash your build with nuke
Unleash your build with nukeUnleash your build with nuke
Unleash your build with nuke
Todor Todorov
 
The Art of Command Line (2021)
The Art of Command Line (2021)The Art of Command Line (2021)
The Art of Command Line (2021)
Kenta Yamamoto
 
PHP 机智问答
PHP 机智问答PHP 机智问答
PHP 机智问答
Shengyou Fan
 
An Introduction to JavaScript: Week 5
An Introduction to JavaScript: Week 5An Introduction to JavaScript: Week 5
An Introduction to JavaScript: Week 5Event Handler
 
Introduction to RevKit
Introduction to RevKitIntroduction to RevKit
Introduction to RevKit
Mathias Soeken
 
Perl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one linersPerl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one liners
Kirk Kimmel
 
From Javascript To Haskell
From Javascript To HaskellFrom Javascript To Haskell
From Javascript To Haskell
ujihisa
 
Reversible Logic Synthesis and RevKit
Reversible Logic Synthesis and RevKitReversible Logic Synthesis and RevKit
Reversible Logic Synthesis and RevKit
Mathias Soeken
 
Rails Scripts
Rails ScriptsRails Scripts
Rails Scripts
Marc Rendl Ignacio
 
Puppet User Group Presentation - 15 March 2012
Puppet User Group Presentation - 15 March 2012Puppet User Group Presentation - 15 March 2012
Puppet User Group Presentation - 15 March 2012
Walter Heck
 
Go Containers
Go ContainersGo Containers
Go Containers
jgrahamc
 
Ruby haskell extension
Ruby haskell extensionRuby haskell extension
Ruby haskell extension
Toshiyuki Terashita
 
Tracing and awk in ns2
Tracing and awk in ns2Tracing and awk in ns2
Tracing and awk in ns2
Pradeep Kumar TS
 
Coding with Vim
Coding with VimCoding with Vim
Coding with Vim
Enzo Wang
 
Sol6
Sol6Sol6

What's hot (20)

GoLang & GoatCore
GoLang & GoatCore GoLang & GoatCore
GoLang & GoatCore
 
Tt presentation.ppt
Tt presentation.pptTt presentation.ppt
Tt presentation.ppt
 
Unleash your build with nuke
Unleash your build with nukeUnleash your build with nuke
Unleash your build with nuke
 
Chat code
Chat codeChat code
Chat code
 
The Art of Command Line (2021)
The Art of Command Line (2021)The Art of Command Line (2021)
The Art of Command Line (2021)
 
PHP 机智问答
PHP 机智问答PHP 机智问答
PHP 机智问答
 
An Introduction to JavaScript: Week 5
An Introduction to JavaScript: Week 5An Introduction to JavaScript: Week 5
An Introduction to JavaScript: Week 5
 
Introduction to RevKit
Introduction to RevKitIntroduction to RevKit
Introduction to RevKit
 
Perl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one linersPerl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one liners
 
From Javascript To Haskell
From Javascript To HaskellFrom Javascript To Haskell
From Javascript To Haskell
 
Reversible Logic Synthesis and RevKit
Reversible Logic Synthesis and RevKitReversible Logic Synthesis and RevKit
Reversible Logic Synthesis and RevKit
 
Rails Scripts
Rails ScriptsRails Scripts
Rails Scripts
 
Puppet User Group Presentation - 15 March 2012
Puppet User Group Presentation - 15 March 2012Puppet User Group Presentation - 15 March 2012
Puppet User Group Presentation - 15 March 2012
 
Go Containers
Go ContainersGo Containers
Go Containers
 
Ruby haskell extension
Ruby haskell extensionRuby haskell extension
Ruby haskell extension
 
Tracing and awk in ns2
Tracing and awk in ns2Tracing and awk in ns2
Tracing and awk in ns2
 
Libtcc and gwan
Libtcc and gwanLibtcc and gwan
Libtcc and gwan
 
Coding with Vim
Coding with VimCoding with Vim
Coding with Vim
 
Sol6
Sol6Sol6
Sol6
 
Note
NoteNote
Note
 

Viewers also liked

Geographic Information Retrieval (GIR)
Geographic Information Retrieval (GIR)Geographic Information Retrieval (GIR)
Geographic Information Retrieval (GIR)
Behrooz Rasuli
 
From 0 to mine sweeper in pyside
From 0 to mine sweeper in pysideFrom 0 to mine sweeper in pyside
From 0 to mine sweeper in pyside
Dinesh Manajipet
 
Geographic Information Retrieval Systems.
Geographic Information Retrieval Systems.Geographic Information Retrieval Systems.
Geographic Information Retrieval Systems.
Dinesh Manajipet
 
evaluation in infomation retrival
evaluation in infomation retrivalevaluation in infomation retrival
evaluation in infomation retrival
jetaime
 
Multi Wavelet for Image Retrival Based On Using Texture and Color Querys
Multi Wavelet for Image Retrival Based On Using Texture and  Color QuerysMulti Wavelet for Image Retrival Based On Using Texture and  Color Querys
Multi Wavelet for Image Retrival Based On Using Texture and Color Querys
IOSR Journals
 
Spatial databases
Spatial databasesSpatial databases
Spatial databases
Seraphic Nazir
 

Viewers also liked (6)

Geographic Information Retrieval (GIR)
Geographic Information Retrieval (GIR)Geographic Information Retrieval (GIR)
Geographic Information Retrieval (GIR)
 
From 0 to mine sweeper in pyside
From 0 to mine sweeper in pysideFrom 0 to mine sweeper in pyside
From 0 to mine sweeper in pyside
 
Geographic Information Retrieval Systems.
Geographic Information Retrieval Systems.Geographic Information Retrieval Systems.
Geographic Information Retrieval Systems.
 
evaluation in infomation retrival
evaluation in infomation retrivalevaluation in infomation retrival
evaluation in infomation retrival
 
Multi Wavelet for Image Retrival Based On Using Texture and Color Querys
Multi Wavelet for Image Retrival Based On Using Texture and  Color QuerysMulti Wavelet for Image Retrival Based On Using Texture and  Color Querys
Multi Wavelet for Image Retrival Based On Using Texture and Color Querys
 
Spatial databases
Spatial databasesSpatial databases
Spatial databases
 

Similar to Basicsof c make and git for a hello qt application

Introduction to CMake
Introduction to CMakeIntroduction to CMake
Introduction to CMake
Dimitrios Platis
 
C Under Linux
C Under LinuxC Under Linux
C Under Linux
mohan43u
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)
Soshi Nemoto
 
Vagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptopVagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptop
Lorin Hochstein
 
Basic Linux kernel
Basic Linux kernelBasic Linux kernel
Basic Linux kernel
Morteza Nourelahi Alamdari
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
Arto Artnik
 
Shrink to grow
Shrink to growShrink to grow
Shrink to grow
Daniel Bovensiepen
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
biicode
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
PgDay.Seoul
 
DWX2015 Code Generierung
DWX2015 Code GenerierungDWX2015 Code Generierung
DWX2015 Code Generierung
Ralf Eggert
 
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
eugeniadean34240
 
GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005
Saleem Ansari
 
Crafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in RubyCrafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in Ruby
Nikhil Mungel
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptx
ssuserb4d806
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuning
AOE
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Chu-Siang Lai
 
Osol Pgsql
Osol PgsqlOsol Pgsql
Osol Pgsql
Emanuel Calvo
 
start_printf: dev/ic/com.c comstart()
start_printf: dev/ic/com.c comstart()start_printf: dev/ic/com.c comstart()
start_printf: dev/ic/com.c comstart()
Kiwamu Okabe
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
Leo Lorieri
 
Itb session v_memcached
Itb session v_memcachedItb session v_memcached
Itb session v_memcachedSkills Matter
 

Similar to Basicsof c make and git for a hello qt application (20)

Introduction to CMake
Introduction to CMakeIntroduction to CMake
Introduction to CMake
 
C Under Linux
C Under LinuxC Under Linux
C Under Linux
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)
 
Vagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptopVagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptop
 
Basic Linux kernel
Basic Linux kernelBasic Linux kernel
Basic Linux kernel
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
Shrink to grow
Shrink to growShrink to grow
Shrink to grow
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
 
DWX2015 Code Generierung
DWX2015 Code GenerierungDWX2015 Code Generierung
DWX2015 Code Generierung
 
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
 
GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005
 
Crafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in RubyCrafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in Ruby
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptx
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuning
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
 
Osol Pgsql
Osol PgsqlOsol Pgsql
Osol Pgsql
 
start_printf: dev/ic/com.c comstart()
start_printf: dev/ic/com.c comstart()start_printf: dev/ic/com.c comstart()
start_printf: dev/ic/com.c comstart()
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Itb session v_memcached
Itb session v_memcachedItb session v_memcached
Itb session v_memcached
 

Recently uploaded

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 

Recently uploaded (20)

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 

Basicsof c make and git for a hello qt application

  • 1. Basics of CMake and Git for a Hello Qt Application :Dinesh
  • 2. Hello world #include <stdio.h> #include <stdlib.h> #include <math.h> int main (int argc, char *argv[]){ if (argc < 2) { printf("Usage: %s numbern",argv[0]); return 1; } double inputValue = atof(argv[1]); double outputValue = sqrt(inputValue); printf("The square root of %g is %gn", inputValue, outputValue); return 0; } /* How to Compile? --------------------------------------------------------------------------------------- $ gcc -c hello.c $ gcc -o hello hello.o -lm */
  • 4. Hello CMake CMakeLists.txt: cmake_minimum_required (VERSION 2.6) project (Hello) add_executable(Hello hello.c) target_link_libraries(Hello m) -------------------------------------------------------------------------------------------------------- # What to do? : $ mkdir build $ cd build $ cmake .. $ make
  • 5. Other nice little things with CMake? IF (UNIX) CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/libvsxu.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libvsxu.pc @ONLY) INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/libvsxu.pc DESTINATION ${VSXU_INSTALL_LIB_DIR}/pkgconfig) ENDIF (UNIX) ##################### find_package( OpenCV ) if(OpenCV_FOUND) add_subdirectory(src/video.camera) endif(OpenCV_FOUND) ######################################## #For the make install... install (TARGETS MathFunctions DESTINATION bin) install (FILES MathFunctions.h DESTINATION include)
  • 6. Hello Qt #include <QApplication> #include <QLabel> int main(int argc, char *argv[]) { QApplication app(argc, argv); QLabel *label = new QLabel("Hello Qt!"); label->show(); return app.exec(); } /* How to Compile? --------------------------------------------------------------------------------------- $ g++ -I/usr/include/qt4/QtGui -I/usr/include/qt4/ -c helloqt.cpp $ g++ -o helloqt helloqt.o -L/usr/lib/i386-linux-gnu -lQtCore -lQtGui -lpthread */
  • 7. CMake to the rescue... cmake_minimum_required (VERSION 2.6) project (Hello) #Find our needed libraries find_package(Qt4 REQUIRED) #Tell our compiler to get the headers from the found headers include(${QT_USE_FILE}) #Tell the compiler how to compile our code add_executable(HelloQt helloqt.cpp) #Tell the compiler to link our code with the found libraries target_link_libraries(HelloQt ${QT_LIBRARIES})
  • 8. And other Qt Modules? QT_DONT_USE_QTCORE QT_DONT_USE_QTGUI QT_USE_QT3SUPPORT QT_USE_QTASSISTANT QT_USE_QAXCONTAINER QT_USE_QAXSERVER QT_USE_QTDESIGNER QT_USE_QTMOTIF QT_USE_QTMAIN QT_USE_QTNETWORK QT_USE_QTNSPLUGIN QT_USE_QTOPENGL QT_USE_QTSQL QT_USE_QTXML QT_USE_QTSVG QT_USE_QTTEST QT_USE_QTUITOOLS QT_USE_QTDBUS QT_USE_QTSCRIPT QT_USE_QTASSISTANTCLIENT QT_USE_QTHELP QT_USE_QTWEBKIT QT_USE_QTXMLPATTERNS QT_USE_PHONON # set (QT_USE_QTOPENGL TRUE)
  • 9. But moc? SET(foo_MOC_HDRS Class1.h Class2.h Class3.h ) # After this call, foo_MOC_SRCS = moc_Class1.cxx moc_Class2.cxx moc_Class3.cxx. QT4_WRAP_CPP(foo_MOC_SRCS ${foo_MOC_HDRS}) ADD_EXECUTABLE(foo ${foo_SRCS} ${foo_MOC_SRCS})
  • 10. and uic and rcc? SET(qtproject_UIS main_window.ui) SET(QtApp_RCCS application.qrc) QT4_ADD_RESOURCES(QtApp_RCC_SRCS ${QtApp_RCCS}) QT4_WRAP_UI(qtproject_UIS_H ${qtproject_UIS}) # Don't forget to include output directory, otherwise the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) #Now add these generated files to the ADD_EXECUTABLE step # If this is NOT done, then the ui_*.h files will not be generated add_executable( qtproject ${qtproject_SRCS} ${qtproject_UIS_H} ${QtApp_RCC_SRCS})
  • 11. Hello Git Because this is just too ridiculous!
  • 12. The Git object model...
  • 13. So... git? #Creating an empty repository $git init # Viewing changes $ git diff $ git status # Asking git to store files $ git add hello.c # Finally Saving a state $ git commit -m "Commit Message" # Listing all branches $ git branch #Creating a Local branch $ git branch mywork #Switching to a local branch $ git checkout mywork # deleting a branch $ git branch -d mywork
  • 14. and now... git merge $ git checkout mywork $ git merge origin
  • 15. and... git rebase $ git checkout mywork $ git rebase origin
  • 16. Useful resources: ● http://www.cmake.org/cmake/help/cmake_tutorial.html ● http://qtnode.net/wiki/Qt4_with_cmake ● http://qt.nokia.com/learning/education/course-materials ● http://book.git-scm.com/3_distributed_workflows.html ● http://www.tenouk.com/ModuleW.html