Re: [cmake-developers] The Ninja generator errors out for any project that enables Fortran

2013-06-17 Thread Mathias Gaunard

On 14/06/2013 03:24, Bill Hoffman wrote:

On 6/13/2013 7:35 PM, Alan W. Irwin wrote:


If anyone here is game to do a quick fix for the Ninja generator so
that is supports Fortran, I would be happy to help out by testing the
fix using the build_projects project on the Linux and Wine platforms
that are accessible to me.

There is no quick fix.  The fortran depend issue is not easily solved
which is why it is not yet implemented.  It will take several weeks of
development and some possible changes to ninja to accomplish this task.
  Sadly, I have not found a funding source or developer willing to
support this effort.


Even for C/C++, it could be interesting to have an option to make Ninja 
use pre-generated dependencies from the CMake scanner instead of special 
gcc commands to automagically generate them.


The code to deal with this already exists in the Make generator.

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Limitations of IS_ABSOLUTE

2012-12-24 Thread Mathias Gaunard

On 21/12/12 11:19, Alan W. Irwin wrote:

On 2012-12-21 09:43+0100 Eric Noulard wrote:


2012/12/21 Alan W. Irwin
irwin-ICHe1znInSgulI1VNbnaeCwD8/ffd...@public.gmane.org:

 Obviously for my use case it does look like a
reasonable alternative is to use file(GLOB...) followed by a check of
the result variable to see if it is empty.  But implementation of an
additional IF subcommand called IS_FILE which just checks for the
existence of the specified file would do this in fewer lines and does


Precisely the purpose of
if(EXISTS ${file})

I think.


Thanks, Eric.  EXISTS is what I needed.

I still think adding the qualifying phrase if it exists or not to the
IS_ABSOLUTE documentation would be useful.


I'd rather IS_ABSOLUTE did not force the file to exist.
I use it to check if some paths are absolute, regardless of whether they 
exist.


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] string(MAKE_C_IDENTIFIER) subcommand

2012-12-24 Thread Mathias Gaunard

On 22/12/12 13:02, Stephen Kelly wrote:


Hi there,

GenerateExportHeader has a bug where if the target name is kde-config, for
example, it generates content like

#ifndef KDE-CONFIG_EXPORT_H
#define KDE-CONFIG_EXPORT_H

This is not as intended. The problem is that the target name is used with
TOUPPER, but is not otherwise filtered for invalid characters.

I propose adding a string subcommand MAKE_C_IDENTIFIER and using it.

Any comments?


Why does it need to be built-in?
Do it as a cmake macro or function.

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


[cmake-developers] CTEST_USE_LAUNCHERS and Ninja

2012-10-13 Thread Mathias Gaunard
CTEST_USE_LAUNCHERS is a feature that allows better reporting of 
compilation errors to a dashboard.

Unfortunately, it only works with the Makefile generator.

Since ninja is significantly faster and just plain better, I use ninja 
on all the builders in my test farm.


I'd like to know if there is any plan to add CTEST_USE_LAUNCHERS support 
to Ninja.
If someone is willing to guide me (I have no idea how to do this and 
this option seems barely documented), I can try to implement it.

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Sublime Text 2 / SublimeClang Generator

2012-10-12 Thread Mathias Gaunard

On 12/10/2012 00:05, Morne' Chamberlain wrote:

Hi

My name is Morné Chamberlain and this is my first post to this list. I
recently started using Sublime Text 2 as a text editor and light
development environment. I use CMake in many of my projects and felt the
need for a Sublime Text 2 project file generator for CMake. So a couple
of days ago I started to implement a generator, based initially of off
the CodeBlocks one.

Current status:
- All source and CMakeLists.txt files are included in the generated
project file, with the directory tree structure.


I mostly use Sublime Text for its great scalability. I can add a 
directory with 20k files and I'll be able to work with them instantly.


I hope your generated configuration does not add files one by one and is 
still very fast to load for such cases.




- The generated project file also includes a sublimeclang_options
section where include paths and compiler definitions are defined for use
by the SublimeClang plugin (C/C++ as you type syntax and error checking
plugin for Sublime Text that uses llvm and clang).


sublimeclang works very badly for large projects or projects that are 
costly to compile.

I hope it can be disabled?



- Currently only tested on Ubuntu 12.04 with Unix Makefiles.


Would it be possible to make it work with Ninja as well?

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Tests with custom launchers and Not Run

2012-09-18 Thread Mathias Gaunard

On 09/12/2012 11:23 PM, Mathias Gaunard wrote:

On 12/09/2012 22:39, Mathias Gaunard wrote:

I'd be content with just interpreting a return value of 77 as a Not
Run status; this is a fairly trivial change that should work well in
any existing setups.

I don't think it is really needed to make things as complex as in the
bug report. Any intelligence, if required, can go in the test command
itself.


Simple patch attached.
This fulfills my needs well enough and I've just configured my
cross-compilation test servers to use it.


This is simple and works.
Is it satisfying? Any chance of having it included?

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Tests with custom launchers and Not Run

2012-09-18 Thread Mathias Gaunard

On 09/18/2012 11:37 PM, David Cole wrote:

I don't like it. Existing tests that run and return, for example, a
number of errors that occurred, will magically appear as not run when
that number just so happens to be 77.

If there are enough people who think this is simple and works and are
not concerned about the accidental matching of an intentional return
value of 77 that does NOT mean not run ... then I will relent and say,
so be it, and allow it in.

But only if there are some people who speak up here or add notes to the bug.

It just seems wrong to me to treat 77 as some special number here.


Well, you need to interpret a return value as a special value to be able 
to tell executables could not be tested.


Without this, a whole category status is entirely unusable to whoever 
wants to use custom launchers! That's a pretty serious issue to me.


77 already exists in the autotools world, so it seems like a good idea 
to re-use it.


Making the executable return the number of failing tests is a very bad 
idea: it doesn't even scale beyond 255 for the average operating system. 
Certain operating systems also have funny behaviour with exit status as 
well: with OpenVMS, all even values are considered failures and all odd 
values are considered successes.

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Tests with custom launchers and Not Run

2012-09-12 Thread Mathias Gaunard
I'd be content with just interpreting a return value of 77 as a Not 
Run status; this is a fairly trivial change that should work well in 
any existing setups.


I don't think it is really needed to make things as complex as in the 
bug report. Any intelligence, if required, can go in the test command 
itself.


On 12/09/2012 20:59, David Cole wrote:

There's discussion about that in the following bug tracker entry:

   http://public.kitware.com/Bug/view.php?id=8466

That issue is presently in the 'backlog' though, which means nobody is
actively looking at it.

And there does not appear to be a consensus forming about what the
right solution to the problem is. Although if everybody else involve
converges on a reasonable consensus *and* the CDash results still make
sense, I will withdraw my objections to the feature request.


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


[CMake] Tests with custom launchers and Not Run

2012-09-11 Thread Mathias Gaunard

Hi,

When not using a custom launcher for a test, if the executable doesn't 
exist then ctest will report Not Run.


Is there a way to do this with a custom launcher as well? When the file 
doesn't exist it always gives me Failed instead.


I need to run my tests in qemu because of cross-compilation, and because 
of this all my Not Run tests end up being marked as Failed, which is 
a bit annoying.

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[cmake-developers] Backlog bugs

2012-09-09 Thread Mathias Gaunard
I had filed a few bugs that were relatively major, but they were moved 
to the backlog. I haven't been able to find the procedure to move them 
out of it.


I believe a lot of major bugs were moved to the backlog without their 
authors being able to do anything, including bugs with patches ready to 
commit or where developers had already investigated the problem.


In particular some people told me they had been severely put off by 
CMake development when their bugs with attached patches that really 
improved CMake were moved to the backlog and ignored.

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


[cmake-developers] Backlog bugs

2012-09-09 Thread Mathias Gaunard
I had filed a bug that were relatively major, but they were moved to the 
backlog. I haven't been able to find the procedure to move it out of it.


I believe a lot of major bugs were moved to the backlog without their 
authors being able to do anything, including bugs with patches ready to 
commit or where developers had already investigated the problem.


In particular some people told me they had been severely put off by 
CMake development when their bugs with attached patches that really 
imporved CMake were moved to the backlog and ignored.

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [CMake] Add sources to a target library after add_library()?

2012-09-05 Thread Mathias Gaunard

On 06/09/2012 00:30, Loaden wrote:

Hi, I look this ML:
http://www.cmake.org/pipermail/cmake/2010-January/034437.html
Does CMake still can't support how to add sources to a target library
after add_library()?
I wan't support Precompiled Header for both MSVC / GCC(MinGW).
In MSVC case, it need a source, e.g. StdAfx.cpp to support PCH.
But in GCC case, it only need a header, e.g. pch.h
Any help or comments or tips are best welcome!
See: https://codereview.qt-project.org/#change,34052


I don't see what this feature would have to do with precompiled headers.

To use a precompiled header with GCC, just add -include 
path/to/precompiled/header.hpp to your compilation flags, and make sure 
you've built path/to/precompiled/header.hpp.gch before that.

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Check if a command exists?

2012-09-04 Thread Mathias Gaunard

On 03/09/2012 21:59, Rui Maciel wrote:

I have a small project which includes a couple of parsers whose lexers
are generated by re2c.  I intended to set cmake so that it could check
if re2c is present in the system, but after browsing through the docs
I've ended up empty-handed.

So, is there a way to set a cmake project so that it checks if a
tool/program/command is present in the build system?  If there is a way
to run that check, can anyone provide an example?


find_program(RE2C_EXECUTABLE re2c)

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Dependences to parallel project directories

2012-08-09 Thread Mathias Gaunard

On 08/08/2012 19:00, Tero Mäntyvaara wrote:

Hi.

I have got four CMake-projects: project1, project2, project3 and
project4. Each project is in its own directory and these directories are
parallel.

Project2 is dependent on project1, project3 is dependent on project1 and
project2. Project4 is dependent on project1 and project3.

How can I include source files from other projects in projects2,
project3 and project4?


Assuming all projects are sub-projects of a single master project, you 
can make any target in any of those projects depend on any target in any 
of the other projects.



--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Scope of imported targets

2012-07-27 Thread Mathias Gaunard

On 28/07/2012 01:43, James Bigler wrote:

Is there are particular reason why imported targets don't have global
scope (doc says current directory and below), but regular targets do
(seen everywhere)?

This seems really inconsistent to me.

I'm trying to build a custom library from other pieces using my own set
of commands.  I can't use add_custom_target directly since I can't use
the resulting target in target_link_libraries.  I then found a link
where it suggested to use add_library(IMPORTED) and set the file with
the results of my custom target.  Unfortunately, this library lives in a
sub directory and it can't be seen outside like the original library
used to.

Now, I'm kind of stuck.  I want a library type target, but IMPORTED
doesn't provide the correct scoping (i.e. global).


Personally, the only reliable way I've found to be able do what you want 
is to create a dummy library and then overwrite it by the custom one 
generated by a add_custom_command POST_BUILD command.


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] How to get started with the CMake Ninja backend on Linux and Windows?

2012-07-19 Thread Mathias Gaunard

On 19/07/2012 11:00, Nicolas Desprès wrote:


As far as I know the last official release of CMake supports Ninja
backend for both Linux and Windows.


I believe CMake 2.8.9 is required for Ninja on Windows. It hasn't been 
released yet.



Martine's Ninja is the official
repository. Although I am sure it works for Linux, I cannot guaranty it
for Windows but I am almost sure. Try it :-)


git clone https://github.com/martine/ninja.git
cd ninja
python bootstrap.py

then copy the ninja binary somewhere in your PATH (/usr/local/bin on 
Linux, for example)

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add and Boost

2012-06-18 Thread Mathias Gaunard

On 18/06/2012 08:42, Knox, Kent wrote:


BUILD_COMMAND bjam --with-program_options address-model=64
toolset=msvc-11.0 link=static stage


Two comments here:
 - bjam has been renamed to b2 since Boost 1.47
 - this probably uses the bjam/b2 in the path, rather than the one that 
you just built with bootstrap.bat, which is just asking for problems




1.Github appears to only use the https protocol, and the cmake file(
download … ) command does not appear to handle this protocol. So, I
think GitHub is verboten for any ExternalProject_Add. Am I right, or am
I missing something? Any plans to add https support?


Github also provides the git protocol, or did you just mean the zip 
download function?

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Accepted way to add -fPIC onto CMAKE_CXX_FLAGS?

2012-06-18 Thread Mathias Gaunard

On 18/06/2012 23:09, Michael Jackson wrote:

Linux really wants to have -fPIC for some of my code and I am trying to detect 
linux and then add this flag for my project but I am having no luck.

if (LINUX)
set(CMAKE_CXX_FLAGS ${CMAKE_CSS_FLAGS} -fPIC)
endif()

Is this NOT the way I should be doing this?


You probably meant

set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -fPIC)

Also, -fPIC should already be added when building shared libraries or 
modules.


Maybe you should build your code as a shared library rather than a 
static one.


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] find_package: how to require same directory prefix for both lib and header files?

2012-06-07 Thread Mathias Gaunard

On 07/06/2012 01:20, Natalie Tasman wrote:

Using cmake 2.8.8, I know that I can add backup or fallback search
directories for find_package, using

  INCLUDE_DIRECTORIES(/opt/local/include)
  LINK_DIRECTORIES(/opt/local/lib)

In this case, cmake first searches its default paths and THEN the
specified alternate.


I don't see the link between find_package and those two commands.

Those two commands should never be called in any Find module.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] selective compilation according to suffix

2012-05-31 Thread Mathias Gaunard

On 29/05/2012 10:48, Ilias Miroslav wrote:

Dear CMake experts,

in our project we have some categories of compiler flags, like 'safe flags'-no 
optimization, 'runtime checking flags', 'profiling flags' and so on.

I would like to have defined own filename extensions according to  specific 
compilers flags, let say

make VERBOSE=1 source_file.r  compiles source file (C,Fortran,C++) with runtime 
checking flags
make VERBOSE=1 source_file.s  creates object  without optimizatin
make VERBOSE=1 source_file.rs  creates object file with runtime checking flags 
and without optimization

and make source_file.o makes 'classic' object file.

Any clues, please ?


Just make a macro or function that generates those targets.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Reading flags that have been added with add_definitions

2012-04-18 Thread Mathias Gaunard

Is there a way to read back what flags were added with add_definitions?

If I do

add_definitions(DFOO=bar -pedantic)

when I read the COMPILE_DEFINITIONS property of the directory all I have is
FOO=bar

How can I know the -pedantic option is being used for all targets in the 
directory?

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Ninja and IMPLICIT_DEPENDS

2012-04-18 Thread Mathias Gaunard

I have recently tried Ninja with CMake 2.8.8 RC2.

Are there known serious problems? It seems things are not always rebuilt 
when I touch indirectly included headers.


Also, is IMPLICIT_DEPENDS on custom commands supposed to be supported? 
It doesn't seem to work.

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] How to build for 32bit using multiarch?

2011-11-29 Thread Mathias Gaunard

On 11/28/2011 05:58 PM, Kishore Jonnalagadda wrote:

I have recently moved to using 64bit Kubuntu Oneiric when supports
multiarch. I understand that building 32 bit from my 64 install is as
simple as adding the -m32 option to gcc. Asking cmake to add that
flag is easy but i don't know how to ask cmake to only look for 32 bit
libraries in FindPackage() class. I have all the 32bit library (Qt)
dependencies installed and they are in /usr/lib/i386-linux-gnu. By
adding the -m32 option compilation succeeds but as expected linking
fails complaining that i am trying to link to 64 bit libraries.

So, how do i ask cmake to look for 32bit libs?


I personally haven't found a good solution for this either.

What I currently do is the following
set(CMAKE_SYSTEM_PROCESSOR i386)
set(CMAKE_SYSTEM_LIBRARY_PATH /lib32 /usr/lib32 /usr/local/lib32)
set(FIND_LIBRARY_USE_LIB64_PATHS OFF)
set(CMAKE_IGNORE_PATH /lib /usr/lib /usr/local/lib)

Unfortunately the CMAKE_IGNORE_PATH is required. I created a bug about this.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Why does CMake use relative linking when I replace a shared object?

2011-11-25 Thread Mathias Gaunard

There is some strange CMake behaviour I don't quite understand.

In the project attached, I build a shared library for which I want to 
specify a custom build command; to do this I generate a dummy library 
which I then replace by another file in a POST_BUILD command 
(alternatives involving imported libraries do not work properly across 
different scopes).


If I do not replace the library, then the executable correctly links 
against libtest.so.
If I do, it links instead with ../baz/libtest.so (sic), which of course, 
fails when trying to run the program.


Why is it putting a relative path into my executable? Why is it 
different depending on whether I replace the .so by another one or not?


Thank you very much for any insight on what's happening.


test.tar.gz
Description: GNU Zip compressed data
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Why does CMake use relative linking when I replace a shared object?

2011-11-25 Thread Mathias Gaunard

On 11/25/2011 07:19 PM, Michael Hertling wrote:


That's caused by the absence of an SONAME in your baz/libtest.so. If
there's no DT_SONAME tag in a shared library you are linking against,
the linker will write a DT_NEEDED tag to the resulting binary which
points to the library as it has been specified in the linker command
line, i.e. ../baz/libtest.so in your case; examine with readelf -d.
Then, of course, libtest.so can be found only if the search starts in
the appropriate directories, e.g. in bar since it's a sibling of baz:
cd bar  ./foo works. If there is an DT_SONAME tag in the library,
the linker uses this to set the DT_NEEDED tag in the resulting binary,
and CMake places an SONAME in each shared library by default, even if
the VERSION/SOVERSION property isn't specified. See [1] for a related
discussion. If you really want to create a shared library by yourself,
do it right, e.g. with


Thank you very much for the information.
I had no idea shared objects had that kind of behaviour.



and note that PRE_BUILD is actually PRE_LINK for Makefiles,


I know, just using PRE_BUILD because it looks better when compared to 
POST_BUILD.




LIBRARY_OUTPUT_PATH has been obsolete for a long time, and
the LINK_DIRECTORIES() command means asking for trouble.


I was wondering if those variables could be affecting the base directory 
used in the RPATH or other so-related things.




[1] 
http://www.mail-archive.com/cmake-wChDC6UyXvPYtjvyW6yDsg@public.gmane.org/msg33482.html


Doesn't seem to work :(

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Do not build/install import library

2011-11-24 Thread Mathias Gaunard

On 11/23/2011 10:14 PM, Matthias Gehre wrote:

Hi,

thanks for this very nice cmake. I switched just recently to get
lightspark (lightspark.github.com)
crossplatform, and it worked really smooth.

One question, though: I cannot seem to find a way to _not_
build/install the import libraries (foobar.dll.a) on win32.
I do not need them, because I'm using MinGW's direct linking feature.
All I found was ways to
rename it, but not to keep it from building.


Use the MODULE type of library
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Libraries with custom build command

2011-11-14 Thread Mathias Gaunard

What is the recommended way to define libraries with custom build commands?

This trick seems to be the only way:

if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp)
  file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp)
endif()
add_library(foo dummy.cpp)
add_custom_command(TARGET foo POST_BUILD
   COMMAND my command to replace the dummy libfoo
  )

Is it normal that kind of thing is not possible with IMPORTED libraries?
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Setting the directory associated with a target

2011-08-22 Thread Mathias Gaunard

Hi,

I've recently moved from using the simple Makefile generator to the 
Eclipse CDT one, and I have noticed that targets only appear in the 
directory in which they were created.


Is there a way to specify which directory a target should appear in?

I tend to define parent targets when the first child target is 
created, which means it doesn't appear in the right place.

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Unable to locate boost_unit_test_framework-vc90-mt-gd-1_45.lib

2011-08-14 Thread Mathias Gaunard

On 08/12/2011 03:48 PM, Stephen Torri wrote:

Using Mathias and Fraser's guidance I made the changes to the
CMakeLists.txt file for the test directory.


-DBOOST_ALL_NO_LIB is how I would have fixed it, but I guess that should 
work.




That removed the error
that but now I have 9 unresolved external symbols even though the
boost unit test framework library is listed in the Linker options for
the test executable. Is this more of a problem with how I built Boost
than a CMake issue?


You didn't link test with mycode.



The Boost lib directory only has .lib files in it.
I guess those are static libraries.


As I already told you, .lib is both for static and import libraries 
(what you have to link against to use a DLL).

This is not CMake-specific, this is a windows thing.
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Unable to locate boost_unit_test_framework-vc90-mt-gd-1_45.lib

2011-08-11 Thread Mathias Gaunard

On 08/10/2011 04:27 PM, Stephen Torri wrote:


LNK1104: cannot open file 'boost_unit_test_framework-vc90-mt-gd-1_45.lib'
I have boost installed in C:\boost. The FIND_BOOST macro able to find
the installation headers and libraries I require. The only thing that is
different is that the directory has the Boost unit test framework named as:
C:\boost\lib\libboost_unit_test_framework-vc90-mt-gd-1_45.lib
That name, libboost_unit_test, is different from the expected name
of boost_unit_test...
I am at a loss as to why this is the case.


The difference between the version with the lib and the one without is 
that one is a static library and the other is an import library for a DLL.


That kind of error probably comes from the fact that Boost does 
auto-linking with MSVC and that the library you've selected with CMake 
does not match what the header expects.


In any case, the documentation of FindBoost covers this.
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Weird behaviour with CPackComponent and NSIS

2011-08-09 Thread Mathias Gaunard
I've recently upgraded to CMake 2.8.5 to try out the new 
CPack/CPackComponent separation, which allows me to include 
CPackComponent to get the various cpack component macros, but only 
include CPack later.


I end up with very strange things happening, which I haven't been able 
to debug.


What I did, is that instead of including CPack at the beginning of my 
project, I included CPackComponent instead, and included CPack at the end.
I want to be able to do this so that I can use 
CPACK_NSIS_EXTRA_INSTALL_COMMANDS, among others.



For some unknown reason, some of my components end up flagged as 
downloadable, and when I run cpack it then fails because I don't have 
the NSIS plugin to support this.


If I unset the CPACK_COMPONENT_MYCOMPONENT_DOWNLOADABLE, then it doesn't 
happen, but the files from that component do not get installed.


This is especially strange because it only affects some components but 
not others.
I have a fairly complicated CMake project with a lot of add_subdirectory 
and recursive functions that include files, so I wonder if it doesn't 
get confused by the scoping somehow.


Are there any known problems with the new CPackComponent approach?
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Launching a script after user picks components in component-based installers

2011-07-03 Thread Mathias Gaunard

On 07/03/2011 06:13 PM, Eric Noulard wrote:


The post-install step currently depends on the CPack generator you use.

Doing such thing in a portable/cross-platform way would need to suppose
you have a portable tool at hand **AT INSTALL TIME**.

It would be logical to require CMake and may be embbed a CMake script
like in the
INSTALL(SCRIPTfile  ...)
Note that if you do this you'll get packages that require more than today,
since currently you may install your binary DEB or RPM or NSIS
even if CMake is not installed


I would be fine installing the dependencies myself, or run an executable 
that I have previously installed instead of a script.




Whatever the solution one would need the support for the packaging system
(RPM, DEB, NSIS, ...) which makes it possible to execute something at
install time.
This is doable with RPM, DEB, I'm pretty sure it should be possible
with NSIS too
(but I'm no NSIS expert)


It seems the NSIS generator provides a CPACK_NSIS_EXTRA_INSTALL_COMMANDS 
variable that could be used to launch an executable.


RPM, PackageMaker and Bundle have variables to define scripts (some 
allow pre/post install/uninstall/upgrade).


But I think it would be very nice if all of this could be unified, and 
I'd like to have that ability for STGZ and DEB generators as well 
(though I don't use the DEB generator atm because it doesn't support 
component installation).



, however most archive generators (ZIP, TGZ,

TBZ2, ...) won't
provide enough support for that.


Not a big issue to me.
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Launching a script after user picks components in component-based installers

2011-07-02 Thread Mathias Gaunard
With a component-based installer such as NSIS, the user can choose the 
components that he wants to install.


I would need to launch a script (just launching an external program 
would do) after this, telling me where the application was installed, so 
that I can perform additional actions depending on which components were 
installed or so I can autoconfigure the application according to the 
system settings.


Does CMake/CPack allow to do something like this?

I see that RPM appears to allow to specify a shell script for post 
install, but I'd like to have something that works for all 
component-based CPack generators, and all operating systems.

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Dependencies and libraries..How does it work?

2011-06-17 Thread Mathias Gaunard

On 16/06/2011 23:54, David Springate wrote:


I have the following:
A library called MY_LIB that builds with a cmake command (I have created
a nice CMakeLists.txt file)


What do you mean a cmake command? add_custom_target?

If that's how you generate your library then you need CMake 2.8.4 or 
later for dependencies to work correctly.

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake