Top "Cmake" questions

CMake is a cross-platform, open-source build system generator.

What is the idiomatic way in CMAKE to add the -fPIC compiler option?

I've come across at least 3 ways to do this and I'm wondering which is the idiomatic way. This needs to …

c++ c cmake
Compiling a static executable with CMake

for a project I need to create an executable that includes all the libraries that I used (opencv, cgal) in …

c++ opencv compilation cmake cgal
Cmake link library target link error

Hi I have problem with linkg Glfw and other libraries using cmake. From command line i compile like this g++ …

c++ opengl cmake glut glew
Using CMake, how do I get verbose output from CTest?

I'm using CMake to build my project. I have added a unit test binary which is using the Boost unit …

cmake ctest
In CLion, header only library: file "does not belong to any project target, code insight features might not work properly"

I have a header-only library project set up with the cmake command: add_library(my_library INTERFACE) and I also …

c++ cmake clion header-only
Listing include_directories in CMake

I have a cmake build in which I'm searching for a bunch of dependencies, i.e. I have many instances …

cmake
How can I build a C++ project with multiple interdependent subdirectories?

I have a C++ project where I've used directories as more of an organizational element -- the way one might …

c++ cmake
How to compile GLUT + OpenGL project with CMake and Kdevelop in linux?

As the titles says I can't seem to build the project with OpenGL and Glut. I get Undefined reference errors …

linux opengl cmake
What is the proper way to use `pkg-config` from `cmake`?

Looking around on the net I have seen a lot of code like this: include(FindPkgConfig) pkg_search_module(SDL2 …

cmake pkg-config
Handling header files dependencies with cmake

I am using CMake on a small C++ project and so far it works great... with one twist :x When …

c++ dependencies cmake header-files