I am trying to use ccache with CMake. I have placed symlinks named gcc, g++ and c++ in /usr/local/bin. If I run make, add some change to CMakeLists.txt that does not affect the compiled files (add unused library just to force make build all the targets) and re-run make, everything is recompiled as if there was no ccache. However, if I re...
I'm trying to use add_custom_command to generate a file during the build. The command never seemed to be run, so I made this test file.
cmake_minimum_required( VERSION 2.6 )
add_custom_command(
OUTPUT hello.txt
COMMAND touch hello.txt
DEPENDS hello.txt
)
I tried running:
cmake .
make
And hello.txt was not generated. What h...
I'm trying to create a cmake equivalent to the following make:
demo: main.cpp
gcc -o demo main.cpp
./demo
demo is executed whenever demo is created.
This what I came to, but demo is not executed as I want:
add_executable(demo main.cpp)
add_custom_target(run_demo demo)
This is actually equivalent to:
all: demo
demo: main.cpp...
Hi all,
I'm trying to setup a parallel CMake-based build for my source tree, but when I issue
$ cmake .
$ make -j2
I get a jobserver unavailable: using -j1. Add '+' to parent make rule warning. Does anyone have an idea if it is possible to fix it somehow?
...
I'm using CMake 2.8.1 (on Windows) with the "Visual Studio 10" generator. GLOB and source_group don't seem to work together. Is there a way to get this to work?
I use file( GLOB ... ) to create a list of .cpp files and then use source_group to create a filter in the generated Visual Studio project:
# C:\Users\My Name\hello\CMakeLists....
Hello all,
I have a project whose artifacts are two dynamic libraries, let's say libX.dylib and libY.dylib (or .so for linux distributions). There are no executables.
Now I would like to distribute these libraries. Since I already use CMake to compile it, I looked at CPack and successfully generated .tgz and .deb packages for Linux. ...
How do I add .cpp files to a project and have them visible in the project but not included in the compile? Basically I want the "Excluded From Build" flag to be set to "Yes". I want to do this for C++ Unity style builds.
...
I'm currently porting a gcc project to Visual C++. It's defined in a CMake file, and I have created a Visual C++ property sheet to aid in compatibility (GccCompat.props). Everytime the Visual C++ project files are regenerated by CMake, the property sheet has to be added manually, since I don't know how to add it automatically. So, the qu...
Hi guys, i have the following problem.
I'm writing a CMakeLists.txt to build a C++ project of mine, which is composed of
libhybris.so : A shared library with some exported functions.
hybris : An executable which links to libhybris.so
A set of various shared libraries which links to libhybris.so
The problem is that, libhybris.so depen...
Is there a simple (or hack) way to generate a Visual Studio 2008 project that uses Intel Compiler from cmake?
I have found some notes about using ICProjConvert. Does anyone have any scripts or CMake snippets that are proven to work?
Here's the screenshot of the final solution I'd like to obtain. Note that it contains Intel Compiler pr...
I have been trying to set up OpenCV for the past few days with no results. I am using Windows 7 and VS C++ 2008 express edition. I have downloaded and installed OpenCV 2.1 and some of the examples work. I downloaded CMake and ran it to generate the VS project files and built all of them but there with several errors, and couldn't get ...
Hello, StackOverflow community!
I want to embed protocol buffers into some project that supports cmake.
As I undrestood, google doesn't provide this
Any suggestions? Who tried to create cmakeable protocol buffers library?
Are there lots of not cross-platform places at the source or there is no at all.
Where can I take it if it exists?...
Since I observed some strange behavior of global variables in my dynamically loaded libraries, I wrote the following test.
At first we need a statically linked library: The header test.hpp
#ifndef __BASE_HPP
#define __BASE_HPP
#include <iostream>
class test {
private:
int value;
public:
test(int value) : value(value) {
std::...
I have installed the most recent version of boost in /usr/local (with includes in /usr/local/include/boost and libraries in /usr/local/lib/boost) and I am now attempting to install Wt from source, but cmake (version 2.6) can't seem to find the boost installation. It tries to give helpful suggestions about setting BOOST_DIR and Boost_LIB...
Hello,
i have an application where is use Qt 4.6 and Microsoft SDKs (the Psapi.Lib).
I use cmake or qmake to build.
For qmake and cmake i specify in hard the path of the Psapi.lib.
qmake :
win32 {
LIBS += "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\Psapi.Lib"
}
cmake :
SET(PSAPI "C:/Program Files/Microsoft SDKs/Window...
The following code prints nothing
CHECK_INCLUDE_FILE_CXX(glog/logging.h GLOG_INCLUDE)
IF(GLOG_INCLUDE)
MESSAGE("YY")
ENDIF(GLOG_INCLUDE)
But I have the following environment variable set:
export CPLUS_INCLUDE_PATH=/usr/local/include
And, "ls /usr/local/include/glog/logging.h" returns the file.
I tried using
include_directories...
I'm using the CDT4 - MinGW Makefiles generator. Project->Build All successfully builds the target (a shared library) but it seems I would have to (A) open a project settings page and type in the target, hoping it's spelled right*, or (B) run make from a terminal to "build" the install and package targets.
I noticed a promising Project-...
Hey,
I'm using CMake to build my project. The project uses some parts of the vxl (http://vxl.sourceforge.net) library. Since I don't need the full vxl lib, I build only the parts I need within my projcet by using cmake's ExternalProject. The Linux port of my project compiles without problems.
The Windows port also compiles fine, if I ...
I'm building some tests using CTest. Usually, I can set up the test by simply the line:
ADD_TEST(Test_Name executable args)
However, I've run into a problem, I have some tests that require two commands to be run in order for it to work, is there any way I can run two programs within a single ctest, or am I required to create a new te...
I like to keep my Makefiles flexible and multifunctional. One of the tasks I usually add to make command is tar, for example the following instruction does the job:
tar:
tar -cvf $(PROGNAME).tar $(SRCS) Makefile
My question is: How can CMake be used to generate personalized commands like tar?
I would like to see some code samples....