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
3 answers

Building project involving cmake, how do I make it aware of libraries

When I try to build this project with cmake and gcc on a 64-bit linux (debian) machine, I get an error from the linker: Linking C executable ../../../../cpsadamsx /home/dala/lib64/libSimTKcommon.so: undefined reference to…
dala
  • 1,975
  • 3
  • 14
  • 15
11
votes
2 answers

C++/CLI and CMake

I am trying to set up a C++/CLI project using cmake. I have had success doing this with visual studio 2010, but I am now working with a legacy solution that requires visual studio 2008. In visual studio 2010, it is enough to set up my cmake like…
Max Ehrlich
  • 2,479
  • 1
  • 32
  • 44
11
votes
1 answer

Efficiently Using SublimeText with SublimeClang for CMake/C++ Projects

I have been trying to play with SublimeText2 for some time now. While it is very easy to work with Python in it almost out of the box, working with C++ is a bit more tricky. I can manage to set up a CMake build script by copying and modifying the…
Subhamoy S.
  • 6,566
  • 10
  • 37
  • 53
11
votes
2 answers

Building LLVM example

I'm trying to build one of examples from standard distribution, namely BrainF and haven't succeed. I made my copy of examples/BrainF and trying to run cmake from this dir. Initially CMakeLists.txt looked like this: set(LLVM_LINK_COMPONENTS jit…
Artem Pelenitsyn
  • 2,508
  • 22
  • 38
11
votes
1 answer

CMake file(INSTALL files DESTINATION dir) with symbolic links

I am using FILE(INSTALL files) but some of the files are symbolic links. Can I tell CMake to dereference the symbolic link instead of creating a symbolic link on destination?
André Puel
  • 8,741
  • 9
  • 52
  • 83
11
votes
2 answers

Several projects in one solution with cmake and visual studio

I have a Visual Studio 2010 solution with 5 projects in it, two libraries and three applications (that depend on the libraries). I would now like to migrate the build system to CMake (to also be able to compile under Linux). I've already found out…
Ela782
  • 5,041
  • 5
  • 53
  • 66
11
votes
1 answer

Force CMake to use C++ compiler for C files with Visual Studio

I have generated .h and .c files which must be compiled as C++ files with Visual Studio. I heard I could do something like set_source_files_properties( ${SOURCES} PROPERTIES LANGUAGE "CXX" ). In parallel, I have read that I should not do that as it…
Korchkidu
  • 4,908
  • 8
  • 49
  • 69
10
votes
3 answers

qtcreator can only build all not each single targets for cmake projects

I use cmake to generate qtcreator's project files, For the run part I can have different targets, but the build parts, I can only select all, and could not build each targets separately. Is there anyway I can build only one targets with qtcreator's…
emailhy
  • 780
  • 9
  • 22
10
votes
5 answers

cmake "make install" to remote machine?

With make install I can copy my binaries, configs etcetera to a target folder for execution. Now I have the following situation: we have a virtual machine setup as a build host, and a different real Linux machine as a target platform. I would like…
Danoo
  • 111
  • 1
  • 5
10
votes
2 answers

CMake and Visual Studio resource files

I am converting a C++ project created using Visual Studio 2005 to CMake and have stumbled upon a bit of a problem with resource files that are included in the project. The project includes a .rc file, a bunch of .ico files and a .rc2 file. The…
villintehaspam
  • 8,540
  • 6
  • 45
  • 76
10
votes
1 answer

Cmake to add VS2010 Project custom Build Events

Is there a way I can set CMake to generate a VS2010 Project file that has Pre Build or Post Build event in them? Thanks.
Darshan R
  • 125
  • 2
  • 6
10
votes
3 answers

How to make Boost DLLs accessible to an executable built with CMake?

I'm using CMake on Windows to build test suite based on Boost.Test. As I'm linking to Boost.Test dynamically, my executable needs to be able to find the DLL (which is under ../../../boost/boost_1_47/lib or something like that relative to the…
Alex Korban
  • 14,916
  • 5
  • 44
  • 55
10
votes
7 answers

CMake error while running flutter desktop application

When I am trying to launch flutter desktop application, this error occurred to me: "CMake Error at CMakeLists.txt:2 (project): Generator Visual Studio 16 2019 could not find any instance of Visual Studio. Building Windows application... Exception:…
M.Saif
  • 137
  • 1
  • 2
  • 6
10
votes
1 answer

Configure cmake to work with homebrew libraries instead system-provided libraries

I find myself going against the grain configuring cmake paths with ccmake over and over again as with every change of for ex. compiler some of my library paths get lost. In particular paths to (unlinked) lapack, lapacke, gsl get either lost or set…
Ranza
  • 294
  • 3
  • 10
10
votes
2 answers

Detect build type (debug/release) in visual studio when using CMake

I have a little game engine in which I need to define some custom macros when it is building in Debug or Release mode. Here are a few lines of my CMake script which is supposed to do that: if (CMAKE_BUILD_TYPE STREQUAL "Debug") …
OverShifted
  • 457
  • 1
  • 7
  • 17