CMake - Cross-Platform Make R. Douglas Barbieri Made to Order Software Corporation.

Slides:



Advertisements
Similar presentations
Lecture 3 Getting Started with ITK!. Goals for this lecture Learn how to use Cmake Build ITK Example programs that use ITK.
Advertisements

MC365 Ant. Today We Will Cover: Overview of Ant Installing Ant Using the Ant command line tool Various Ant commands available Using Ant in Eclipse.
Introduction to Java Lab CS110A – Lab Section 004 Instructor: Duo Wei.
ECLIPSE IDE N AME : A SHOK P ADMARAJU C OURSE : T OPICS ON S OFTWARE E NGINEERING I NSTRUCTOR : D R. S ERGIU D ASCALU.
Platforms and tools for Web Services and Mobile Applications Introduction to C# Bent Thomsen Aalborg University 3rd and 4th of June 2004.
Introduction to CCSv5. Outline  Intro to CCSv5 Intro to CCSv5  Functional Overview Functional Overview  Perspectives Perspectives  Projects Projects.
Lecture 8  make. Overview: Development process  Creation of source files (.c,.h,.cpp)  Compilation (e.g. *.c  *.o) and linking  Running and testing.
Building with MPC Charles Calkins Principal Software Engineer Object Computing, Inc.
Introduction to The Linaro Toolchain Embedded Processors Training Multicore Software Applications Literature Number: SPRPXXX 1.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
Software Process, CMake, Dashboards, CPack Bill Hoffman Kitware, Inc.
September 2008 IT Software Development Guide.
Trilinos User Group Meeting Thursday, November 8 th, 2007 Timothy M. Shead (1424) Danny Dunlavy (1415) SAND P Sandia is a multiprogram laboratory.
CS Tutorial 1 Getting Started with Visual Studio 2012 (Visual Studio 2010 are no longer available on MSDNAA, please choose Visual Studio 2012 which.
CSnake C++ build automation based on CMake and Python Maarten Nieber, 2009.
Makefiles. makefiles Problem: You are working on one part of a large programming project (e. g., MS Word).  It consists of hundreds of individual.cpp.
Developing C/C++ applications with the Eclipse CDT David Gallardo.
FairRoot Build and Test System
Installing CompuCell3D from source Maciej Swat Biocomplexity Institute, Indiana University.
NA-MIC National Alliance for Medical Image Computing Slicer Building and Deployment Steve Pieper, PhD.
System Programming - LAB 1 Programming Environments.
Productivity Tools Ken Nguyen Department of Information Technology Clayton State University.
AliRoot Implementation of native CMake build system A. Grigoras, P. Hristov 19/11/20141Alice - CMake.
CMake refactoring P. Hristov 19/03/2014. History I  Recursive makefiles (F.Carminati):  Problems in dependencies  Slow  "Recursive Makefiles.
Programming with Visual Studio 2005.NET A short review of the process.
N from what language did C++ originate? n what’s input, output device? n what’s main memory, memory location, memory address? n what’s a program, data?
Programming with Visual Studio.NET A short review of the process.
Presentation Name / 1 Visual C++ Builds and External Dependencies NAME.
Page 1 CMake Trilinos? Roscoe A. Bartlett Department of Optimization & Uncertainty Estimation Esteban J. Guillen Department.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
Open project in Microsoft Visual Studio → build program in “Release” mode.
® IBM Software Group © 2006 IBM Corporation Rational Asset Manager v7.2 Using Scripting Tutorial for using command line and scripting using Ant Tasks Carlos.
Build Tools 1. Building a program for a large project is usually managed by a build tool that controls the various steps involved. These steps may include:
Ravi Mathur January 8,  What does CMake NOT do? ◦ Doesn’t compile (gcc, MSVC, llvm, make) ◦ Doesn’t manage source code (XCode, Visual Studio) ◦
C Programming Lecture 3 : C Introduction 1 Lecture notes : courtesy of Woo Kyun and Chang Byung-Mo.
Getting Started with Oracle Berkeley DB 11gR2 and ADO.NET
Sung-Dong Kim Dept. of Computer Engineering, Hansung University Chapter 3 Programming Tools.
IPad: A Mobile Surgical Console Computer Integrated Surgery II, Spring, 2011 Hanlin Wan and Jonathan Satria Mentors: Balazs Vagvolgyi and Russell Taylor.
CMake: Experience in ALICE P. Hristov 19/06/12. History I Recursive makefiles (F.Carminati): – Problems in dependencies – Slow "Recursive Makefiles.
Patrick Gartung LArSoft Usability Meeting 22 June 2016 Build system explorations: Spack.
Programming C++ in Linux by various IDEs and editors by: Danial Khashabi Master: Dr.B.Taheri November 2008.
Software development tools
Tutorial 1 Writing Your First C++ Program CSC1110C Introduction to Computer Programming By Paul Pun Acknowledgement: Special thanks to Dr. Michael Fung.
Introduction to CMake, v. 2
Tutorial Six Linux Basics CompSci Semester Two 2016.
Build and Test system for FairRoot
Developing and Distributing Cross-Platform Software with PyInstaller
Computer Terms Review from what language did C++ originate?
Transitioning VisIt to CMake
Feedback on a first use of the ALFA and O2 software
Introduction to .NET Framework Ch2 – Deitel’s Book
CE-105 Spring 2007 Engr. Faisal ur Rehman
Getting started in Eclipse
CMPE 152: Compiler Design ANTLR 4 and C++
Nick Trogh Technical Evangelist, Microsoft.
Quick Start Guide for Visual Studio 2010
Nick Trogh Technical Evangelist, Microsoft.
.NET Debugging for the Production Environment
Cmake Primer.
עבודה עם Eclipse מבוא לתכנות מערכות מבוא לתכנות מערכות.
Using Visual Studio and VS Code for Embedded C/C++ Development
Chapter 1: An Overview of Computers and Programming Languages
CMPE 152: Compiler Design August 28/30 Lab
Setting up CDT Makefile project
Install MySQL Community Server and MySQL Workbench
Computer Terms Review from what language did C++ originate?
Preparation for Assignment 2
Carthage ios 8 onwards Dependency manager that streamlines the process of integrating the libraries into the project.
Overview of System Development for Windows CE.NET
Presentation transcript:

CMake - Cross-Platform Make R. Douglas Barbieri Made to Order Software Corporation

Introduction What is CMake? Control the software compilation process using simple platform-independent and compiler-independent configuration files Generate native makefiles and workspaces that can be used in the compiler environment of your choice Provides packaging (using CPack) and testing (using CTest)

Who is using it? Linden Lab (for their Second Life project) KDE4 Boost MySQL The Half-Life 2 SDK Rosegarden Loads of others (see for more details

Why CMake? Better than other build systems: Custom GNU/Makefiles autoconf/automake CodeBlocks other FOSS IDEs (sadly, not DevC++) Microsoft Visual Studio and other proprietary IDEs Apple XCode

Why CMake (con't) Can target multiple compilers, build systems and IDEs using a single set of configuration files Other build systems are difficult to set up and debug (particulary autoconf/automake) Has a simple to use language to allow customization for multiple platforms with relative ease. Great even for a single platform!

How Does it Work? CMake uses ”Generators” to create your target build files Uses configuration files to target your particular system Uses your custom config or existing rules to locate and build against third party libraries Provides a simple language to help customize for platform-specific idioms

Generators What are CMake Generators? They can produce make/project files for many different IDEs, GNU/Make and Microsoft's Nmake Customized for your specific platform Able to produce tailored project files specific to your favorite development IDE or system Lots are available!

Generators GNU/Linux: $ cmake The following generators are available on this platform: Unix Makefiles Generates standard UNIX makefiles. CodeBlocks - Unix Makefiles Generates CodeBlocks project files. Eclipse CDT4 - Unix Makefiles Generates Eclipse CDT 4.0 project files. KDevelop3 Generates KDevelop 3 project files. KDevelop3 - Unix Makefiles Generates KDevelop 3 project files. M$ Windows: C:\C:\ cmake Borland Makefiles Generates Borland makefiles. MSYS Makefiles Generates MSYS makefiles. MinGW Makefiles Generates a make file for use with mingw32-make. NMake Makefiles Generates NMake makefiles. Unix Makefiles Generates standard UNIX makefiles.

Generators (cont'd) Visual Studio 6 Generates Visual Studio 6 project files. Visual Studio 7 Generates Visual Studio.NET 2002 project files. Visual Studio 7.NET 2003 Generates Visual Studio.NET 2003 project files. Visual Studio Generates Visual Studio.NET 2005 project files. Visual Studio Win64 Generates Visual Studio.NET 2005 Win64 project files. Visual Studio Generates Visual Studio project files. Visual Studio Win64 Generates Visual Studio Win64 project files. Watcom WMake Generates Watcom WMake makefiles. CodeBlocks - MinGW Makefiles Generates CodeBlocks project files. CodeBlocks - Unix Makefiles Generates CodeBlocks project files. Eclipse CDT4 - MinGW Makefiles Generates Eclipse CDT 4.0 project files. Eclipse CDT4 - NMake Makefiles and etc.

Generators (cont'd) MacOS/X: $ cmake The following generators are available on this platform: Unix Makefiles Generates standard UNIX makefiles. Xcode Generate XCode project files. CodeBlocks - Unix Makefiles Generates CodeBlocks project files. Eclipse CDT4 - Unix Makefiles Generates Eclipse CDT 4.0 project files. KDevelop3 Generates KDevelop 3 project files. KDevelop3 - Unix Makefiles Generates KDevelop 3 project files.

Generators (cont'd) As you can see.... loads of GENERATORS!!!!

Configuration Script Syntax Here is a simple example (CMakeLists.txt): # The name of our project is "HELLO". CMakeLists files in this project can # refer to the root source directory of the project as ${HELLO_SOURCE_DIR} and # to the root binary directory of the project as ${HELLO_BINARY_DIR}. cmake_minimum_required (VERSION 2.6) project (HELLO) # Add executable called "helloDemo" that is built from the source files # "demo.cxx" and "demo_b.cxx". The extensions are automatically found. add_executable (helloDemo demo.cxx demo_b.cxx)

Syntax (cont'd) Add a library: add_subdirectory (Hello) # Make sure the compiler can find include files from our Hello library. include_directories (${HELLO_SOURCE_DIR}/Hello) # Make sure the linker can find the Hello library once it is built. link_directories (${HELLO_BINARY_DIR}/Hello) add_executable (helloDemo demo.cxx demo_b.cxx) # Link the executable to the Hello library. target_link_libraries (helloDemo Hello)

Library Syntax Library CMakeLists.txt: # Create a library called "Hello" which includes the source file "hello.cxx". # Any number of sources could be listed here. add_library (Hello hello.cxx)

Demo hello_world Demo Time!

Demo Tutorial Step 1 – simple example with a configure file (.in) Step 2 – with a user-configurable option Step 3 – add install target and tests Step 4 – using a macro Step 6 – add installer commands Step 7 – turn on dashboard scripting

Demo SLiteChat – an open-source text chat client for Second Life ( Second Life – the official 3D viewer for Second Life (

Q and A Ask me questions! And Thanks for coming to my talk!