So I've got a library I'm compiling and I need to link different third party things in depending on if it's the debug or release build (specifically the release or debug versions of those libraries). Is there an easy way to do this in Cmake?
Edit: I should note I'm using visual studio
...
I've just started using CMake for some personal and school projects, and I've been stumped by a minor issue.
Let's say I'm trying to get a C++ program compiling under multiple compilers (g++, cl, and bcc32 in this case). I have different command line switches for each compiler, and what I was attempting to do was to basically make a gnu...
Hello there!
I just switched to CMake. And yet found it very useful and realized some simple apps and libs.
Somewhere I read that it's possible to query git to checkout repositories from within cmake scripts.
I'd like to check for the existence of a package with my Find(package).cmake
If it doesn't exist i'd like to initiate a checkout...
Hello,
I'm working with CMake, and my program compiles fine with g++. However, I also wish to compiled it with bcc32 and cl.
I am running into an issue -- I'm telling cmake to use those compilers by doing a command line somewhat like "cmake -DCMAKE_CXX_COMPILER=cl" or whatnot, and it picks up the compiler correctly (ie, in that case, t...
I'm trying add some implicit rules in CMake that will generate direct dependencies (like .c files from Bison .y files). How is it possible to do that?
...
Lets say I have a CMakeLists.txt and I want to call another include another makefile in that file (similar to the #include syntax in C), how would I accomplish this?
...
Hello,
Windows XP Pro 32bit
Visual studio 2008 VC Express edition.
I have installed cmake and created the CMakeLists.txt and I want to cross-platform for Linux/windows.
Everything works ok for running on linux. So I copied my source directory as I am doing out of source building to my windows xp machine.
I used the cmake-GUI to conf...
Hello,
I am using cmake 2.6.4
WinXP Pro
Compiling on Visual studio 2008 VC Express edition
I can create the solution files by using the cmake-GUI. However, I don't want to use the cmake-GUI, as I always prefer the command line.
However, I am having a problem creating the solution file from the command line.
I am doing 'out of sour...
We have some nightly build machines that have the cuda libraries installed, but which do not have a cuda-capable GPU installed. These machines are capable of building cuda-enabled programs, but they are not capable of running these programs.
In our automated nightly build process, our cmake scripts use the cmake command
find_package(C...
Hi,
I'm trying to build a cmake project from QtCreator. When I open the project I need to give an argument to cmake otherwise Qt is not detected:
-DQT_QMAKE_EXECUTABLE=D:/Qt/4.6.2/bin/qmake.exe
The build step halts with this error:
Running build steps for project CollidingMice...
Starting: D:/Qt/2010.02/bin/jom.exe
"C:\Programmi\C...
Hello all,
I'm facing a problem where in I build a shared library and and a unit-test executable (which is in a sub directory)
I want to execute this test as a POST_BUILD operation for the shared library. So I gave
Add_Custom_Command (TARGET ShLibName POST_BUILD COMMAND unit_test_exe)
CMake throws an error message during generation pr...
I'm busy porting my build process from msbuild to cmake, to better be able to deal with the gcc toolchain (which generates much faster code for some of the numeric stuff I'm doing).
Now, I'd like cmake to generate several versions of the output, stuff like one version with sse2, another with x64, and so on. However, cmake seems to work...
Hello, I'm trying to precompile a header file in GCC with the following command:
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/all.hpp.gch
COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_FLAGS} -o ${CMAKE_BINARY_DIR}/all.hpp.gch ${CMAKE_CURRENT_SOURCE_DIR}/all.hpp
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/all.hpp
COMMENT "G...
I'm trying to build OpenSceneGraph's pdf plugin on a win32 box. The plugin is using cmake's PKG_CHECK_MODULES macro to find cairo and poppler libraries. I don't know how to install these in such a way as to help it find them though.
...
Visual Studio C++ 2008 / GCC 4.4.2
I have written a program to run on Linux and now I have to port my code to run on Windows. I have decided to use CMake as I want to keep the same build system for both platforms.
However, I need to link with some libraries for both platforms. In my CMakeLists.txt I have the following:
# Compile with ...
Hello all,
I'm struggling with add_custom_command. Let me explain the problem in detail.
I've these set of cxx files and hxx files. I run a perl script on each of them to generate a certain kind of translation file. The command looks like
perl trans.pl source.cxx -o source_cxx_tro
and similarly for header.hxx files as well.
So I'll...
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 with the documentation.
...
I was wondering if anyone knows the license for LibFindMacros.cmake linked to from http://www.vtk.org/Wiki/CMake:How_To_Find_Libraries. I can't find anywhere where it says it & it makes it so much easier when writing new find_package modules that aren't included with CMake.
...
I am in a startup company working on a new digital content creation desktop tool. We are now setting up an infrastructure for a small team of software developers in multiple locations.
We are looking into setting up a common server wich will store all code, and host version control (Subversion), built system, internal documentation, Bu...
Hi
I'm building C++ app with CMake. But it uses some source files in C. Here is simplified structure:
trunk/CMakeLists.txt:
project(myapp)
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -g -Wall")
add_subdirectory (src myapp)
trunk/src/main.cpp:
#include "smth/f.h"
int main() { f(); }
trunk/src/CMakeLists.txt:
add_subdirectory (smth)
lin...