SlideShare une entreprise Scribd logo
1  sur  66
Auto Build System
Alexey Podoba
Senior C++ Developer at Ciklum
Auto Build System
•   Preview
•   CMake
•   CTest
•   CDash
•   CPack
Auto Build System
• CMake             • qmake
• Scons             • Jam, FTJam, Kjam, BJa
• Waf                 m
• Fbuild            • Makepp
• A-A-P             • Rake
• Maven             • Rant
• Ant               • Phing
• NAnt              • Makeit
• GNU Autotools     • Etc
What to choose?
•   Type
•   Simplicity
•   Flexibility
•   Speed
•   Cross platform
•   Parallel build
•   …
Type
            Builder          Generators
•   Scons             • Generators
•   Waf               • GNU Autotools
•   Jam               • QMake
•   Ant
•   NAnt
•   RAnt
•   Rake
Simply && Flexibility
• Own syntax                   • XML
  •   CMake                      • Maven
  •   GNU Autotools              • Ant
  •   qmake                      • NAnt
  •   Jam, FTJam, Kjam, BJam   • Perl
• Python                         • Makepp
  •   Scons                    • Ruby
  •   Waf                        • Rake
  •   Fbuild                     • Rant
  •   A-A-P
Linux && Speed
BUILD SYSTEM    FULL BUILD INCREMENTAL   INCREMENTAL LIB


GNU Make        2m 21s    0m 2.4s        0m 0.0s

Jam             2m 42s    0m 1.6s        0m 0.1s

BoostBuild v2   3m 28s    0m 46s         0m 1.6s


Scons           5m 08s    1m 06s         0m 10.4s


Ant             2m 8s     0m 21s         0m 1.7s
Rant            2m 32s    0m 10s         0m 4.9s
Windows && Speed
BUILD SYSTEM                                       FULL BUILD   INCREMENTAL   INCREMENTAL LIB


Microsoft Visual Studio 2003                       7m 28s       0m 54s        0m 4s


Microsoft Visual Studio 2003 + FastSolutionBuild   7m 26s       0m 1s         0m 1s


Microsoft Visual Studio 2005                       6m 46s       0m 20s        0m 3.5s


VCBuild                                            6m 56s       0m 18s        0m 0.5s

Jam                                                6m 52s       0m 3.1s       0m 0.3s
BoostBuild v2                                      12m 03s      0m 55s        0m 2s

Scons                                              7m 52s       0m 57s        0m 7s

Ant                                                3m 42s       0m 33s        0m 1.9s
Nant                                               3m 24s       0m 35s        0m 1.4s
Rant                                               5m 47s       0m 25s        0m 14s
CMake vs Autotools

Task        CMake    Autotools



                     Automake 00:41
Configure   0:08
                     Configure 00:20



Make        12:15    21:16
Install     0:20     0:36
Total       12:43    22:43
Auto Build System
• CMake             • qmake

• Scons
• Waf               • Jam, FTJam, Kjam, BJa
                      m
• Ant
• NAnt
CMake/CPack/CTest
/CDash
Why CMake?
•   Process
•   Fast
•   Easy to implement
•   Easy to use
•   Easy to use across platform
•   Easy to have multi configuration
•   Easy to have clean code
•   Easy to convert any project to CMake
•   Everyone Uses It
•   Etc
Process

                   ...



     Release              Implementation




               …         Testing
Process

                 …


     CPack                 CMake




             …       CDash/CTest
Fast
• Implement on C++
• http://blog.qgis.org/?q=node/16 “I was quite surprised with
  the speed of building Quantum GIS codebase in comparison to
  Autotools”

 Task                 CMake            Autotools
                                       Automake 00:41
 Configure            0:08
                                       Configure 00:20
 Make                 12:15            21:16
 Install              0:20             0:36
 Total                12:43            22:43
Easy to implement
CMakeLists.txt

cmake_minimum_required (VERSION 2.8)
project (HELLO)
add_executable (hello main.cpp)
Easy to use
• Just call “cmake ./” in project directory with CMakeLists.txt




• And than “make”
• Or
Easy to use
• Or
Easy use across platform
• One simple language for all platforms
  •   Windows
  •   Linux
  •   Unix
  •   Mac
  •   High-performance computing
  •   Embeded
  •   Etc
Easy use across platform
•   Borland Makefiles     •   Visual Studio 6-10
•   MSYS Makefiles        •   Watcom WMake
•   MinGW Makefiles       •   CodeBlocks
•   NMake Makefiles       •   Eclipse CDT4
•   NMake Makefiles JOM   •   KDevelop3
•   Unix Makefiles        •   XCode

Sample:
cmake –G”CodeBlocks”
Easy to use multi configuration
• Build Configuration
  •   Debug
  •   Release
  •   RelWithDebInfo
  •   MinSizeRel
  •   etc
• CMake build parameteres
     -DVERSION=1.1.1
• CMake build init file with sated variables
     cmake -Cinitfile.cmake
CMake Init File
set (CPACK_PACKAGE_VERSION_MAJOR 5)
set (CPACK_PACKAGE_VERSION_MINOR 7)
set (CPACK_PACKAGE_VERSION_PATCH 1)
set (CPACK_RESOURCE_FILE_LICENSE Copyright.txt")
set (CPACK_RESOURCE_FILE_README "Description.txt")
set (CPACK_RESOURCE_FILE_WELCOME "Welcome.txt")
Easy to have clean code
• Out-of-source build trees leave source clean
Just call cmake command with parameter –B“../build”

Sample:
cmake “./src” –B”build” –G”NMake Makefiles” –demover.cmake



-DEXECUTABLE_OUTPUT_PATH /tmp/bin_result
Easy to convert
• am2cmake
  http://websvn.kde.org/trunk/KDE/kdesdk/cmake/scripts/am2
  cmake?view=markup
• qmake converter
  http://www.vtk.org/Wiki/CMake:ConvertFromQmake
• vcproj2cmake.rb
  http://sourceforge.net/projects/vcproj2cmake/files/
• folders4cmake
  http://sourceforge.net/projects/folders4cmake/
• etc
Everyone Uses It
• Avidemux               Registration Toolkit   • PvPGN
• Bullet Physics     •   KDE                    • Quantum GIS
  Library            •   Choqok                 • qutIM
• Chicken            •   Kicad                  • ReactOS
• Clementine         •   LeechCraft             • Scribus
• Cuneiform          •   LLVM                   • Slicer
• DevIL              •   LMMS                   • Stellarium
• Drishti            •   MuseScore              • Supertux
• EiskaltDC++        •   MySQL                  • The Visualization
• FreeCAD            •   OGRE                     Toolkit
• GDCM               •   OpenSceneGraph         • OpenCV
• IGSTK              •   ParaView               • Boost
• Insight            •   PCSX2
  Segmentation and   •   Pichi
What is CMake?
• CMakeLists.txt
• *.cmake
CMake
• Built-in rules for common targets
  •   Executable
  •   Shared Libraries/ DLLs
  •   Static libraries ( archives)
  •   OS X Frameworks and App Bundles

  add_executable(<name> [WIN32] [MACOSX_BUNDLE]
      [EXCLUDE_FROM_ALL] source1 source2 ... sourceN)
  add_library(<name> [STATIC | SHARED | MODULE]
      [EXCLUDE_FROM_ALL] source1 source2 ... sourceN)
CMake
• Custom targets
  • Generated Documentation
  • Generated sources and headers

  add_custom_target (Docs ALL COMMAND
  ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile
  SOURCES ${PROJECT_BINARY_DIR}/Doxyfile)

  add_custom_target ( generateheader ALL DEPENDS
  results/header.h COMMAND blablabla )
CMake Features
• Custom command

  add_custom_command( OUTPUT Foo.trx COMMAND perl
      ${SOURCE_DIR}/combine.pl ${trofiles} -o Foo.trx
      DEPENDS ${trofiles} )
      add_custom_target(do_trofiles DEPENDS Foo.trx)

  add_custom_command( TARGET target
      PRE_BUILD | PRE_LINK | POST_BUILD
      COMMAND command [ARGS [args...]]
      [COMMENT comment])
CMake
• include_directories ([AFTER|BEFORE] [SYSTEM] dir1 dir2 ...)

• link_directories(directory1 directory2 ...)

• target_link_libraries (<target> [lib1 [lib2 [...]]]
  [[debug|optimized|general] <lib>] ...)

• add_dependencies(target-name depend-target1
  depend-target2 ...)
CMake
• foreach
        foreach (val ${FILES})
        ...
        endforeach()
• if else
      if (MSVC)
        add_definitions (/W3)
      elseif (CMAKE_COMPILER_IS_GNUCXX)
        add_definitions (-Wall -pedantic)
      else ()
        message ("Unknown compiler")
      endif ()
CMake Macros
• Macros
macro(MyMacro ${var})
       …
endmacro()
• Functions
function(myfunc ${var})
       ….
endfunction(myfunc)
Macro
macro(list_header_directory _PATH _HEADERS)
  include_directories("${_PATH}")
  file (GLOB headers "${_PATH}/*.h")
  if( NOT "${ARGV2}" STREQUAL "")
      SOURCE_GROUP(${ARGV2} FILES ${headers})
  endif( NOT "${ARGV2}" STREQUAL "")
  set(${_HEADERS} ${headers})
endmacro()
External library & package
• find_library
• find_package



• set (BOOST_ROOT "${EXTERNAL_PATH}/boost_1_47")
  FIND_PACKAGE(Boost COMPONENTS system REQUIRED)
Find package
• FindMPI           •   FindALSA          •   FindSubversion
• FindwxWidgets     •   FindProtobuf      •   FindCoin3D
• FindLATEX         •   FindFreeType      •   FindSWIG
• FindImageMagick   •   FindGDAL          •   FindJNI
• FindBLAS          •   FindGIFLIB        •   FindJava
• FindLAPACK        •   FindLua50         •   FindOpenSSL
• FindBoost         •   FindLua51         •   FindDCMTK
• FindGTK2          •   FindOpenAL        •   FindQt4
• FindCxxTest       •   FindOpenThreads   •   FindRTI
• FindDoxygen       •   FindPhysFS        •   FindHDF5
• FindGnuTLS        •   FindProducer      •   FindZLIB
• FindFLEX          •   FindQuickTime     •   FindCUDA
• FindBISON         •   FindSDL           •   FindArmadillo
• FindGTest         •   FindosgDB
  Framework)        •   FindosgFX
• FindBullet        •   FindosgViewer
CMake & Boost
set (BOOST_COMPONENTS thread filesystem)
set (Boost_USE_STATIC_LIBS ON)
set (Boost_USE_MULTITHREADED ON)
find_package (Boost COMPONENTS ${BOOST_COMPONENTS}
REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
…
target_link_libraries (${PROJECT} ${Boost_LIBRARIES})
CMake & Qt
find_package (Qt4 REQUIRED)
include (${QT_USE_FILE})
...
target_link_libraries (${PROJECT} ${QT_LIBRARIES})
CMake & Subversion
FIND_PACKAGE(Subversion)
IF(Subversion_FOUND)
       Subversion_WC_INFO(${CMAKE_HOME_DIRECTORY}
Project)
       MESSAGE("Current revision is ${Project_WC_REVISION}")
ENDIF(Subversion_FOUND)
CMake & CppCheck
FIND_PACKAGE(cppcheck)
add_library (MyTarget source.cpp)
add_to_cppcheck(MyTarget PRE_BUILD FAILED )

add_to_cppcheck( TARGET target
      PRE_BUILD | PRE_LINK | POST_BUILD | TEST
      [FAILED | WARNING ] )
CMake Scripts
• cmake -E command
  •   Copy file
  •   Remove file
  •   Compare and conditionally copy
  •   time
  •   etc
• cmake -P script.cmake
Using CMake
./hello/CMakeLists.txt

add_library (Hello hello.cpp)
./demo/CMakeLists.txt
 include_directories (../Hello)
 add_executable (helloDemo demo.cpp)
 target_link_libraries (helloDemo Hello)
 ADD_DEPENDENCIES(helloDemo Hello)
./CMakeLists.txt
cmake_minimum_required (VERSION 2.6)
project (HELLO)
if(WIN32)
   add_definitions (-DUNICODE -D_UNICODE)
   set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /MTd /Zi /Od ")
   set(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG")
   set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MTd /Zi /Od /MP)
   set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG /MP")
else(WIN32)
   set(CMAKE_CXX_FLAGS_DEBUG "-g3 -pipe -O0 -DDEBUG -g")
   set(CMAKE_CXX_FLAGS_RELEASE "-g0 -pipe -O2 -finline-functions -
DNDEBUG -s")
endif(WIN32)
add_subdirectory (Hello Demo)
CTest
CTest
enable_testing ()
ADD_TEST (TestIdentifier ExecutableName [AnyArgsForTest])

How to run it
CTest
make test
RUN_TESTS In IDE

or
add_custom()
CTest & Boost Test
set (TESTS_SOURCES ../tests/test.cpp)
find_package (Boost COMPONENTS unit_test_framework
REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
set (TEST boost.${PROJECT} )
add_executable (${TEST} ${TESTS_SOURCES})
target_link_libraries (${TEST} ${PROJECT} ${Boost_LIBRARIES})
enable_testing ()
add_test (${TEST} ${TEST})
CTest & GTest
set (TESTS_SOURCES ../tests/test.cpp)
find_package (GTest REQUIRED)
include_directories(${GTest_INCLUDE_DIRS})
set (TEST gtest. ${PROJECT} )
add_executable (${TEST} ${TESTS_SOURCES})
target_link_libraries (${TEST} ${PROJECT}
       ${Gtest_BOTH_LIBRARIES})
enable_testing ()
add_test (${TEST} ${TEST})
CTest and build
CTest
set (PROJECT_NAME "MyProject")
set (CTEST_DROP_METHOD "http")
set (CTEST_DROP_SITE "my.cdash.org")
set (CTEST_DROP_LOCATION "/submit.php?project=VALG1")
set (CTEST_DROP_SITE_CDASH TRUE)
set (CTEST_SITE "MyPCName")
set (CTEST_BUILD_NAME "Windows")
set (CTEST_SOURCE_DIRECTORY "${ROOT_DIRECTORY }/src")
set (CTEST_BINARY_DIRECTORY ${ROOT_DIRECTORY}/build")
set (CTEST_BUILD_CONFIGURATION Debug)
CTest
Memory checker
SET (PURIFYCOMMAND:FILEPATH ${PATH}/purify.exe)
SET (MEMORYCHECK_COMMAND:FILEPATH ${PATH}/valgrind )



Test coverage
SET (CTEST_COVERAGE_COMMAND “tools/gcov")
CTest
ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY})
ctest_start (Experimental)
ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}")
ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}")
ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}")
ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}")
ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}")
ctest_coverage (BUILD "${CTEST_BINARY_DIRECTORY}")
ctest_memcheck (BUILD "${CTEST_BINARY_DIRECTORY}")
ctest_submit()
CDash
CDash
CDash
CDash
CDash
CDash
CPack
CPack
•   TGZ                       •   TZ
•   STGZ                      •   ZIP
•   TBZ2                      •   NSIS
•   DragNDrop (OSX only)      •   CygwinBinary (Cygwin only)
•   PackageMaker (OSX only)   •   CygwinSource (Cygwin only)
•   OSXX11 (OSX only)         •   DEB (UNIX only)
•   Bundle (OSX only)         •   RPM (Unix Only)
CPack
• Setting variables
       set (CPACK_PACKAGE_VERSION_MAJOR 5)
       set (CPACK_PACKAGE_VERSION_MINOR 7)
       set (CPACK_PACKAGE_VERSION_PATCH 1)
       set (CPACK_RESOURCE_FILE_LICENSE Copyright.txt")
       set (CPACK_RESOURCE_FILE_README "Description.txt")
       set (CPACK_RESOURCE_FILE_WELCOME "Welcome.txt")
• Choose generator
       set(CPACK_GENERATOR TGZ)
       set(CPACK_GENERATOR NSIS)
• Include CPack
       include(CPack)
CPack
• Define taragets
       INSTALL(TARGETS ${APPLICATION} DESTINATION bin)
       INSTALL(FILES ${APPLICATION} DESTINATION bin)
CPack
• make install
• make package
• make package_source
CPack Mac
CPack Windows
Question?
Alexey Podoba
Senior C++ Developer at Ciklum

Contenu connexe

Tendances

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 2014biicode
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with AugeasPuppet
 
Usage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxUsage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxWilliam Lee
 
Usage Note of SWIG for PHP
Usage Note of SWIG for PHPUsage Note of SWIG for PHP
Usage Note of SWIG for PHPWilliam Lee
 
OpenStack Swift Command Line Reference Diablo v1.2
OpenStack Swift Command Line Reference Diablo v1.2OpenStack Swift Command Line Reference Diablo v1.2
OpenStack Swift Command Line Reference Diablo v1.2Amar Kapadia
 
Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3William Lee
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Michele Orselli
 
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5 Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5 William Lee
 
Sunil phani's take on windows powershell
Sunil phani's take on windows powershellSunil phani's take on windows powershell
Sunil phani's take on windows powershellSunil Phani
 
Introduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command lineIntroduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command lineBehzod Saidov
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configurationlutter
 
Using Puppet to Create a Dynamic Network - PuppetConf 2013
Using Puppet to Create a Dynamic Network - PuppetConf 2013Using Puppet to Create a Dynamic Network - PuppetConf 2013
Using Puppet to Create a Dynamic Network - PuppetConf 2013Puppet
 
Powershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge ClubPowershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge ClubEssam Salah
 
Usage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesUsage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesWilliam Lee
 

Tendances (19)

C++ for the Web
C++ for the WebC++ for the Web
C++ for the Web
 
C make tutorial
C make tutorialC make tutorial
C make tutorial
 
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
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with Augeas
 
kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
 
Usage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxUsage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on Linux
 
Usage Note of SWIG for PHP
Usage Note of SWIG for PHPUsage Note of SWIG for PHP
Usage Note of SWIG for PHP
 
Docker Compose Explained
Docker Compose ExplainedDocker Compose Explained
Docker Compose Explained
 
OpenStack Swift Command Line Reference Diablo v1.2
OpenStack Swift Command Line Reference Diablo v1.2OpenStack Swift Command Line Reference Diablo v1.2
OpenStack Swift Command Line Reference Diablo v1.2
 
Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
 
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5 Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
 
Sunil phani's take on windows powershell
Sunil phani's take on windows powershellSunil phani's take on windows powershell
Sunil phani's take on windows powershell
 
Introduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command lineIntroduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command line
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configuration
 
Using Puppet to Create a Dynamic Network - PuppetConf 2013
Using Puppet to Create a Dynamic Network - PuppetConf 2013Using Puppet to Create a Dynamic Network - PuppetConf 2013
Using Puppet to Create a Dynamic Network - PuppetConf 2013
 
Powershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge ClubPowershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge Club
 
Usage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesUsage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP Languages
 
Puppet
PuppetPuppet
Puppet
 

Similaire à CiklumCPPSat: Alexey Podoba "Automatic assembly. Cmake"

Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Ryan Cuprak
 
Commit to excellence - Java in containers
Commit to excellence - Java in containersCommit to excellence - Java in containers
Commit to excellence - Java in containersRed Hat Developers
 
Kitware: Qt and Scientific Computing
Kitware: Qt and Scientific ComputingKitware: Qt and Scientific Computing
Kitware: Qt and Scientific Computingaccount inactive
 
Monitoring Docker at Scale - Docker San Francisco Meetup - August 11, 2015
Monitoring Docker at Scale - Docker San Francisco Meetup - August 11, 2015Monitoring Docker at Scale - Docker San Francisco Meetup - August 11, 2015
Monitoring Docker at Scale - Docker San Francisco Meetup - August 11, 2015Datadog
 
Cloud Platforms "demystified": Docker, Kubernetes, Knative & Cloud Foundry
Cloud Platforms "demystified": Docker, Kubernetes, Knative & Cloud FoundryCloud Platforms "demystified": Docker, Kubernetes, Knative & Cloud Foundry
Cloud Platforms "demystified": Docker, Kubernetes, Knative & Cloud FoundryQAware GmbH
 
HOW TO DRONE.IO IN CI/CD WORLD
HOW TO DRONE.IO IN CI/CD WORLDHOW TO DRONE.IO IN CI/CD WORLD
HOW TO DRONE.IO IN CI/CD WORLDAleksandr Maklakov
 
Lessons from Driverless AI going to Production
Lessons from Driverless AI going to ProductionLessons from Driverless AI going to Production
Lessons from Driverless AI going to ProductionSri Ambati
 
Apache Continuum Build, Test, and Release
Apache Continuum Build, Test, and ReleaseApache Continuum Build, Test, and Release
Apache Continuum Build, Test, and Releaseelliando dias
 
Kubernetes at Spreadshirt - First steps to production
Kubernetes at Spreadshirt - First steps to productionKubernetes at Spreadshirt - First steps to production
Kubernetes at Spreadshirt - First steps to productionJens Hadlich
 
Использование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложенийИспользование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложенийVitebsk Miniq
 
OpenStack Deployments with Chef
OpenStack Deployments with ChefOpenStack Deployments with Chef
OpenStack Deployments with ChefMatt Ray
 
C++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroC++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroMohammad Shaker
 
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on AzureDocker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on AzurePatrick Chanezon
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and ActivatorKevin Webber
 
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure Patrick Chanezon
 
Docker - From Walking To Running
Docker - From Walking To RunningDocker - From Walking To Running
Docker - From Walking To RunningGiacomo Vacca
 

Similaire à CiklumCPPSat: Alexey Podoba "Automatic assembly. Cmake" (20)

Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
 
Commit to excellence - Java in containers
Commit to excellence - Java in containersCommit to excellence - Java in containers
Commit to excellence - Java in containers
 
.NET6.pptx
.NET6.pptx.NET6.pptx
.NET6.pptx
 
Kitware: Qt and Scientific Computing
Kitware: Qt and Scientific ComputingKitware: Qt and Scientific Computing
Kitware: Qt and Scientific Computing
 
Monitoring Docker at Scale - Docker San Francisco Meetup - August 11, 2015
Monitoring Docker at Scale - Docker San Francisco Meetup - August 11, 2015Monitoring Docker at Scale - Docker San Francisco Meetup - August 11, 2015
Monitoring Docker at Scale - Docker San Francisco Meetup - August 11, 2015
 
Cloud Platforms "demystified": Docker, Kubernetes, Knative & Cloud Foundry
Cloud Platforms "demystified": Docker, Kubernetes, Knative & Cloud FoundryCloud Platforms "demystified": Docker, Kubernetes, Knative & Cloud Foundry
Cloud Platforms "demystified": Docker, Kubernetes, Knative & Cloud Foundry
 
HOW TO DRONE.IO IN CI/CD WORLD
HOW TO DRONE.IO IN CI/CD WORLDHOW TO DRONE.IO IN CI/CD WORLD
HOW TO DRONE.IO IN CI/CD WORLD
 
Lessons from Driverless AI going to Production
Lessons from Driverless AI going to ProductionLessons from Driverless AI going to Production
Lessons from Driverless AI going to Production
 
Apache Continuum Build, Test, and Release
Apache Continuum Build, Test, and ReleaseApache Continuum Build, Test, and Release
Apache Continuum Build, Test, and Release
 
Automate Thyself
Automate ThyselfAutomate Thyself
Automate Thyself
 
Kubernetes at Spreadshirt - First steps to production
Kubernetes at Spreadshirt - First steps to productionKubernetes at Spreadshirt - First steps to production
Kubernetes at Spreadshirt - First steps to production
 
Использование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложенийИспользование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложений
 
.NET7.pptx
.NET7.pptx.NET7.pptx
.NET7.pptx
 
OpenStack Deployments with Chef
OpenStack Deployments with ChefOpenStack Deployments with Chef
OpenStack Deployments with Chef
 
Node azure
Node azureNode azure
Node azure
 
C++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroC++ Windows Forms L01 - Intro
C++ Windows Forms L01 - Intro
 
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on AzureDocker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and Activator
 
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
 
Docker - From Walking To Running
Docker - From Walking To RunningDocker - From Walking To Running
Docker - From Walking To Running
 

Plus de Ciklum Ukraine

"How keep normal blood pressure using TDD" By Roman Loparev
"How keep normal blood pressure using TDD" By Roman Loparev"How keep normal blood pressure using TDD" By Roman Loparev
"How keep normal blood pressure using TDD" By Roman LoparevCiklum Ukraine
 
"Through the three circles of the it hell" by Roman Liashenko
"Through the three circles of the it hell" by Roman Liashenko"Through the three circles of the it hell" by Roman Liashenko
"Through the three circles of the it hell" by Roman LiashenkoCiklum Ukraine
 
Alex Pazhyn: Google_Material_Design
Alex Pazhyn: Google_Material_DesignAlex Pazhyn: Google_Material_Design
Alex Pazhyn: Google_Material_DesignCiklum Ukraine
 
Introduction to amazon web services for developers
Introduction to amazon web services for developersIntroduction to amazon web services for developers
Introduction to amazon web services for developersCiklum Ukraine
 
Your 1st Apple watch Application
Your 1st Apple watch ApplicationYour 1st Apple watch Application
Your 1st Apple watch ApplicationCiklum Ukraine
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven DevelopmentCiklum Ukraine
 
Back to the future: ux trends 2015
Back to the future: ux trends 2015Back to the future: ux trends 2015
Back to the future: ux trends 2015Ciklum Ukraine
 
Developing high load systems using C++
Developing high load systems using C++Developing high load systems using C++
Developing high load systems using C++Ciklum Ukraine
 
Collection view layout
Collection view layoutCollection view layout
Collection view layoutCiklum Ukraine
 
Introduction to auto layout
Introduction to auto layoutIntroduction to auto layout
Introduction to auto layoutCiklum Ukraine
 
Unit Testing: Special Cases
Unit Testing: Special CasesUnit Testing: Special Cases
Unit Testing: Special CasesCiklum Ukraine
 
Model-View-Controller: Tips&Tricks
Model-View-Controller: Tips&TricksModel-View-Controller: Tips&Tricks
Model-View-Controller: Tips&TricksCiklum Ukraine
 
Future of Outsourcing report published in The Times featuring Ciklum's CEO To...
Future of Outsourcing report published in The Times featuring Ciklum's CEO To...Future of Outsourcing report published in The Times featuring Ciklum's CEO To...
Future of Outsourcing report published in The Times featuring Ciklum's CEO To...Ciklum Ukraine
 
Михаил Попчук "Cкрытые резервы команд или 1+1=3"
Михаил Попчук "Cкрытые резервы команд или 1+1=3"Михаил Попчук "Cкрытые резервы команд или 1+1=3"
Михаил Попчук "Cкрытые резервы команд или 1+1=3"Ciklum Ukraine
 

Plus de Ciklum Ukraine (20)

"How keep normal blood pressure using TDD" By Roman Loparev
"How keep normal blood pressure using TDD" By Roman Loparev"How keep normal blood pressure using TDD" By Roman Loparev
"How keep normal blood pressure using TDD" By Roman Loparev
 
"Through the three circles of the it hell" by Roman Liashenko
"Through the three circles of the it hell" by Roman Liashenko"Through the three circles of the it hell" by Roman Liashenko
"Through the three circles of the it hell" by Roman Liashenko
 
Alex Pazhyn: Google_Material_Design
Alex Pazhyn: Google_Material_DesignAlex Pazhyn: Google_Material_Design
Alex Pazhyn: Google_Material_Design
 
Introduction to amazon web services for developers
Introduction to amazon web services for developersIntroduction to amazon web services for developers
Introduction to amazon web services for developers
 
Your 1st Apple watch Application
Your 1st Apple watch ApplicationYour 1st Apple watch Application
Your 1st Apple watch Application
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Back to the future: ux trends 2015
Back to the future: ux trends 2015Back to the future: ux trends 2015
Back to the future: ux trends 2015
 
Developing high load systems using C++
Developing high load systems using C++Developing high load systems using C++
Developing high load systems using C++
 
Collection view layout
Collection view layoutCollection view layout
Collection view layout
 
Introduction to auto layout
Introduction to auto layoutIntroduction to auto layout
Introduction to auto layout
 
Groovy on Android
Groovy on AndroidGroovy on Android
Groovy on Android
 
Unit Testing: Special Cases
Unit Testing: Special CasesUnit Testing: Special Cases
Unit Testing: Special Cases
 
Material design
Material designMaterial design
Material design
 
Kanban development
Kanban developmentKanban development
Kanban development
 
Mobile sketching
Mobile sketching Mobile sketching
Mobile sketching
 
More UX in our life
More UX in our lifeMore UX in our life
More UX in our life
 
Model-View-Controller: Tips&Tricks
Model-View-Controller: Tips&TricksModel-View-Controller: Tips&Tricks
Model-View-Controller: Tips&Tricks
 
Unit Tesing in iOS
Unit Tesing in iOSUnit Tesing in iOS
Unit Tesing in iOS
 
Future of Outsourcing report published in The Times featuring Ciklum's CEO To...
Future of Outsourcing report published in The Times featuring Ciklum's CEO To...Future of Outsourcing report published in The Times featuring Ciklum's CEO To...
Future of Outsourcing report published in The Times featuring Ciklum's CEO To...
 
Михаил Попчук "Cкрытые резервы команд или 1+1=3"
Михаил Попчук "Cкрытые резервы команд или 1+1=3"Михаил Попчук "Cкрытые резервы команд или 1+1=3"
Михаил Попчук "Cкрытые резервы команд или 1+1=3"
 

Dernier

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 

Dernier (20)

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 

CiklumCPPSat: Alexey Podoba "Automatic assembly. Cmake"

  • 1. Auto Build System Alexey Podoba Senior C++ Developer at Ciklum
  • 2. Auto Build System • Preview • CMake • CTest • CDash • CPack
  • 3. Auto Build System • CMake • qmake • Scons • Jam, FTJam, Kjam, BJa • Waf m • Fbuild • Makepp • A-A-P • Rake • Maven • Rant • Ant • Phing • NAnt • Makeit • GNU Autotools • Etc
  • 4. What to choose? • Type • Simplicity • Flexibility • Speed • Cross platform • Parallel build • …
  • 5. Type Builder Generators • Scons • Generators • Waf • GNU Autotools • Jam • QMake • Ant • NAnt • RAnt • Rake
  • 6. Simply && Flexibility • Own syntax • XML • CMake • Maven • GNU Autotools • Ant • qmake • NAnt • Jam, FTJam, Kjam, BJam • Perl • Python • Makepp • Scons • Ruby • Waf • Rake • Fbuild • Rant • A-A-P
  • 7. Linux && Speed BUILD SYSTEM FULL BUILD INCREMENTAL INCREMENTAL LIB GNU Make 2m 21s 0m 2.4s 0m 0.0s Jam 2m 42s 0m 1.6s 0m 0.1s BoostBuild v2 3m 28s 0m 46s 0m 1.6s Scons 5m 08s 1m 06s 0m 10.4s Ant 2m 8s 0m 21s 0m 1.7s Rant 2m 32s 0m 10s 0m 4.9s
  • 8. Windows && Speed BUILD SYSTEM FULL BUILD INCREMENTAL INCREMENTAL LIB Microsoft Visual Studio 2003 7m 28s 0m 54s 0m 4s Microsoft Visual Studio 2003 + FastSolutionBuild 7m 26s 0m 1s 0m 1s Microsoft Visual Studio 2005 6m 46s 0m 20s 0m 3.5s VCBuild 6m 56s 0m 18s 0m 0.5s Jam 6m 52s 0m 3.1s 0m 0.3s BoostBuild v2 12m 03s 0m 55s 0m 2s Scons 7m 52s 0m 57s 0m 7s Ant 3m 42s 0m 33s 0m 1.9s Nant 3m 24s 0m 35s 0m 1.4s Rant 5m 47s 0m 25s 0m 14s
  • 9. CMake vs Autotools Task CMake Autotools Automake 00:41 Configure 0:08 Configure 00:20 Make 12:15 21:16 Install 0:20 0:36 Total 12:43 22:43
  • 10. Auto Build System • CMake • qmake • Scons • Waf • Jam, FTJam, Kjam, BJa m • Ant • NAnt
  • 12. Why CMake? • Process • Fast • Easy to implement • Easy to use • Easy to use across platform • Easy to have multi configuration • Easy to have clean code • Easy to convert any project to CMake • Everyone Uses It • Etc
  • 13. Process ... Release Implementation … Testing
  • 14. Process … CPack CMake … CDash/CTest
  • 15. Fast • Implement on C++ • http://blog.qgis.org/?q=node/16 “I was quite surprised with the speed of building Quantum GIS codebase in comparison to Autotools” Task CMake Autotools Automake 00:41 Configure 0:08 Configure 00:20 Make 12:15 21:16 Install 0:20 0:36 Total 12:43 22:43
  • 16. Easy to implement CMakeLists.txt cmake_minimum_required (VERSION 2.8) project (HELLO) add_executable (hello main.cpp)
  • 17. Easy to use • Just call “cmake ./” in project directory with CMakeLists.txt • And than “make” • Or
  • 19. Easy use across platform • One simple language for all platforms • Windows • Linux • Unix • Mac • High-performance computing • Embeded • Etc
  • 20. Easy use across platform • Borland Makefiles • Visual Studio 6-10 • MSYS Makefiles • Watcom WMake • MinGW Makefiles • CodeBlocks • NMake Makefiles • Eclipse CDT4 • NMake Makefiles JOM • KDevelop3 • Unix Makefiles • XCode Sample: cmake –G”CodeBlocks”
  • 21. Easy to use multi configuration • Build Configuration • Debug • Release • RelWithDebInfo • MinSizeRel • etc • CMake build parameteres -DVERSION=1.1.1 • CMake build init file with sated variables cmake -Cinitfile.cmake
  • 22. CMake Init File set (CPACK_PACKAGE_VERSION_MAJOR 5) set (CPACK_PACKAGE_VERSION_MINOR 7) set (CPACK_PACKAGE_VERSION_PATCH 1) set (CPACK_RESOURCE_FILE_LICENSE Copyright.txt") set (CPACK_RESOURCE_FILE_README "Description.txt") set (CPACK_RESOURCE_FILE_WELCOME "Welcome.txt")
  • 23. Easy to have clean code • Out-of-source build trees leave source clean Just call cmake command with parameter –B“../build” Sample: cmake “./src” –B”build” –G”NMake Makefiles” –demover.cmake -DEXECUTABLE_OUTPUT_PATH /tmp/bin_result
  • 24. Easy to convert • am2cmake http://websvn.kde.org/trunk/KDE/kdesdk/cmake/scripts/am2 cmake?view=markup • qmake converter http://www.vtk.org/Wiki/CMake:ConvertFromQmake • vcproj2cmake.rb http://sourceforge.net/projects/vcproj2cmake/files/ • folders4cmake http://sourceforge.net/projects/folders4cmake/ • etc
  • 25. Everyone Uses It • Avidemux Registration Toolkit • PvPGN • Bullet Physics • KDE • Quantum GIS Library • Choqok • qutIM • Chicken • Kicad • ReactOS • Clementine • LeechCraft • Scribus • Cuneiform • LLVM • Slicer • DevIL • LMMS • Stellarium • Drishti • MuseScore • Supertux • EiskaltDC++ • MySQL • The Visualization • FreeCAD • OGRE Toolkit • GDCM • OpenSceneGraph • OpenCV • IGSTK • ParaView • Boost • Insight • PCSX2 Segmentation and • Pichi
  • 26. What is CMake? • CMakeLists.txt • *.cmake
  • 27. CMake • Built-in rules for common targets • Executable • Shared Libraries/ DLLs • Static libraries ( archives) • OS X Frameworks and App Bundles add_executable(<name> [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] source1 source2 ... sourceN) add_library(<name> [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] source1 source2 ... sourceN)
  • 28. CMake • Custom targets • Generated Documentation • Generated sources and headers add_custom_target (Docs ALL COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile SOURCES ${PROJECT_BINARY_DIR}/Doxyfile) add_custom_target ( generateheader ALL DEPENDS results/header.h COMMAND blablabla )
  • 29. CMake Features • Custom command add_custom_command( OUTPUT Foo.trx COMMAND perl ${SOURCE_DIR}/combine.pl ${trofiles} -o Foo.trx DEPENDS ${trofiles} ) add_custom_target(do_trofiles DEPENDS Foo.trx) add_custom_command( TARGET target PRE_BUILD | PRE_LINK | POST_BUILD COMMAND command [ARGS [args...]] [COMMENT comment])
  • 30. CMake • include_directories ([AFTER|BEFORE] [SYSTEM] dir1 dir2 ...) • link_directories(directory1 directory2 ...) • target_link_libraries (<target> [lib1 [lib2 [...]]] [[debug|optimized|general] <lib>] ...) • add_dependencies(target-name depend-target1 depend-target2 ...)
  • 31. CMake • foreach foreach (val ${FILES}) ... endforeach() • if else if (MSVC) add_definitions (/W3) elseif (CMAKE_COMPILER_IS_GNUCXX) add_definitions (-Wall -pedantic) else () message ("Unknown compiler") endif ()
  • 32. CMake Macros • Macros macro(MyMacro ${var}) … endmacro() • Functions function(myfunc ${var}) …. endfunction(myfunc)
  • 33. Macro macro(list_header_directory _PATH _HEADERS) include_directories("${_PATH}") file (GLOB headers "${_PATH}/*.h") if( NOT "${ARGV2}" STREQUAL "") SOURCE_GROUP(${ARGV2} FILES ${headers}) endif( NOT "${ARGV2}" STREQUAL "") set(${_HEADERS} ${headers}) endmacro()
  • 34. External library & package • find_library • find_package • set (BOOST_ROOT "${EXTERNAL_PATH}/boost_1_47") FIND_PACKAGE(Boost COMPONENTS system REQUIRED)
  • 35. Find package • FindMPI • FindALSA • FindSubversion • FindwxWidgets • FindProtobuf • FindCoin3D • FindLATEX • FindFreeType • FindSWIG • FindImageMagick • FindGDAL • FindJNI • FindBLAS • FindGIFLIB • FindJava • FindLAPACK • FindLua50 • FindOpenSSL • FindBoost • FindLua51 • FindDCMTK • FindGTK2 • FindOpenAL • FindQt4 • FindCxxTest • FindOpenThreads • FindRTI • FindDoxygen • FindPhysFS • FindHDF5 • FindGnuTLS • FindProducer • FindZLIB • FindFLEX • FindQuickTime • FindCUDA • FindBISON • FindSDL • FindArmadillo • FindGTest • FindosgDB Framework) • FindosgFX • FindBullet • FindosgViewer
  • 36. CMake & Boost set (BOOST_COMPONENTS thread filesystem) set (Boost_USE_STATIC_LIBS ON) set (Boost_USE_MULTITHREADED ON) find_package (Boost COMPONENTS ${BOOST_COMPONENTS} REQUIRED) include_directories(${Boost_INCLUDE_DIRS}) … target_link_libraries (${PROJECT} ${Boost_LIBRARIES})
  • 37. CMake & Qt find_package (Qt4 REQUIRED) include (${QT_USE_FILE}) ... target_link_libraries (${PROJECT} ${QT_LIBRARIES})
  • 38. CMake & Subversion FIND_PACKAGE(Subversion) IF(Subversion_FOUND) Subversion_WC_INFO(${CMAKE_HOME_DIRECTORY} Project) MESSAGE("Current revision is ${Project_WC_REVISION}") ENDIF(Subversion_FOUND)
  • 39. CMake & CppCheck FIND_PACKAGE(cppcheck) add_library (MyTarget source.cpp) add_to_cppcheck(MyTarget PRE_BUILD FAILED ) add_to_cppcheck( TARGET target PRE_BUILD | PRE_LINK | POST_BUILD | TEST [FAILED | WARNING ] )
  • 40. CMake Scripts • cmake -E command • Copy file • Remove file • Compare and conditionally copy • time • etc • cmake -P script.cmake
  • 43. ./demo/CMakeLists.txt include_directories (../Hello) add_executable (helloDemo demo.cpp) target_link_libraries (helloDemo Hello) ADD_DEPENDENCIES(helloDemo Hello)
  • 44. ./CMakeLists.txt cmake_minimum_required (VERSION 2.6) project (HELLO) if(WIN32) add_definitions (-DUNICODE -D_UNICODE) set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /MTd /Zi /Od ") set(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG") set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MTd /Zi /Od /MP) set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG /MP") else(WIN32) set(CMAKE_CXX_FLAGS_DEBUG "-g3 -pipe -O0 -DDEBUG -g") set(CMAKE_CXX_FLAGS_RELEASE "-g0 -pipe -O2 -finline-functions - DNDEBUG -s") endif(WIN32) add_subdirectory (Hello Demo)
  • 45. CTest
  • 46. CTest enable_testing () ADD_TEST (TestIdentifier ExecutableName [AnyArgsForTest]) How to run it CTest make test RUN_TESTS In IDE or add_custom()
  • 47. CTest & Boost Test set (TESTS_SOURCES ../tests/test.cpp) find_package (Boost COMPONENTS unit_test_framework REQUIRED) include_directories(${Boost_INCLUDE_DIRS}) set (TEST boost.${PROJECT} ) add_executable (${TEST} ${TESTS_SOURCES}) target_link_libraries (${TEST} ${PROJECT} ${Boost_LIBRARIES}) enable_testing () add_test (${TEST} ${TEST})
  • 48. CTest & GTest set (TESTS_SOURCES ../tests/test.cpp) find_package (GTest REQUIRED) include_directories(${GTest_INCLUDE_DIRS}) set (TEST gtest. ${PROJECT} ) add_executable (${TEST} ${TESTS_SOURCES}) target_link_libraries (${TEST} ${PROJECT} ${Gtest_BOTH_LIBRARIES}) enable_testing () add_test (${TEST} ${TEST})
  • 50. CTest set (PROJECT_NAME "MyProject") set (CTEST_DROP_METHOD "http") set (CTEST_DROP_SITE "my.cdash.org") set (CTEST_DROP_LOCATION "/submit.php?project=VALG1") set (CTEST_DROP_SITE_CDASH TRUE) set (CTEST_SITE "MyPCName") set (CTEST_BUILD_NAME "Windows") set (CTEST_SOURCE_DIRECTORY "${ROOT_DIRECTORY }/src") set (CTEST_BINARY_DIRECTORY ${ROOT_DIRECTORY}/build") set (CTEST_BUILD_CONFIGURATION Debug)
  • 51. CTest Memory checker SET (PURIFYCOMMAND:FILEPATH ${PATH}/purify.exe) SET (MEMORYCHECK_COMMAND:FILEPATH ${PATH}/valgrind ) Test coverage SET (CTEST_COVERAGE_COMMAND “tools/gcov")
  • 52. CTest ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY}) ctest_start (Experimental) ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}") ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}") ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}") ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}") ctest_coverage (BUILD "${CTEST_BINARY_DIRECTORY}") ctest_memcheck (BUILD "${CTEST_BINARY_DIRECTORY}") ctest_submit()
  • 53. CDash
  • 54. CDash
  • 55. CDash
  • 56. CDash
  • 57. CDash
  • 58. CDash
  • 59. CPack
  • 60. CPack • TGZ • TZ • STGZ • ZIP • TBZ2 • NSIS • DragNDrop (OSX only) • CygwinBinary (Cygwin only) • PackageMaker (OSX only) • CygwinSource (Cygwin only) • OSXX11 (OSX only) • DEB (UNIX only) • Bundle (OSX only) • RPM (Unix Only)
  • 61. CPack • Setting variables set (CPACK_PACKAGE_VERSION_MAJOR 5) set (CPACK_PACKAGE_VERSION_MINOR 7) set (CPACK_PACKAGE_VERSION_PATCH 1) set (CPACK_RESOURCE_FILE_LICENSE Copyright.txt") set (CPACK_RESOURCE_FILE_README "Description.txt") set (CPACK_RESOURCE_FILE_WELCOME "Welcome.txt") • Choose generator set(CPACK_GENERATOR TGZ) set(CPACK_GENERATOR NSIS) • Include CPack include(CPack)
  • 62. CPack • Define taragets INSTALL(TARGETS ${APPLICATION} DESTINATION bin) INSTALL(FILES ${APPLICATION} DESTINATION bin)
  • 63. CPack • make install • make package • make package_source
  • 66. Question? Alexey Podoba Senior C++ Developer at Ciklum