cmake

CMake with Visual Studio

I'm using CMake to create a visual studio project as I'm making a cross platform application and library, but I get errors like: 1>c:\program files\microsoft visual studio 10.0\vc\include\wchar.h(109): warning C4820: '_wfinddata64i32_t' : '4' bytes padding added after data member '_wfinddata64i32_t::attrib' It compiles fine on GNU/...

CMake, Qt, gcc and precompiled headers

Hi! I'm (once again) struggling with the creation of precompiled headers in conjunction with gcc and Qt on the Apple platform. When now creating my precompiled header I use a code section (based on good old "PCHSupport_26.cmake") to extract the compile flags as follows: STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_n...

Cross-Platform Building, Standard Directory Structures, Environment Variables

I've started using CMake as a build tool for a cross-platform command line program that requires FFTW3 and Boost.Format. I'm familiar with the Unix-like standard directory structures for headers and binaries of installed libraries but I'm wondering what the quasi standard is on Windows platforms as to how and where libraries are installe...

Detect Endianness with CMake

My library needs to read-in big-endian integers (4-bytes) and covert them to the endian order of the host for processing. While on *nix ntohl has worked a treat under Windows use of ntohl requires the use of Ws2_32.dll (Winsock). Such a dependency is one which I would rather eliminate. The simplest way to do this appears to be to writ...

Compiling static TagLib 1.6.3 libraries for Windows

I am having a super hard time compiling and using TagLib 1.6.3 in my Qt project. I've tried everything I can think of. TagLib claims that it is supported through CMake but I'm not having any luck. Furthermore, I'm confused about what kinds of files I even need for my Qt libs! I've built *.a files, *.lib, and *.dll. From what I understan...

Io does not compile on Mac OS X Snow Leopard.

I followed the instructions in the README, they are very simple cd build cmake .. make install The problem occurs after the make install command. Io will not compile, specifically because of the module CFFI. ld complains that my libffi.dylib is not 64-bit, and thus it won't link the .o files, and because of that, it then complains tha...

CMake or Waf for D project

Hello! We are looking for adequate build tool for a desktop GUI application to be written in D (using Qt toolkit), consisting of several native libraries, using 3rd party C-lib(s). It has to build on Linux (native development) and Mac as well on Windows. We might adopt Code::Blocks as IDE. Waf already has support for D language, while ...

How to link C++ program with Boost using CMake

What should my cmake file should look like for linking my program with boost library under Ubuntu? The errors show during running make: main.cpp:(.text+0x3b): undefined reference to `boost::program_options::options_description::m_default_line_length' The main file is really simple: #include <boost/program_options/options_description...

where does qtcreator with cmake store run and build settings, and how to set via script?

In my usage at least, I sometimes delete my CMake build folder and create a new one, or have multiple build folders (one per computer) but only one source folder (nfs mount). From what I can tell, QT Creator saves settings into CMakeLists.txt.user inside the source tree, and some others settings into the 'project.cbp' file in the buil...

how to work on a project with visual studio and eclipse

we are currently starting a project involving people on windows and linux and using SVN. The problem is that people who want to use Visual Studio (2010 for most of them) have problem with the folder structure and the syncing of there project. they've got ankhsvn (http://ankhsvn.open.collab.net/), they are mapping the project to real fo...

Preserving environment variables in CMake

I am working on something that requires some header files from a different source tree. For various reasons, I would like to keep these headers outside of my project and reference them during the make process. I have a CMake build script that generates my makefiles, but I would like to be able to generate makefiles with references to en...

CMake custom clean commands

In my CMake project I'd like to have some custom behavior happen when the clean target is run. However, if I do add_dependencies(clean extra-clean) it fails with add_dependencies Adding dependency to non-existent target: clean Is it even possible to have custom clean behavior? EDIT: I am running some external tools as part of the...

HOw to group header files in header subfolders under the general header files folder using Cmake

Hi I am building Cmake based build system. I would like to group header files in folders (VC++ can do it) under the general folder Headr Files. Similar I would like to group the corresponding .cpp files in folders under the Source Files directory. Unfortunately I could not find any instructions of how to do it. Please help. Dimitre ...

How to compile a specific target as "release" with /MT /GS in cmake?

set_target_properties (target PROPERTIES COMPILE_FLAGS "/MT /GS") I think I've managed to compile the target with /MT /GS flags. But how to make it compile in release mode? ...

How do you escape a semicolon in COMPILE_FLAGS property of cmake ?

I need to get this as a result in the preprocessor definitions of the msvc generator: MYPATH=\"d:\\;.\\Lib\" But when I use the following escape sequence in set_source_files_properties: set_source_files_properties(source.c PROPERTIES COMPILE_FLAGS "-DMYPATH=\\\"d:\\\;.\\\\Lib\\\"") the generated result is: MYPATH=\"d:\";".\Lib\" ...

using cmake to link object files into lib.xxxx.a file

I've got a list of object files that I want to package in a library. How do I do this? I thought I could use ADD_LIBRARY ...

CMake target to generate excutable wrapper script

Hi! I'm pretty new to CMake and I have the following problem: I have a number of C++ modules (executables) which together form a program package. The modules are controlled and executed by a driver program written in Python. In the build/installation process the Python program needs to be preprocessed with options set by the configura...

cmake: struggling with add_custom_command dependencies

I'm trying to get a file produced by an add_custom_command in one directory to be a dependency of an add_custom_command in another directory. In the first directory (lib/core) I have a build command that looks like this: add_custom_command( OUTPUT libcore.bc COMMAND tartln -filetype=bc -link-as-library -o libcore.bc ${STDLIB_BC...

How to set output path of cmake / qt4 command QT4_WRAP_UI

I use the cmake command QT4_WRAP_UI. Is there an option to control the output path of the generated header files? ...

What is the in-place/Out-of-place builds

As in the title the questions is what is the difference between (in-place/Out-of-place builds)? ...