We've been using CMake for a couple of years for C++ application
building. We effectively set up our CMake project structure once, and
mostly only change it to add new source files, etc.
Currently, all C++ source is checked out of our SVN repository into one
large tree. This tree actually
gt;
>
>
> *From:* CMake [mailto:cmake-boun...@cmake.org] *On Behalf Of *Chris
> Johnson
> *Sent:* 27 December 2016 23:27
> *To:* cmake@cmake.org
> *Subject:* [CMake] Install destination problem
>
>
>
> In all of my CMakeLists.txt files, I include a se
In all of my CMakeLists.txt files, I include a settings file, like so:
include(global_settings.cmake)
Inside global_settings.cmake, I have a line like this:
set( CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install )
When I run "make install" on my development system, the files are correctly
the implementation of the file() command? Could I
possibly customize that implementation?
Thanks much!
..chris
On Tue, Jun 9, 2015 at 2:00 PM, Bill Hoffman bill.hoff...@kitware.com
wrote:
On 6/9/2015 1:56 PM, Chris Johnson wrote:
We do use a globally included set of CMake rules in all of our
About a year ago we converted our build system, which used a huge pile of
custom Makefile code, to use CMake. It has been working well for us.
But now, the boss (who dabbles at the command line) and a couple of the
developers are asking for a feature which went away with that
conversion.
which
matches the glob. If you list the files explicitly, you have to edit the
CMakeList to add the file, and CMake will know to re-run at next build.
Petr
On Fri, Jan 30, 2015 at 4:40 PM, Chris Johnson cxjohn...@gmail.com
wrote:
Petr, thanks. That makes a lot of sense.
Now I am
(),
target_link_libraries(), or setting properties such as COMPILE_OPTIONS),
but they don't really add commands to it.
Petr
On Fri, Jan 30, 2015 at 3:27 PM, Chris Johnson cxjohn...@gmail.com
wrote:
That does clarify a few things yes. Thank you.
By configure time I had meant the first two items you
Ah, I found the problem. I had the output file listed in the custom
command's DEPEND clause.
Thank you very much for all the help!
On Fri, Jan 30, 2015 at 11:07 AM, Chris Johnson cxjohn...@gmail.com wrote:
I'm trying to use the method outlined in your #2, with the list of files.
But I get
(driven by the build system), but the add_custom_command() itself
executes at CMake time.
I hope I've clarified it a little bit.
Petr
On Thu, Jan 29, 2015 at 9:36 PM, Chris Johnson cxjohn...@gmail.com
wrote:
Thanks; I appreciate the suggestions.
One thing that jumped out is the thought
I am looking for suggestions on how to solve the following problem. I
need a solution which is easy to understand and safe from future
maintenance errors.
There is a project directory with one C++ program and a large number of
input data files.
The C++ program needs to be compiled, and then
)
endforeach()
For portability, you might want to use ‘${CMAKE_COMMAND} –E
copy_if_different’ in place of ‘/bin/cp’ and CMAKE_CURRENT_BINARY_DIR in
place of ‘.’
-kt
*From:* CMake [mailto:cmake-boun...@cmake.org] *On Behalf Of *Chris
Johnson
*Sent:* Thursday, January 29, 2015 8
A common and useful method for avoiding name conflicts and keeping files
well-organized is to place them in a subdirectory unique to the library.
For example, the libraries for Graphviz and Postgres often install their
API header files in directories named install-prefix/include/graphviz and
Has anyone out there used CMake to build a PHP Phar file, and more
interestingly, used CMake to install a PHP project which uses Composer for
dependency management?
If so, could you share some information about what your custom commands and
custom targets must look like to get this to work?
One of my co-workers likes to start multiple makes in various parts of his
project source tree. Under our old Makefile-based, build-in-source system,
this worked fine. Under our new CMake-based, out-of-source build system,
this causes problems, since any make might cause CMake to rebuild its
Chris Johnson:
One of my co-workers likes to start multiple makes in various parts of
his
project source tree. Under our old Makefile-based, build-in-source
system,
this worked fine. Under our new CMake-based, out-of-source build system,
this causes problems, since any make might cause CMake
take a while.
..chris
On Mon, Dec 8, 2014 at 8:06 PM, Bill Hoffman bill.hoff...@kitware.com
wrote:
On 12/8/2014 1:53 PM, Chris Johnson wrote:
When I change a header file for a library, and then do a make in the
build directory, only source (C++) files which directly include that
header get
link.
On Tue, Dec 9, 2014 at 10:25 AM, Bill Hoffman bill.hoff...@kitware.com
wrote:
On 12/9/2014 9:45 AM, Chris Johnson wrote:
Well of course it had to not be all that simple. My first attempt to
create a simple (2 header files in library) example failed to fail in
the same way as my much
When I change a header file for a library, and then do a make in the
build directory, only source (C++) files which directly include that header
get rebuilt, but those which use it indirectly do not. But when I link to
the library, the other files do get rebuilt.
Example:
lib/mod.cpp
Thanks for the reply and good advice, Alan. Will do.
..chris
On Mon, Dec 8, 2014 at 2:58 PM, Alan W. Irwin ir...@beluga.phys.uvic.ca
wrote:
On 2014-12-08 12:53-0600 Chris Johnson wrote:
When I change a header file for a library, and then do a make in the
build directory, only source (C
might also be a
bug)
On Thu, Dec 4, 2014 at 7:27 PM, Chris Johnson cxjohn...@gmail.com wrote:
I have a global include file used by all of the CMakeLists.txt files in
my project. In it, I set the value of CMAKE_INSTALL_PREFIX, as well as a
number of other variables and functions.
In my
This looks like a bug to me. I have a very simple test case where
CMAKE_INSTALL_PREFIX is set correctly if I do so after the project()
statement, and fails to be set correctly if I do it before the project()
statement.
On Fri, Dec 5, 2014 at 2:06 PM, Chris Johnson cxjohn...@gmail.com wrote
I have a global include file used by all of the CMakeLists.txt files in my
project. In it, I set the value of CMAKE_INSTALL_PREFIX, as well as a
number of other variables and functions.
In my CMakeLists.txt file, I had this:
cmake_minimum_require(VERSION 2.8.4)
include(global.inc)
through hoops to support that paradigm is kind of strange.
Thanks,
..chris
On Wed, Dec 3, 2014 at 10:56 AM, Bill Hoffman bill.hoff...@kitware.com
wrote:
On 12/2/2014 5:19 PM, Chris Johnson wrote:
The target_link_libraries() directive is adequate for this job when the
header files
Background: I'm converting an existing project from a custom build process
which uses BSD Make to CMake. The source for the project is contained in
about 600 directories, and has about a dozen libraries and maybe a hundred
executables. The old build system (make) has to continue working until
Ah, and I royally typo'd:
prog.cpp includes the header via:
#include mylib/myfunc.h
(not just myfunc.h)
On Tue, Dec 2, 2014 at 11:01 AM, Chris Johnson cxjohn...@gmail.com wrote:
Background: I'm converting an existing project from a custom build
process which uses BSD Make to CMake
Just for completeness.
File prog/prog.cpp:
#include mylib/myfunc.h
int
main(int argc, char** argv)
{
return myfunc();
}
File mylib/myfunc.h:
int myfunc();
And file mylib/myfunc.cpp:
#include myfunc.h
int
myfunc()
{
return 1;
}
--
Powered by www.kitware.com
Please keep messages
Adding this directive does not seem to change the results at all,
actually. Am I missing something?
Thanks,
..chris
On Tue, Dec 2, 2014 at 11:33 AM, Bill Hoffman bill.hoff...@kitware.com
wrote:
This should work:
include_directories(${CMAKE_SOURCE_DIR}/src)
--
Powered by www.kitware.com
of the default include
path, correct?
Thanks,
..chris
On Tue, Dec 2, 2014 at 1:10 PM, Bill Hoffman bill.hoff...@kitware.com
wrote:
On 12/2/2014 1:04 PM, Chris Johnson wrote:
Adding this directive does not seem to change the results at all,
actually. Am I missing something?
What build tool
Well, this fixed my example. But my real project still fails the same
way. It is, of course, much more complex and the library directories are
often several layers down in subdirectory trees. :-(
On Tue, Dec 2, 2014 at 2:05 PM, Chris Johnson cxjohn...@gmail.com wrote:
I'm using Make as my
depend upon
them?
On Tue, Dec 2, 2014 at 3:53 PM, Chris Johnson cxjohn...@gmail.com wrote:
Well, this fixed my example. But my real project still fails the same
way. It is, of course, much more complex and the library directories are
often several layers down in subdirectory trees. :-(
On Tue
the necessary source directories of the
mentioned libraries to the include paths.
On Tue, Dec 2, 2014 at 4:00 PM, Chris Johnson cxjohn...@gmail.com wrote:
Yes, by adding another directory between my top-level ./src/ directory and
./mylib, I can cause the example to fail. I understand now
:30 PM, Stephen Kelly steve...@gmail.com wrote:
Chris Johnson wrote:
* I do not want to use the add_library(component1 OBJECT
${component1_sources}) and add_library(toplevel
$TARGET_OBJECTS:component1 ... ) syntax if it can be avoided.
Is the constraint that you want a top-level something
, Johannes Sebastian
*Sent:* Wednesday, November 26, 2014 13:50
*To:* 'Chris Johnson'; cmake@cmake.org
*Subject:* RE: [CMake] Creating a library from subdirectories
In the example on that site an OBJECT library is created (the output
consists of multiple .obj files), you used STATIC libraries
This CMake wiki page (
http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library) claims one can
create a library from subdirectories containing libraries, which is exactly
what I want to do. However, it doesn't seem to work. Here's my SSCCE (
http://sscce.org) toy example file structure:
.
|--
34 matches
Mail list logo