Skip to main content
660 votes
28 answers
899k 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
605 votes
6 answers
861k views

In a GCC compiled project, How do I run CMake for each build configuration type (debug/release)? How do I specify debug and release C/C++ flags using CMake? How do I express that the main executable ...
Cartesius00's user avatar
  • 24.6k
556 votes
3 answers
322k 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,055
477 votes
10 answers
298k views

I do cmake . && make all install. This works, but installs to /usr/local. I need to install to a different prefix (for example, to /usr). What is the cmake and make command line to install ...
Andrei's user avatar
  • 9,014
450 votes
6 answers
477k views

How do I define a preprocessor variable through CMake? The equivalent code would be #define foo.
Mythli's user avatar
  • 6,435
446 votes
12 answers
1.1m views

About a year ago I asked about header dependencies in CMake. I realized recently that the issue seemed to be that CMake considered those header files to be external to the project. At least, when ...
Matthieu M.'s user avatar
433 votes
17 answers
601k 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,824
378 votes
8 answers
276k views

I use CMake with GNU Make and would like to see all commands exactly (for example how the compiler is executed, all the flags etc.). GNU make has --debug, but it does not seem to be that helpful are ...
Nils's user avatar
  • 13.8k
353 votes
12 answers
423k 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
328 votes
8 answers
250k views

I'm wondering if there is a way to print out all accessible variables in CMake. I'm not interested in the CMake variables - as in the --help-variables option. I'm talking about my variables that I ...
Michael's user avatar
  • 3,914
315 votes
8 answers
864k 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
303 votes
3 answers
365k views

I'm asking this as a reminder to myself the next time I use CMake. It never sticks, and Google results aren't great. What's the syntax to set and use variables in CMake?
CivFan's user avatar
  • 15.5k
298 votes
7 answers
124k views

What are the differences between Autotools, Cmake and Scons?
Wazery's user avatar
  • 16.1k
287 votes
10 answers
362k views

I'm currently constructing a project with a plugin structure. I'm using CMake to compile the project. The plugins are compiled in separate directories. My problem is that CMake compiles and saves the ...
Martin Kristiansen's user avatar
273 votes
20 answers
520k 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,311

15 30 50 per page
1
2 3 4 5
1957