cmake

CMake Visual Studio linking executable with static library

I have a very simple (currently just a main.cpp) CMake C++ project that I'm trying to build on both Mac OS X and Windows. It depends on libgsasl, which I have compiled as a static library on both platforms. Mac OS X has no problems building, and Windows doesn't complain during the build either and produces an EXE. When I try to run the ...

Can I and should I use CMake for my setup

The projects I work on are organised into root folders (VOBS) as follows: |--BUILD_FOLDER | |-- BUILD_SCRIPTS | |-- SOME_MORE_CODE | |--COMPONENT_A |--COMPONENT_B Because they are ClearCase VOBS there is no higher level root folder to place a CMakeLists.txt This setup doesn't seem to fit the CMake pattern... Is this a show-stopper t...

cmake: How to make a script for copying Data files accompanying my program

I am trying to automate my build process with cmake. There is currently only one issue: Where is, in cmake's philosophy (if there is one), the best place to put the copying of data files. I have a library and a few examples. The examples need the data. I currently do the following: I use a custom command in each example's CMakeLists....

CMake, Microsoft Visual Studio, and Monolithic Runtimes

Hello all :) I'm building a file using the CMake Build System and Microsoft's Visual C++ compiler. When I have CMake generate the visual studio project, the project contains the commandline to build a "Multi Threaded DLL" type of runtime -- one which depends on msvcrt.dll. For various reasons I'm not going into right now, I cannot depen...

CMake Post Build Step

Hello :) I'm trying to setup a post-build command for CMake, which I have done using the ADD_CUSTOM_COMMAND directive as stated in the CMake documentation. What I'd like to do though, is only have the post-build run if I am creating a release build of my executable. How does one accomplish this? Thanks in advance :) Billy3 ...

cmake and libpthread

I'm ruinning on RHEL 5.1 and use gcc. How I tell cmake to add -pthread to compilation and linking? ...

Makefile generator for c++?

Do the following build systems: cmake, jam and bjam also generate makefiles like qmake does? What utility does MS visual c++ uses to generate make file? ...

linking 3rd party libraries

Hello, I have created a simple application that works ok. However, now I need to link with some libraries in the following directory. /opt/norton/lib In my make file I have the following with works, but I need to use cmake LIBS_PATH = -L/opt/norton/lib INC_PATH = -I/opt/norton/inc LIBS = -lntctrl In my CMakeList.txt I have this b...

CMake RequireAdministrator

Hello :) I'm trying to set the RequireAdministrator manifest flag on an executable I'm building with CMake and Visual Studio. Any ideas on how to direct CMake to set that option? Thanks! Billy3 ...

CMake CTest prevent truncation of test name

Hi, I'm currently running CTest, but I have a problem whereby tests with long names. For example: "API Part1 : Some test information w/ this input file" get's truncated to something like "API Part1 : Some test information w/ th"). It seems like the test name is truncated to about 31 characters. How can I change this? Thanks ...

CMake: how to add compiler flags to non-default compiler

Hello I want to build a project with intel compiler. With default gcc I usually run: cmake -DCMAKE_CXX_FLAGS=-I/some/path /path/to/project And this works fine. cmake -DCMAKE_CXX_COMPILER=icpc -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_FLAGS=-I/some/path /path/to/project When I try to use non-default compiler it does not path CMAKE_CXX_...

cmake directories problem

Hi SO, I have two cmake-related problems: first, I can't make it to find the includes in the include folder, and it doesn't find the main.cpp file unless I place it in the same directory as the CMakeLists.txt. Can you please help me? I have the following directory structure: /TRT | +--- /src (bunch of .cpp files here...

Finding the correct Python framework with cmake

I am using the macports version of python on a Snow Leopard computer, and using cmake to build a cross-platform extension to it. I search for the python interpreter and libraries on the system using the following commands in CMakeLists.txt include(FindPythonInterp) include(FindPythonLibs ) However, while cmake identified the correct ...

Out of source build with scons?

I have been using cmake to build my projects out of source, which is really convenient as you avoid polluting your source directory with unnecessary files. Assuming the CMakeLists.txt is in the current directory, this could be done as follows: mkdir build cd build cmake .. make How can I do the same in scons? ...

Reading registry values with cmake

On a Windows 7 machine I cannot read any registry values that contain a semicolon. For example if you have 7-zip, running the following SET(MYPATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\7-Zip;Path]) MESSAGE("MYPATH = ${MYPATH}") results in MYPATH = [HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip;Path] instead of the actual path as per the following t...

CMake: How to generate different shared library names depending on build type

This is my first time using CMake and I'm trying to build QJSon, a JSON parser for Qt 4.x. What I want basically is to build different output library names depending on the build configuration. I'm using ${CMAKE_BUILD_TYPE} macro to generate different targets (qjson.lib/qjson.dll and qjsond.lib/qjsond.dll). Seems that the VS 2008 solutio...

(c)make - resursive compile

Hello! Let's assume I have directories like: dir1 main.cpp dir2 abc.cpp dir3 def.cpp dir4 ghi.cpp jkl.cpp And let's assume that main.cpp includes dir2/abc.cpp and dir3/def.cpp, def.cpp includes dir4/ghi.cpp and dir4/jkl.cpp. My question is, how can I have one Makefile/CMak...

What is the correct way to customize the install output directory for each developer in CMake?

I've been working on an old game that I created CMake files for to get rid of a mix of Makefiles and visual studio projects. Everything is working well, but I'm having a hard time figuring out what the correct way to allow the developer to specify where the output files are copied to when install is run. The issue is there are many DLLs...

How to add an extra plist property using CMake?

I'm trying to add the item <key>UIStatusBarHidden</key><true/> to my plist that's auto-generated by CMake. For certain keys, it appears there are pre-defined ways to add an item; for example: set(MACOSX_BUNDLE_ICON_FILE ${ICON}) But I can't find a way to add an arbitrary property. I tried using the MACOSX_BUNDLE_INFO_PLIST target ...

Any real world CMake project example ?

I am new to CMake, i think the best way to learn it is to see how it is used in a real world project. I know KDE uses CMake, however, my project is much small than that. On the other hand my project is bigger than mos the hello-world project in the tutorials. simply speaking, my file structure looks like: build # for binary lib_extern...