cmake

CMake linking problem

I am trying to use CMake to compile a C++ application that uses the C library GStreamer. My main.cpp file looks like this: extern "C" { #include <gst/gst.h> #include <glib.h> } int main(int argc, char* argv[]) { GMainLoop *loop; GstElement *pipeline, *source, *demuxer, *decoder, *conv, *sink; GstBus *bus; /* Initialisation ...

How to Use CCache with CMake?

I would like to do the following: If CCache is present in PATH, use "ccache g++" for compilation, else use g++. I tried writing a small my-cmake script containing CC="ccache gcc" CXX="ccache g++" cmake $* but it does not seem to work (running make still does not use ccache; I checked this using CMAKE_VERBOSE_MAKEFILE on). Updat...

C++ Buildsystem with ability to compile dependencies beforehand

Hi, I'm in the middle of setting up an build environment for a c++ game project. Our main requirement is the ability to build not just our game code, but also its dependencies (Ogre3D, Cegui, boost, etc.). Furthermore we would like to be able build on Linux as well as on Windows as our development team consists of members using differen...

Converting a non-GUI Makefile (make) project to KDevelop

I have a rather simple C project I compile with make that I would like to run and debug in KDevelop, but I can't get this to work. I have installed cmake and tried both to import an existing project and start a new (which insists on creating a main.ccp file), but no matter what I do all the menu options to run the program are greyed out....

CMake: use a custom linker

Hi! I want to setup a custom toolchain with qmake. I've set the compiler but I don't know how to set the linker. This error is reported because cmake try to use the compiler to link: The C compiler "xgcc.exe" is not able to compile a simple test program. Here there is a snippet of my toolchain file # specify the cross compiler INCLUD...

CMake: how do you copy private frameworks into the application bundle under OS X?

We build several private frameworks that get copied into our application bundle during our Xcode build process. I'm moving the whole build process to CMake, and this is one area that I haven't been able to resolve. I have found one utility module: CMakeIngestOSXBundleLibraries.cmake but its a little unclear to me how this might be used...

CUDA : error C2491: 'log1p' : definition of dllimport function not allowed

I am tryint to integrate CUDA in an existing project, in which several libs (DLLs) are created. I started with a very simple kernel that computes a dot product : // dotProd_kernel.cu __global__ void dotProd( double* result, double* vec1, double* vec2) { int i = threadIdx.x; result[i] = vec1[i] * vec2[i]; } This kernel is called ...

How to define compiler flags at compile time using CMake?

add_definitions adds definition that is fixed at time when cmake (not make) is executed. How to define them when make (not cmake) is executed? The value of the definition will be an output of a custom command. ...

Strange error occured while using cmake

Does anyone knows what "The C compiler "cl" is not able to compile a simple test program." means? I am trying to compile Wt using CMake on MSVC 9. The OS is Windows XP. Here is the full log: Check for working C compiler: cl Check for working C compiler: cl -- broken CMake Error at I:/Program Files/CMake 2.8/share/cmake-2.8/Mo...

cmake dependency problem

Hi, I have 3 small dependent tools: main-tool/ tool1/ tool2/ * ----- main-tool ----- * | | tool1 ---------- > tool2 The main-tool depends on tool1 & tool2. The tool1 depends on tool2. The CMakeFiles look like that: main-tool/CMakeLists.txt SUBDIRS{"tool1"} SUBDIRS{"tool2...

Cmake complains about wrong number of arguments

SET_TARGET_PROPERTIES( wtdbo PROPERTIES VERSION ${VERSION_SERIES}.${VERSION_MAJOR}.${VERSION_MINOR} SOVERSION ${WTDBO_SOVERSION} DEBUG_POSTFIX "d" ) The error is: CMake Error at src/Wt/Dbo/CMakeLists.txt:18 (SET_TARGET_PROPERTIES): set_target_properties called with incorrect number of arguments If I remove it it conf...

CMake linking against shared library on windows: error about not finding .lib file.

I've got a library definition in CMake that builds a shared library out of a small set of files, and I've got it compiling just fine on both linux and windows. However, I've also got another library that links against the shared library and it works fine on linux, however, on windows I get a message along the lines or "error can't find ...

Build automation by using platform specific project files or by using project generators?

There are some build systems that are able to generate platform specific project files like Visual Studio sln,vcproj,vcxproj files or XCode xcodeproj projects under OS X. One of them is CMake but I found out that the support for this is quite limited, buggy and that is very hard to keep it updated with newer versions (like VS 2010). A...

CMake finds boost but nmake fails to link

...

Build the OpenCV 2.0 libraries from source using Visual Studio 2010 Beta and CMake

OpenCV 2.0a does not include pre-compiled OpenCV libraries for Visual Studio users. I am trying to build the libraries from source using Visual Studio 2010 Beta and CMake, but I am getting lot of errors. I even tried generating the libs from dlls using dumpbin but the linker errors are still persisting. Please guide me to generate the st...

CMake to build an ActiveX OCX?

Hi All, I've been playing with CMake today, and so far it has been working great. Our project consists of +100 Visual Studio 2003 projects; we want to move to VS2008 and eventually VS2010 and also to support makefile build system (and maybe also Eclipse CDT)... so defining our projects with a CMake configuration files and generating pro...

Organizing a CMake project so that sources can be easily browsed in Visual C++

(I'm new to CMake and I am not so familiar with Visual Studio.) I need to implement a relatively big library the solution/project files will be generated by CMake, and my problem is that I would like the organization of the files in VC GUI to reflect the directory structure on the disk. Basically, the library is split into different pa...

ccache and absolute path

I use cmake to create a makefiles. cmake creates gcc line containing absolute pathes. To speed up compilation I use ccache. Building same code from different locations (e.g. several developers compile the same code, each under its home directory) causes ccache cach miss. Googled it, but not found a good answer. ...

SWIG Python bindings for OpenCV 2.0 with MacPorts

Y'all, I've been at to for 3 days trying to get OpenCV Python binds happening, and I have (the full epic struggle is documented here) but despite turning the SWIG flag on in CMake after installing swig via macports, I'm not getting any SWIG action :( My cmake command looks like: cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFI...

Cross-platform make system supporting 32/64 bit targets on Windows and Linux

I'm looking for a make system, along the lines of CMake or Bakefile, that supports the generation of Visual Studio project files and makefiles (targetting Linux) dual targeting x86 and x64 (in the same project/make file). I've looked at CMake and Bakefile and they both appear to have limitations in this respect; they both appear to not ...