Questions tagged [cmake]

CMake is a cross-platform, open-source build system generator. It generates files for build systems like native makefiles, ninja-build and project files for several integrated development environments.

CMake is a cross-platform, open-source build system generator. It generates files for build systems like native makefiles, ninja-build and project files for several integrated development environments.

It is often used along with , and .

Official

Quick Start / Howtos

Wisdom of the Stack

Books

27471 questions
11
votes
1 answer

How can I get CMake to allow for "make clean"ing just one target?

I have a project using CMake to generate Makefiles, which then get built with (GNU) make. In my project, the CMakeLists.txt defines two targets - but only one of them gets built when makeing after Makefile generation (e.g. using the…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
11
votes
1 answer

how to change RPATH on OS X

I'm doing a simple installation from openkinect's website to use an xbox kinect. The problem is there is no OSX distribution and it is assumed homebrew will take care of the installation for you. On the final step of installation I came upon a…
Max
  • 2,072
  • 5
  • 26
  • 42
11
votes
1 answer

Specify CUDA compiler in CMake

I am trying to build a cuda project using clang-3.9 based on the following documentation. But I want to use cmake to build my project. I have already set CMAKE_CC_COMPILER and CMAKE_CXX_COMPILER to clang and clang++ respectively. But the problem is…
Johns Paul
  • 633
  • 6
  • 22
11
votes
1 answer

where does qtcreator with cmake store run and build settings, and how to set via script?

In my usage at least, I sometimes delete my CMake build folder and create a new one, or have multiple build folders (one per computer) but only one source folder (nfs mount). From what I can tell, QT Creator saves settings into CMakeLists.txt.user …
peter karasev
  • 2,578
  • 1
  • 28
  • 38
11
votes
2 answers

CMake or Waf for D project

We are looking for adequate build tool for a desktop GUI application to be written in D (using Qt toolkit), consisting of several native libraries, using 3rd party C-lib(s). It has to build on Linux (native development) and Mac as well on Windows.…
gour
  • 967
  • 9
  • 22
11
votes
2 answers

Detect Endianness with CMake

My library needs to read-in big-endian integers (4-bytes) and convert them to the endian order of the host for processing. While on *nix ntohl has worked a treat under Windows use of ntohl requires the use of Ws2_32.dll (Winsock). Such a dependency…
Freddie Witherden
  • 2,369
  • 1
  • 26
  • 41
11
votes
4 answers

How to solve qt5 (packages not found) cmake errors in mac?

I get these following errors during build of a file using CMake: CMake Warning at CMakeLists.txt:33 (FIND_PACKAGE): By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file…
D.vijay
  • 163
  • 1
  • 1
  • 9
11
votes
1 answer

CTest --build-and-test with --test-command option

I use Ctest to run a bunch of google tests that I have registered using add_test(). Currently, these tests do not take any arguments. However, I want to give them all arguments (common to all, specifically --gtest_output=xml) while running ctest. I…
nirvanaswap
  • 859
  • 2
  • 11
  • 21
11
votes
1 answer

A proper workflow for CMake + Qt translation system

I recently moved my Qt project form qmake to CMake build system and now I'm trying to set up a translation system. I tried to use qt5_create_translation macro (documented here) to update my *.ts files and generate *.qm files. By default the macro…
Sergey
  • 7,985
  • 4
  • 48
  • 80
11
votes
4 answers

Compiling PCL 1.7 on Ubuntu 16.04 , errors in CMake generated Makefile

I'm trying to get PCL 1.7 (The point cloud library, not the other pcl) working on Ubuntu 16.04. I eventually hope to use for C++ stuff, but right now I'm just trying to get the examples working. I'm using the default compilers that came with Ubuntu…
Brandon Powers
  • 111
  • 1
  • 1
  • 3
11
votes
7 answers

Project Properties don't open - "There are no property pages for the selection"

Visual Studio suddenly won't display Project Properties for multiple projects, in multiple solution files. I right-click on a project in the Solution Explorer, and get an error box reading: There are no property pages for the selection. I don't…
Ziv
  • 2,369
  • 3
  • 24
  • 40
11
votes
5 answers

Get full C++ compiler command line

In CMake, the flags for the C++ compiler can be influenced in various ways: setting CMAKE_CXX_FLAGS manually, using add_definitions(), forcing a certain C++ standard, and so forth. In order to compile a target in the same project with different…
Fabian Knorr
  • 3,134
  • 3
  • 20
  • 32
11
votes
2 answers

CMake, C++ and Jenkins/Continuous integration

I have a CMake sample project that I would like to build on Jenkins running on Ubuntu 15.10. I have installed: https://wiki.jenkins-ci.org/display/JENKINS/CMake+Plugin And created two build steps: Run CMake to generate makefiles Run make all from…
u123
  • 15,603
  • 58
  • 186
  • 303
11
votes
1 answer

CMake seemingly incorrect behavior of IN_LIST keyword

I am trying to use the new logic in CMake 3.3 that checks if a value is in a list cmake_minimum_required(VERSION 3.3) cmake_policy(SET CMP0057 NEW) set(l A B C) foreach( e ${l} ) if( ${e} IN_LIST "${l}" ) message( "element ${e} found in…
user1357687
  • 571
  • 1
  • 6
  • 9
11
votes
1 answer

cmake -g flag not generating 'DWARF with dSym file' debug information

I'm using cmake to generate a C++ Xcode project, but the debug information never gets generated. I have to manually select 'DWARF with dSym file' from the build setting every time I have generated the project with cmake. Using 'SET…
Arno Duvenhage
  • 1,910
  • 17
  • 36