cmake

Linking different libraries for Debug and Release builds in Cmake on windows?

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 ...

Conditional CXX_FLAGS using cmake based on compiler?

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...

CMake + find package or check out and install

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...

CMake not using appropriate output command line argument for compiler.

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...

Implicit rules for CMake.

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? ...

CMake and including other makefiles

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? ...

cmake invalid numeric argument '/Wextra'

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...

cmake creating visual studio solution on the command line

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...

Easiest way to test for existence of cuda-capable GPU from cmake?

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...

QtCreator 1.3, Qt 4.6.2 and build problem with cmake on windows

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...

cmake unit test issue

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...

cmake: Working with multiple output configurations

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...

CMake compile C++ file in custom command.

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...

How to get cmake's PKG_CHECK_MODULES to find my cairo library in Windows

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. ...

CMake adding libraries for Windows/Linux

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 ...

cmake add_custom_command

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 warning level in CMake?

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. ...

Licensing: What is the license for LibFindMacros.cmake

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. ...

What server infrastructure to use for desktop software development?

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...

Linking C and CXX files in CMake

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...