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

21896 questions
8
votes
2 answers

Can I make cmake always generate debugging symbols?

I want cmake to generate symbols in my Release builds. I know I can generate RelWithDebInfo builds, and get symbols in those, but I want symbols in the Release builds as well. I never want a build that doesn't have symbols. Can I do this?
Tom Seddon
  • 2,336
  • 15
  • 24
8
votes
3 answers

CMAKE RPATH not working - could not find shared object file

I am trying to get rid of setting LD_LIBRARY_PATH everytime time I run my program. After adding in the library and targeting my executable to the library, when I run it tells me it can not open shared object library, no such file or directory. In…
TheBlueMan
  • 267
  • 1
  • 3
  • 20
8
votes
1 answer

C++ using GCOV/LCOV in a CMake project

I'm working in a C++ Project with a structure similiar to the following: --- /src |--comms |--utils |--interfaces … CMakeList.txt --- /test |---test1/ |--main.cpp …
Jupiter
  • 81
  • 1
  • 4
8
votes
1 answer

Change default CMakeLists.txt in CLion to include warnings

In CLion the default CMakeLists.txt sets the C++11 compiler flag only. I'd like to have warnings and the pedantic flag by default in all my projects. This is by default set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") and I'd like to have this…
ipa
  • 1,356
  • 1
  • 15
  • 33
8
votes
1 answer

Cannot export cmake PROJECT_VERSION_MAJOR because it equals zero

I'm having trouble with exporting cmake PROJECT_VERSION_MAJOR variable to the config.h file. In my main CMakeLists.txt I'm setting this variable according to the cmake documentation by invoking project() in main CMakeLists.txt…
Lazureus
  • 422
  • 3
  • 18
8
votes
2 answers

C++ duplicate symbols

(Mac) I've tried namespaces, include guards, pragma once, etc. Basically, this is the structure: CMakeLists.txt add_executable(Game Game/main.cpp Game/rtexture.cpp) Game/main.cpp #include…
hyperum
  • 1,082
  • 12
  • 31
8
votes
1 answer

Specify Crypto++ library in a CMakeLists file

I am trying to specify the Crypto++ library in my CMakeLists file but I always get an error. Here is my CMakeLists file: cmake_minimum_required(VERSION 2.8) project( Recognition ) find_package( OpenCV REQUIRED ) find_package ( CURL REQUIRED…
Omar Lahlou
  • 980
  • 8
  • 29
8
votes
2 answers

How to get debug postfix in executable name

I am using cmake 2.8.12.2. I have set CMAKE_DEBUG_POSTFIX, and it is automatically used with the add_library command. But it is not automatically used with add_executable command. I have discovered that I can set the DEBUG_POSTFIX target property to…
Phil
  • 4,762
  • 1
  • 27
  • 53
8
votes
3 answers

Ninja equivalent of Make's "build from this directory down" feature (with CMake)?

When building a project using CMake and Make, you can execute make from a subdirectory of your build tree (i.e. from a directory below whatever directory contains your top-level Makefile), and make will (as far as I can tell) build all targets at or…
Kyle Strand
  • 14,120
  • 3
  • 59
  • 143
8
votes
4 answers

CMake could not find the VTKConfig.cmake

I'm trying to compile a program in CMake but I'm getting this error. By not providing "FindVTK.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "VTK", but CMake did not find one. Could not…
MicrobicTiger
  • 415
  • 2
  • 5
  • 18
8
votes
1 answer

R package with Rcpp and CMake (Windows)

I'm using CMake as a build tool to create C++ shared library with Rcpp. To trigger CMake while invoking R CMD INSTALL command the top configure script need to look something like this: rm -rf _builds cmake -H. -B_builds cmake --build…
user2288008
8
votes
2 answers

cmake check if Mac OS X, use APPLE or ${APPLE}

I would like check whether I am in Mac OS X or not, and have the following code cmake_minimum_required (VERSION 3.0) project (test) set (FOO 1) if (${FOO} AND ${APPLE}) message ("MAC OS X") endif () It failed on non-OSX system with error…
Ying Xiong
  • 3,712
  • 5
  • 26
  • 59
8
votes
2 answers

Set cmake target name for debug and release configuration

I am trying to differentiate between a debug and release build. If a debug build is in progress I want to install myLibd in /usr/local/lib. If a release build is in progress I want to install myLib in /usr/local/lib. Here is my…
Anonymous
  • 4,144
  • 7
  • 41
  • 57
8
votes
2 answers

CMake Error at CMakeLists.txt CMAKE_PREFIX_PATH

I have downloaded the source code of the face-analysis SDK from http://face.ci2cv.net/. Now I am trying to get it running. I downloaded all the necessary software and followed the installation instructions. When I try to execute cmake [options] .. I…
bxxxi
  • 143
  • 1
  • 1
  • 7
8
votes
2 answers

cmake doesn't work in windows XP

I'm new with cmake,just installed it and following this article: http://www.cs.swarthmore.edu/~adanner/tips/cmake.php D:\Works\c\cmake\build>cmake .. -- Building for: NMake Makefiles CMake Warning at CMakeLists.txt:2 (project): To use the NMake…
Gtker
  • 2,119
  • 7
  • 28
  • 34
1 2 3
99
100