Tag: cmake

How to handle dependencies in cross platform C++ projects?

This are the ways I see for dealing with external libraries in a cross-platform project in an automated way. (Why are there no cross platform package managers?) Add compiled binaries to the repository. (This doesn’t work, since platform and build configuration vary and new environments may come up.) Write download scripts to fetch source code […]

How to clone and integrate external (from git) cmake project into local one

I faced with a problem when I was trying to use Google Test there is a lot of manuals how to use ExternalProject_Add for the adding gtest into the project, however most of these describe a method based on the downloading zip archive with gtest and build it as we know gtest github hosted and […]

CMake + find package or check out and install

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 […]

CMake ExternalProject: how to specify relative path to the root CMakeLists.txt?

It seems that CMake ExternalProject always assumes the root directory of the external project to be the source directory. But what if that is not the case? Consider the following example: The external project uses this directory layout: libfoo.git <— ExternalProject assumes this as source dir. ├── … └── libfoo <— However, the actual source […]

What is your way to keep binary dependencies in the version control system?

I’m wondering what is the best way to keep binary dependencies in the “team friendly” way. We have many dependencies for cross-platform application. That includes commercial library in 32/64 * linux/windows/mac versions and a few open source libraries compiled in non-standard, no-so-trivial to reproduce environments. Moreover we have graphical assets that sometimes are large (250Mb […]

CMake, C++ and Jenkins/Continuous integration

I have a cmake sample project that I would like to build on Jenkins running on Ubuntu 15.10. I have installed: https://wiki.jenkins-ci.org/display/JENKINS/CMake+Plugin And created two build steps: Run cmake to generate makefiles Run make all from the build dir I works fine: [build] $ cmake -G “Unix Makefiles” -D CMAKE_BUILD_TYPE=Debug /var/lib/jenkins/workspace/cmake-test/cmake-gtest/src — Configuring done — […]

Jenkins + Cmake + JIRA = CI of multiple interdependent projects?

We have a number of small projects within our system running on Linux (Slackware 7-11, slowly migrating to RHEL 6.0). Around 50-100 applications and 15-20 libraries. Almost all our applications use one or more of our libraries. Our source tree looks something like this: /app1 /app2 /app3 /include /foo/app4 /foo/app5 /foo/app6 /foo/lib1 /foo/lib2 /lib/lib3 /lib/lib4 […]

Mercurial, dependencies, repository structure

I am working on some cross platform project and use CMake to configure project with different build systems. The disadvantage of this approach is the need of dependencies and subprojects built on each platform. I modified classic trunk-branch-tag structure (I was on subversion then) to the following: trunk/ data/ test/ sources/ … branches/ branch-A/ branch-B/ […]

How to get CTest results in Hudson / Jenkins

I’m using CTest (part of CMake) for my automated tests. How do I get CTest results in the Jenkins dashboard ? Or, phrased differently, how do I get CTest to output in JUnit-like XML ?

How to version control out-of-source build directory using CMake and SVN

CMake recommends out-of-source builds. Typically what I have are small build scripts for each build so I don’t have to manually execute the CMake command. For example my build directory might look like: build |–linux | |–build.sh |–arm |–build.sh where arm/build.sh might look like: cmake \ -D CMAKE_CXX_COMPILER=${CROSS_COMPILE}g++ \ -D CMAKE_C_COMPILER=${CROSS_COMPILE}gcc \ -D CMAKE_CXX_FLAGS=”-mcpu=cortex-a9″ \ […]

Git Baby is a git and github fan, let's start git clone.