cmake

CMake and C++/CLI, C#

Hello, I'd like to use CMake to compile code consisting of C++, C++/CLI and C# code. I know that there are some unofficial macros to support C# code. Has anyone used them? What is their quality? Are they dependable? Do they replicate VS9/MSBuild functionality? ...

have cmake change to the binary directory

Let's say I have a project where I've already run CMake in .build directory: project/ .build/ .src Presently I must do this to run the build: cd .build make I'd like to be able to run make from the root of my project, perhaps with make -f ./build/Makefile but it doesn't work. I get errors like this make[1]: CMakeFiles/...

Generate csharp project using CMake

I'm trying to generate c# project within an existing c++ CMake code base on Windows. After some search I could find just two projects that built their own csharp compilers for cmake: gdcm and kde. I tried both of them and unfortunately the first one failed to generate a c# project, instead it created vs c++ project with cs files in it....

Using boost.asio in cMake

I am relatively new to cMake, and I'm trying use the boost asio library in my project. I was able to get cMake to find other boost libraries such as smart_ptr and lexical_cast, but I get a linker error when I try to include boost/asio.hpp: LINK : fatal error LNK1104: cannot open file 'libboost_system-vc90-mt-1_40.lib'. I then tr...

How to add a command in CMake but not run it ?

The idea is to define a detached "examples" target in the CMakeLists.txt that would not get executed when running: make But that would build the examples when doing make examples ...

cmake & gcc compiles every file every time

Hi folks, I'm a learning c++ developer writing a game initially on the Mac platform using XCode, but now moving to cross platform by leveraging CMake. So far I can get it compiled on my ickle linux netbook and I'm putting together a dev environment on this machine for on the go coding. However I'm finding that gcc recompiles every file w...

Qt + VTK + Cmake

I'm running OSX 10.6 (Snow Leopard), Qt 4.6, VTK 5.4, and Cmake 2.8. I installed Qt, then VTK and Cmake. I configured VTK to use QT 4.6 (turned on VTK_USE_GUISUPPORT and VTK_USE_QVTK). The configuration and installation worked painlessly but if I run Cmake with Qt references the compilation fails during the subsequent make process becaus...

how to find all *.c files for Cmake build system

I want to find all .c files under a directory and add them all to SRC files to compile in cmake. How can I do this in CMakeList.txt. for regular makefiles I can create SPECIFIED_SRC_FILE = $(foreach d,$(SPECIFIED_SRC_DIRS),$(wildcard $(addprefix $(d)/,.c))) bu I couldn't get how to do something like this in CMakeList.txt. Thank you...

Making CMake choose static linkage when possible?

I'm working on a project that's link against SOCI, which comes as both static and dynamic libraries. I'd like CMake to choose the static version when available, and dynamic otherwise. Is there a reasonable way to do this in CMake? I've come up with nothing looking through the docs so far. ...

configuring emacs for cmake

Hello, gcc 4.4.2 cmake 2.6 I have just started using cmake. Coming from writing my own Makefiles. However, I have this directory structure and using out-of-source build. To separate the source files from the build files. project src my_c_files.c CMakeLists.txt build Makefile Before I would write my o...

What is proper naming convention for MSVC dlls, static libraries and import libraries.

Hello, What is standard or "most-popular" naming convention for MSVC library builds. For example, for following platforms library foo has these conventions: Linux/gcc: shared: libfoo.so import: --- static: libfoo.a Cygwin/gcc: shared: cygfoo.dll import: libfoo.dll.a static: libfoo.a Windows/MinGW: shared: libfoo.dll import: li...

What should expericenced Unix programmer to be aware of using Microsoft Tools?

I come from UNIX world, I'm quite familiar with Linux, Solaris, Cygwin and MinGW development. Recently I ported one of my big projects (cppcms) to support MSVC, including building static and dynamic libraries with CMake. And I get all the time absolutely weird issues: I had CMake build issues because Windows programming lacks namin...

CMake add_custom_command/_target in different directories for cross-compilation

In CMake, I'm trying to build a project that includes libraries for multiple different processor architectures, compiled by different toolchains. For each architecture, static libraries are built in multiple subdirectories, and then collected into a shared library in the root directory. So far, I haven't been able to figure this out. ...

Is it possible to get CMake to build both a static and shared version of the same library?

Same source, all that, just want a static and shared version both. Easy to do? ...

Linking static libraries to other static libraries

I have a small piece of code that depends on many static libraries (a_1-a_n). I'd like to package up that code in a static library and make it available to other people. My static library, lets call it X, compiles fine. I've created a simple sample program that uses a function from X, but when I try to link it to X, I get many errors...

Looping over files matching wildcard in CMake.

I want to use CMake to run some tests. One of the test should call a validator script on all files matching "fixtures/*.ext". How can transform the following pseudo-CMake into real CMake? i=0 for file in fixtures/*.ext; do ADD_TEST(validate_${i}, "validator", $file) let "i=i+1" done ...

CMake tutorial.

Can anyone provide link(s) to good CMake tutorial except very expensive and hard-to-get official one? Especially interesting in using CMake for Fortran projects but will be grateful for any good tutorial. Update. What I already found is CMake articles in Kitware Public Wiki. Fortran example is absolutely useless. =( Also while waiting...

Undefined references when trying to link Qt app with my static library.

Hello, I have a static library that I have built with MinGW, I am trying to link to that library from a Qt application. I keep getting linker errors caused by one of the object files in the library. This file actually declares a couple of Boost headers, one for use of shared_ptr and the other so I can make a class noncopyable. I belie...

Installing PySide - OSX

Anyone had success installing and using PySide on OSX? I am following the install instructions on the PySide site, though I'm running into issues building the API Extractor. I run cmake on the CMakeLists.txt file inside the api extractor dir and: This error is thrown- CMake Error at /Applications/CMake 2.8-0.app/Contents/share/cmake-2...

CMake - Issue with static library

Hello all, I'm using CMake-2.8 on winxp with Visual Studio 2005 generator. lets say I've a dll created (A.dll) from some cxx files and a static library static.lib So I call Link_Directories to specify the directory where the static library is located. Now A.dll is built fine. Now I want B.dll built from some cxx sources, A.lib (the im...