Skip to main content
Filter by
Sorted by
Tagged with
658 votes
28 answers
892k views

Just as make clean deletes all the files that a makefile has produced, I would like to do the same with CMake. All too often I find myself manually going through directories removing files like ...
Bill Cheatham's user avatar
555 votes
3 answers
319k views

I code in C/C++ and use a (GNU) Makefile to compile the code. I can do the same with CMake and get a Makefile. However, what is the difference between using a Makefile and CMake to compile the code?
rish's user avatar
  • 6,045
449 votes
6 answers
473k views

How do I define a preprocessor variable through CMake? The equivalent code would be #define foo.
Mythli's user avatar
  • 6,425
431 votes
17 answers
599k views

When I try to run a CMake generated makefile to compile my program, I get the error that range based for loops are not supported in C++ 98 mode. I tried adding add_definitions(-std=c++0x) to my ...
Subhamoy S.'s user avatar
  • 6,804
353 votes
12 answers
420k views

I have a number of projects built using CMake and I'd like to be able to easily switch between using GCC or Clang/LLVM to compile them. I believe (please correct me if I'm mistaken!) that to use Clang ...
Rezzie's user avatar
  • 5,021
315 votes
8 answers
861k views

I am using the arm-linux-androideabi-g++ compiler. When I try to compile a simple "Hello, World!" program it compiles fine. When I test it by adding a simple exception handling in that code it works ...
solti's user avatar
  • 4,609
298 votes
7 answers
124k views

What are the differences between Autotools, Cmake and Scons?
Wazery's user avatar
  • 16.1k
273 votes
20 answers
517k views

I am trying to install a software that uses cmake to install itself. When I run cmake .. on the command line, it gives me following error in the CMakeLists.txt on the line that says find_package(...
Allan's user avatar
  • 3,291
265 votes
4 answers
263k views

I'm running RHEL 5.1 and use gcc. How I tell cmake to add -pthread to compilation and linking?
dimba's user avatar
  • 27.9k
249 votes
3 answers
116k views

What exactly was going on behind the scenes when for such a small CMakeLists.txt file, cmake_minimum_required (VERSION 2.6) project(Tutorial) add_executable(Tutorial tutorial.cpp) and such a small ...
Nav's user avatar
  • 20.8k
231 votes
2 answers
147k views

I've come across at least 3 ways to do this and I'm wondering which is the idiomatic way. This needs to be done almost universally to any static library. I'm surprised that the Makefile generator in ...
101010's user avatar
  • 15.9k
219 votes
4 answers
159k views

In CMake, I want to create a directory if it doesn't already exist. How can I do this?
Jookia's user avatar
  • 6,930
214 votes
5 answers
296k views

I am considering switching a cross platform project from separate build management systems in Visual C++, XCode and makefiles to CMake. One essential feature I need is to add automatically all files ...
martjno's user avatar
  • 4,779
197 votes
10 answers
263k views

I'm trying to create a simple project on CLion. It uses CMake to generate Makefiles to build project (or some sort of it) All I need to is transfer some non-project file (some sort of resource file) ...
mongolrgata's user avatar
  • 2,077
194 votes
1 answer
153k views

How can I get CMAKE to generate an error on a particular condition. That is, I want something like this: if( SOME_COND ) error( "You can't do that" ) endif()
edA-qa mort-ora-y's user avatar
193 votes
5 answers
120k views

Same source, all that, just want a static and shared version both. Easy to do?
gct's user avatar
  • 14.8k
186 votes
10 answers
235k views

I am a beginner to CMAKE. Below is a simple cmake file which works well in mingw environment windows. The problem is clearly with target_link_libraries() function of CMAKE where I am linking ...
Prasad's user avatar
  • 2,011
179 votes
8 answers
183k views

How to set the warning level for a project (not the whole solution) using CMake? Should work on Visual Studio and GCC. I found various options but most seem either not to work or are not consistent ...
Wernight's user avatar
  • 38k
176 votes
9 answers
249k views

I need to add Boost libraries into my CMakeLists.txt. How do you do it or how do you add it?
laksh's user avatar
  • 2,329
173 votes
13 answers
130k views

I'm using CMake to build my project. I have added a unit test binary which is using the Boost unit testing framework. This one binary contains all of the unit tests. I've added that binary to be run ...
Skrymsli's user avatar
  • 5,383
160 votes
5 answers
65k views

I am new to CMake and a bit confused with the PUBLIC, PRIVATE and INTERFACE keywords related to target_link_libraries(). Documentation mentions that they can be used to specify both the link ...
Sirish Kumar Bethala's user avatar
155 votes
3 answers
173k views

How should I structure my project, so that my CMake requires the least amount of maintainance in the future? For example, I don't want to update my CMakeList.txt when I am adding a new folder in my ...
Arne's user avatar
  • 8,571
154 votes
2 answers
56k views

What is the meaning of the keyword PUBLIC, PRIVATE, and INTERFACE related to CMake's target_include_directories?
Sirish Kumar Bethala's user avatar
149 votes
5 answers
383k views

I have a small project with a Makefile which I'm trying to convert to CMake, mostly just to get experience with CMake. For purposes of this example, the project contains a source file (C++, though I ...
David Z's user avatar
  • 133k
147 votes
31 answers
299k views

After installing Visual Studio 2015 and running CMake on a previous project, CMake errors stating that it could not find the C compiler. The C compiler identification is unknown The CXX compiler ...
Asher's user avatar
  • 2,971

1
2 3 4 5
588