[CMake] Capturing/processing output of the ADD_TEST command

2010-07-28 Thread Emmanuel Blot
Hi,

I'd like to run some static analysis tool from CTest. (2.8.1)

I've added enable_testing() and add_test() calls in my CMakeLists.txt
file, and the static analysis tool is invoked as expected, however:
  * CTest discards both the tool standard output and tool standard
error stream when ran with no option, which makes the purpose of the
analysis useless;
  * CTest preserves both tool stream outputs when run with the -V
option, but add its own output messages to the resulting info, which
makes the analysis output nearly impossible to read.

1/ Is it possible to keep the standard error stream from the tool and
to discard CTest ouput and the tool's stdout ?
2/ It does not seem CTest follows the same convention as CMake's
ADD_CUSTOM_COMMAND which accepts an 'ARGS' argument and stream
redirection (using '>'). What's the equivalent syntax in CTest?

Thanks,
Manu
___
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] Issue with CMakeDetermineASMCompiler.cmake on 2.8.3

2011-01-10 Thread Emmanuel Blot
Hello,

I'm not sure if this issue has already been reported, but ithe
following command:
  ENABLE_LANGUAGE (ASM-ATT OPTIONAL)
Triggers the following error, starting at CMake 2.8.3 (worked well up to 2.8.2):

CMake Error at
cmake/Modules/CMakeDetermineASMCompiler.cmake:68
(CMAKE_DETERMINE_COMPILER_ID_VENDOR):
  Unknown CMake command "CMAKE_DETERMINE_COMPILER_ID_VENDOR".
Call Stack (most recent call first):
  cmake/Modules/CMakeDetermineASM-ATTCompiler.cmake:19 (INCLUDE)
  CMakeLists.txt:100 (ENABLE_LANGUAGE)

CMake Error: Error required internal CMake variable not set, cmake may
be not be built correctly.
Missing variable is:
CMAKE_ASM-ATT_COMPILER_ENV_VAR
CMake Error: Could not find cmake module
file:CMakeFiles/CMakeASM-ATTCompiler.cmake
-- Configuring incomplete, errors occurred!
Compilation failed

It seems that adding the following patch fixes the issue:

Index: CMakeDetermineASMCompiler.cmake
===
--- a/CMakeDetermineASMCompiler.cmake 2010-12-07 23:49:13.0 +0100
+++ b/CMakeDetermineASMCompiler.cmake 2010-12-07 23:49:03.0 +0100
@@ -65,6 +65,7 @@
   SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_GNU "--version")
   SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_GNU "GNU assembler")

+  INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
   CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT})

   IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)

Cheers,
Manu
___
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] FIND_PROGRAM w/ CMake 2.8.2 and Cygwin

2011-01-10 Thread Emmanuel Blot
Hello All,

I've just bumped into an issue with Cygwin.

I have not compiled with CMake and Cygwin for a while, so I'm not sure
where the problem comes from (Cygwin, CMake, or the combination of
both).

The following command used to work on all platforms (Linux, Mac OS X, Cygwin):
  FIND_PROGRAM (xcc arm-eabi-gcc)
but now, with Cygwin, the command fails to locate the executable which
is in the path indeed.

IF I had the Windows executable suffix (.exe), it works:
  FIND_PROGRAM (xcc arm-eabi-gcc.exe)
Obviously, the "fix" is not portable and will break on any non-Windows platform.

Some questions:

1/ Is this a known issue / new regression?
  I have not been subscribed to the ML for a while, and I can't find a
decent way to search through the ML archives,
http://www.cmake.org/pipermail/cmake/ does not offer a search
function. Sorry if the question has already been answered (let me know
if it is)
2/ What is the best way to circumvent this issue?
3/ Am I missing something obvious?

Note: "CMAKE_EXECUTABLE_SUFFIX" is defined to the empty string on
CMake 2.8.2/Cygwin, which seems wrong as well.

Cheers,
Manu
___
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] Cross-compiling a static library (CMake 2.8.3)

2011-01-10 Thread Emmanuel Blot
Hello,

Using the ADD_LIBRARY command for a static library (.a), how to tell
CMake to use the ranlib tool for the target, not the default one for
the host?

I'm getting the following warning message:

cd watchdog && /usr/local/Cellar/cmake/2.8.3/bin/cmake -E
cmake_link_script CMakeFiles/nd_watchdog.dir/link.txt --verbose=1
/usr/bin/ar cr libnd_watchdog.a  CMakeFiles/nd_watchdog.dir/src/nd_watchdog.c.o
/usr/bin/ranlib libnd_watchdog.a
/usr/bin/ranlib: warning for library: libnd_watchdog.a the table of
contents is empty (no object file members in the library define global
symbols)

I'd like to use our dedicated arm-eabi-ranlib tool instead.

Cheers,
Manu
___
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] Cross-compiling a static library (CMake 2.8.3)

2011-01-10 Thread Emmanuel Blot
> I'm getting the following warning message:

>From http://www.cmake.org/pipermail/cmake/2010-September/039705.html,
it seems on my development environment that _CMAKE_TOOLCHAIN_PREFIX is
left empty.

If I force this variable to the expected value (arm-eabi-), the proper
tools are detected and invoked as expected.

However, _CMAKE_TOOLCHAIN_PREFIX is an CMake internal variable. Is
there a better way to define it?

Cheers,
Manu
___
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] Fwd: Cross-compiling a static library (CMake 2.8.3)

2011-01-10 Thread Emmanuel Blot
Oops, I forgot to post to the ML

-- Forwarded message --
From: Emmanuel Blot 
Date: 2011/1/10
Subject: Re: [CMake] Cross-compiling a static library (CMake 2.8.3)
To: Bjørn Forsman 


> I haven't used that one before. The docs say it should be used
> when CMake is not able to detect the compiler ID. Is that the case here?
> Have you tried "set(CMAKE_C_COMPILER arm-linux-gcc)"?

I will try.
This is a recurrent issue with CMake (I'm not blaming anyone here, but
I faced similar issues many times): it evolves (which is great !), but
it is quite common to encounter some kind of regressions even with
"patch level" releases. As the exact version of cmake varies from one
machine to another, it is really hard to write CMakeFiles.txt and keep
them in sync to keep them working while CMake evolves. At least with
cross-compilation projects.

I can't remember the reason for the "FORCE_C_COMPILER", so it may not
been required or even recommended anymore. If I can get rid of it, I
will.

>> Maybe the version number is the source of the trouble ?
> The docs say that the signature is
> CMAKE_FORCE_C_COMPILER( )
> so maybe something bad happens when you give it that extra
> argument "4"? Try without "4"?

Ok. I don't know why I added '4', maybe it's a left over syntax from
early CMake versions, or I copied a wrong sample file somewhere. It
has been there for 2 or 3 years though ;-).

Thanks a lot for your help,
Manu
___
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] Cross-compiling a static library (CMake 2.8.3)

2011-01-10 Thread Emmanuel Blot
> The docs say that the signature is
> CMAKE_FORCE_C_COMPILER( )
> so maybe something bad happens when you give it that extra
> argument "4"? Try without "4"?

Actually, it changes nothing.

*but* if I remove the specific version number for the compiler, i.e. I define

FIND_PROGRAM (xcc ${XTOOLCHAIN}-gcc)
instead of
FIND_PROGRAM (xcc ${XTOOLCHAIN}-gcc-${XCC_VER})

then the proper ranlib tool is called.

In other words (I double-check with MESSAGE (STATUS "PREFIX:
${_CMAKE_TOOLCHAIN_PREFIX}")), if no GCC version is specified, the
toolchain prefix is detected, however if a specific compiler version
is specified, the toolchain prefix is empty.

There's may be a limitation with the syntax matching rule here. Should
I log a bug ?

Cheers,
Manu
___
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] Cross-compiling a static library (CMake 2.8.3)

2011-01-10 Thread Emmanuel Blot
>> INCLUDE (CMakeForceCompiler)
>> CMAKE_FORCE_C_COMPILER (arm-eabi-gcc-4.5.2 GNU 4)
>
> I haven't used that one before.

FWIW: I found why I use CMAKE_FORCE_C_COMPILER rather than the simpler
CMAKE_C_COMPILER command:
I build projects for eCos from outside the eCos tree directory, and
CMake has some trouble finding the eCos header files when simply using
CMAKE_C_COMPILER. It complains about CMAKE_FIND_ROOT_PATH which is
nevertheless defined as expected.

Cheers,
Manu
___
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_PROGRAM w/ CMake 2.8.2 and Cygwin

2011-01-11 Thread Emmanuel Blot
> Manu,
> please maintain the discussion on the mailing list as these is a general issue

Sure, sorry (actually I replied to your PM, I have not seen it did not
contain a cc: to the ML)

> if you are cross compiling, the target is not cygwin, so CYGWIN is not 
> defined.

Ok, understood.

> However on cygwin both
> arm-eabi-gcc-4.5.2.exe
> arm-eabi-gcc-4.5.2
> are valid program names and you can call them.

It seems that FIND_PROGRAM fails to locate the .exe-less syntax when
cross-compiling is enabled, at least.

Cheers,
Manu
___
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] New warnings in CMake 2.8.4-rc2

2011-02-02 Thread Emmanuel Blot
Hello,

How to disable the new warnings CMake 2.8.4-rc2 emits, such as the
following ones?

CMake Warning: The variable, 'NAMEFUNC', specified manually, was not
used during the generation.
CMake Warning: The variable, 'SAJOBS', specified manually, was not
used during the generation.
CMake Warning: The variable, 'TAG_RELEASE', specified manually, was
not used during the generation.
CMake Warning: The variable, 'USER_COMPONENTS_PATH', specified
manually, was not used during the generation.
CMake Warning: The variable, 'XCC_VER', specified manually, was not
used during the generation.

Is there a POLICY switch to enable/disable this new feature?

Thanks,
Manu
___
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] New warnings in CMake 2.8.4-rc2

2011-02-02 Thread Emmanuel Blot
> Currently, there is no way to turn this off.

Very, very bad news ;-(
IMHO, this is a recurrent issue with CMake. It seems there is no way
to guarantee that a project that builds well with a version of CMake
will build the same way with the next minor iteration (used to be
called "patch release").
Adding new options, new error detections to CMake is great, but
turning on these new features by default is often a source of issues.
We cannot control which minor release of CMake a client uses to build
up an application. Controlling a major version is ok (2.6 vs. 2.8),
but controlling a patch release is impossible, as CMake gets
automatically updated in Linux distributions, for example.

> Are the warnings valid? It
> means you are giving -D options on the command line, and those variables are
> never touched in the project.  Seems like you would not want to use them
> anymore.

It seems, but it is not always the case.
For example, the same command line parameters may be given to several
CMake scripts, and depending on the script, the script may or may not
use them. It's far easier do to this way rather than specifying a very
specific command line for every single project.

> The idea was to catch misspelled words.

The idea is definitely nice, but why do not turn on this kind of new
policies on explicit request (either with a new option switch and/or a
new POLICY statement) as long as CMake does not reach a new major
milestone?
Dealing with the constant modifications of CMake options is a tough
job for a software maintainer, I believe.

So if I understand it right, the only way to keep the project building
without new warning is to tweak the way CMake is invoked. Trouble is,
does CMake 2.8.0 accept the -- disable warning option switches?

In other words, how should I invoke CMake so that it can build the
same, existing projects whatetever the actual CMake 2.8.x release ?

Thanks,
Manu
___
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] Cross-compiling a static library (CMake 2.8.3)

2011-02-07 Thread Emmanuel Blot
>> FWIW: I found why I use CMAKE_FORCE_C_COMPILER rather than the simpler
>> CMAKE_C_COMPILER command:
>> I build projects for eCos from outside the eCos tree directory, and
>> CMake has some trouble finding the eCos header files when simply using
>> CMAKE_C_COMPILER. It complains about CMAKE_FIND_ROOT_PATH which is
>> nevertheless defined as expected.

Sorry to get back so late on this topic

> You should not need to use CMAKE_FORCE_C_COMPILER() for eCos.
> Can you please post some more details on your setup ?

I build eCos-based projects for ARM. The compiler prefix is "arm-eabi-"

The basic directory layout is as follows:

ecos/ : contains the std eCos "packages" subdir, etc.
sdk/  : contains our base code, that builds against eCos

build/ : where all the code is built (out-of-source build), that is:
  build/ecos_build
  build/ecos_install
  build/sdk ...

> Where is the eCos tree with libtarget.a etc. ?
  build/ecos_install/lib/libtarget.a
  build/ecos_install/include/pkgconf/system.h

> How does your toolchain file look like ?
arm-eabi-gcc-4.5.2 (on Linux, Mac OS X), arm-eabi-gcc-4.5.2.exe (on Cygwin)
all other toolchain tools are prefixed with arm-eabi- as well

> How do you call cmake ?

>From a shell script. A simplified version of the command line would be
(TOPDIR does not exist, TOPDIR is actually the absolute path to the
startup directory)

TOPDIR=$PWD
(cd build/sdk &&
 cmake -DCMAKE_FIND_ROOT_PATH=$TOPDIR/build/ecos_install \
   -DSDK_PATH=$TOPDIR/build/sdk/install -DCMAKE_BUILD_TYPE=DEBUG \
   -DPYTHON=/usr/bin/python2.6 ../../sdk && /usr/bin/make install)

I also define:

  SET (CMAKE_SYSTEM_NAME eCos)
  SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
  SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY LAST)
  SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE LAST)

(again, I can't remember why I selected "LAST" at some point in the
past, but "ONLY" led to some other issues)

When I drop CMAKE_FORCE_C_COMPILER and replace it with
CMAKE_C_COMPILER, I get the following error message

Building sdk in DEBUG
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/local/homebrew/bin/arm-eabi-gcc-4.5.2
CMake Error at 
/usr/local/homebrew/Cellar/cmake/2.8.4-rc2/share/cmake/Modules/Platform/eCos.cmake:36
(MESSAGE):
  Could not find eCos pkgconf/system.h.  Build eCos first and set up
  CMAKE_FIND_ROOT_PATH correctly.
Call Stack (most recent call first):
  
/usr/local/homebrew/Cellar/cmake/2.8.4-rc2/share/cmake/Modules/CMakeSystemSpecificInformation.cmake:36
(INCLUDE)
  CMakeLists.txt:2 (PROJECT)


Best Regards,
Emmanuel
___
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] New warnings in CMake 2.8.4-rc2

2011-02-17 Thread Emmanuel Blot
> The only warning that is enabled by default is to warn you about
> misspelled -D options that you pass on the command line. (We think
> they *may* be misspelled because they are not referenced in the
> configure/generate steps... So it's just a warning.)

> You can suppress this by also passing "--no-warn-unused-cli" on the
> CMake command line. Or by avoiding passing in the unused variables in
> the first place. Or by sticking with CMake 2.8.3 that does not produce
> this warning.
>
> Those are your 3 options for avoiding this warning.

The question is HOW do you "stick with cmake 2.8.3" - or stick with cmake 2.8.4.

This is the actual issue: there's no way to "stick with" a minor
release of cmake when you distribute code, because you cannot enforce
a minor release of cmake (a regular linux distribution will upgrade
the minor version at some point, and this cannot be controlled). So at
some point somewhere, building with cmake will throw new warnings, and
there's no way to control this. As the  "--no-warn-unused-cli" option
would simply break the build with a previous minor release of CMake,
this means that the script calling CMake needs to detect the version
of cmake, and tweak the cmake command line accordingly. Dirty, at
best.

>From my perspective - that I understand is not shared - it would have
been great not introducing this kind of compatibility break between
CMake minor release by default. It could have been enabled with a new
POLICY or with an explicit option switch.

Maybe I'm looking in the wrong direction: is there a way to specify
these variable definitions without the -D option switch? - such as
environment variables for example?

Thanks.
___
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] New warnings in CMake 2.8.4-rc2

2011-02-18 Thread Emmanuel Blot
-- Forwarded message --
From: Emmanuel Blot 
Date: Fri, Feb 18, 2011 at 11:48 PM
Subject: Re: [CMake] New warnings in CMake 2.8.4-rc2
To: David Cole 


> If a variable is not used, then simply do not define it on the cmake
> command line.

Thanks, but I simply can't. If I could, I would have done it since 2.8.4-RC1 ;-)

Basically, we call several CMake projects from the same shell scripts,
and each CMake invokation receive the same set of global parameters.
The same way you can invoke a compiler with several -D options and
safely ignore the definitions you do not care about. Or the same way
you can place as many variables as you want in the environment and let
a program decides whether it "wants" to use it or not. I'm looking for
the same feature for CMake. I used to do it with -D option switch, it
seems I can't do it anymore.

> The other option is simply to ignore all of our "was not used" output.
> They are only warnings. They do not actually affect the generated
> build tree.

But we just don't want warnings. False warnings simply distract the
developer that have no choice but start ignoring them - and fail to
detect real and useful ones.

> I guess I don't understand your "big picture" here. It seems to me
> that it should be easy to resolve this one way or another, even if
> it's not pretty and elegant.

Sure. I'm just looking to invoke CMake with a set of variables, some
of which being useful for a given CMake script, some others being
safely ignored - as they used to be, BTW. How to do this?

"make" accepts a random list of definitions:
 make key1=value1 key2=value2 ...

"gcc" accepts a random list of definitions:
 gcc -DKEY1=value1 -DKEY2=value2

What is the equivalent way of passing such arguments to a CMake script ?

Thanks
Emmanuel.
___
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] Fwd: New warnings in CMake 2.8.4-rc2

2011-02-22 Thread Emmanuel Blot
> echo -e 'IF (NOT CMAKE_VERSION VERSION_LESS 2.8.4)\nMESSAGE(STATUS
> --no-warn-unused-cli)\nENDIF (NOT CMAKE_VERSION VERSION_LESS 2.8.4)" >>
> cmake_since_2.8.4.cmake
>
> EXTRA_CMAKE_ARGS=$(cmake -P cmake_since_2.8.4 | sed 's/^-- //')
>
> HTH
>
> Eike

Thanks, Eike.

As I already test the CMake version to warn the user about issues tied
to specific CMake versions in a script, I've added the following code
to it:

   CMK_CLIWARN=`${CMAKE} --help | grep "no-warn-unused-cli"`
   if [ -n "${CMK_CLIWARN}" ]; then
       CMAKEOPT="${CMAKEOPT} --no-warn-unused-cli"
   fi

Cheers,
Manu.
___
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] multi-line definitions

2008-09-17 Thread Emmanuel Blot

Hi,

Is it possible to write variable definition directives using multiple  
lines, i.e.


I have a long definition string such as:
SET (CMAKE_C_FLAGS_RELEASE "-mcpu=arm7tdmi -std=gnu99 -fgnu89-inline - 
finline-functions -ffunction-sections -fdata-sections -fno-strict- 
aliasing -mno-thumb -Os -s -fomit-frame-pointer -DNDEBUG")


How can I split this line (so that it fits into 80 column pages) ?

Thanks,
Manu

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] multi-line definitions

2008-09-23 Thread Emmanuel Blot

The only way would be something like this:

set(a "-mcpu=arm7tdmi -std=gnu99 -fgnu89-inline -finline-functions")
set(a "${a} -ffunction-sections -fdata-sections ")
set(a "${a} -fno-strict-aliasing -mno-thumb -Os -fomit-frame-pointer")


Ok thanks. Not really handy, but better than nothing ;-)

It would be great if CMake supported a true multi-line option, even a  
basic one like the \ escape char.


Cheers,
Manu

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] ASM issue: regression from 2.6.0 to 2.6.2?

2008-10-13 Thread Emmanuel Blot

Hi,

I've just upgrade from CMake 2.6.0 to CMake 2.6.2.

All our C projects that relies on some assembler file (ARM assembly)  
are now broken.
I'm not sure about what has changed in CMake so that ASM stopped to  
work.


The 3 CMakeASM* files look identical (between 2.6.2 and 2.6.0), we use  
"ATT-"ASM


We use the following statement, to override the default ASM definitions:

SET (CMAKE_ASM-ATT_COMPILE_OBJECT  "  - 
c -o  ")


However, it seems these directives are no longer used, but ignored.

For example, compiling a .s file leads to the following CMake  
invokation of the GCC frontend:


arm-elf-gcc  -Isrc -Wall  -o CMakeFiles/src/mpopt.s.o src/mpopt.s

the CMAKE_ASM-ATT_COMPILE_OBJECT is no longer used, therefore the "-c"  
flag is not passed to the compiler, which in turns try to link the  
resulting object file.


Any help would be greatly appreciated,

Thanks,
Emmanuel

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ASM issue: regression from 2.6.0 to 2.6.2?

2008-10-14 Thread Emmanuel Blot


On 14 Oct 2008, at 01:22, Alexander Neundorf wrote:


Any help would be greatly appreciated,


I'll have a look at it in the next days.
Can you send a small example which fails ?


Don't worry, I think I found the root cause: the trouble seems to come  
from the order of the SET() statement in the various  
CMakeLists.txt files of the project.


I should say that I'm quite not sure about the order of such  
definitions relative to the 'PROJECT' and other 'ADD_EXECUTABLE' and  
'ADD_LIBRARY' statements.


I've reworked the declaration order and now it works for both 2.6-0  
and 2.6-2


Is there any documentation about the order of such statements and the  
difference between the various syntaxes, such as:


 vs.
@CMAKE_C_FLAGS@ vs.
 ?

as I'm really confused about these declarations.

Thanks a lot,
Emmanuel

ps: I can send you the pair of CMakeListst.txt files I use for this  
project, if you want/need to.


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Merging static libraries

2008-10-14 Thread Emmanuel Blot

Hello,

I don't know how to resolve a dependency issue.

I use CMake to build several static libraries (cross-compilation for  
ARM target)
I've added some custom commands to merge the object files of several  
libraries (.a files) into a single static library.


However, I don't know how to tell CMake to run this custom command  
once all the primary libraries have been built, i.e. that the 'global'  
library depends on the primary libraries. Without this explicit  
dependency, CMake sometimes attempts to build up the global libary  
before the primary libraries are generated.


I tried to add an explicit dependency between the global library and  
the primary libraries files, but it seems that CMake does not "see"  
the target of an ADD_LIBRARY directive as a target file.


How can I achieve this with CMake ?

Thanks,
Emmanuel

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Merging static libraries

2008-10-14 Thread Emmanuel Blot
Do you actually have to build them as separate static libs or could  
you just

build one big static lib ?


No I really can't do otherwise (for various reasons)


Please post the code which didn't work for you.


So basically, the project tree structure is as follow:

sdk/
   CMakeLists.txt  (A)
   drivers/
   CMakeLists.txt  (B)
   driver1/
  CMakeLists.txt (C)
   include/
   src/
   driver2
  CMakeLists.txt
   include/
   src/
   
   userlibs/
  userlib1
  userlib2
  

(A) contains all the global rules for the projects (compiler defs,  
macros, etc.
(B) simply contains a list of the subproject to build, and the call to  
the macro that merges (driver1, driver2, ...) into the "global" library

(C) contains the rules to build a single component (ADD_LIBRARY...)


-

(C) typical:

ADD_LIBRARY (ns_crc
 src/ns_crc.c)


-

(B):

# the "global" static lib to build
PROJECT (drivers)

# subproject to build
FILE (GLOB components RELATIVE ${neosys_SOURCE_DIR} ns_*)

# build all subprojects
FOREACH (project ${components})
  ADD_SUBDIRECTORY (${project} ${project})
ENDFOREACH (project)

# install libraries and public header files
create_package (drivers ${CMAKE_CURRENT_BINARY_DIR} ${components})


-

(A) is quite big, but the relevant macro is:


MACRO (create_package)
  SET (args ${ARGV})
  # first arg is the "global" lib name,
  # second arg is the "global" lib binary directory
  # remaining args are the subprojects
  LIST (GET args 0 plprj)
  LIST (GET args 1 pldir)
  LIST (REMOVE_AT args 0 1)
  # if there is no input library, do not try to build a package
  SET (wkdir ${pldir}/tmp)
  FILE (MAKE_DIRECTORY ${wkdir})
ADD_CUSTOM_TARGET (${plprj}-collect ALL
   COMMAND rm -f *
   COMMAND find .. -name "*.a" -exec ${xar} -x {}  
\;
   # this directive seems to work for all but one  
subproject, which is build AFTER this custom target is built

   DEPENDS ${args}
   VERBATIM
   WORKING_DIRECTORY ${wkdir}
   COMMENT "Collecting components for ${plprj}.a")
ADD_CUSTOM_TARGET (${plprj}-archive ALL
   COMMAND ${xar} -r -c ../lib${plprj}.a *
   COMMAND rm -f *
   WORKING_DIRECTORY ${wkdir}
   COMMENT "Assembling package ${plprj}.a")
ADD_DEPENDENCIES(${plprj}-archive ${plprj}-collect)
  INSTALL (FILES ${pldir}/lib${plprj}.a DESTINATION $ 
{SDK_INSTALL_DIR}/lib)

ENDMACRO (create_package)


Thanks,
Emmanuel

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ASM issue: regression from 2.6.0 to 2.6.2?

2008-10-14 Thread Emmanuel Blot

Yes, please.
The one which works and also the one which doesn't.


Ok, I need to recover the old one from SVN.
I guess it is not worth posting it to the ML, should I send you a  
private message ?


Thanks,
Emmanuel.

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Merging static libraries

2008-10-14 Thread Emmanuel Blot


On 15 Oct 2008, at 00:29, Emmanuel Blot wrote:



Please post the code which didn't work for you.


Ooops, sorry, I found the error: there was a typo in the  
ADD_LIBRARY(name ...) "name" parameter, which led to an invalid  
dependency.


Very sorry for the noise,

Emmanuel

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Merging static libraries

2008-10-15 Thread Emmanuel Blot
Well, sometimes just explaining the problem to somebody already  
helps :-)


It does, yes. Thanks again.

The fact is that this library "merging" thing has been existing for a  
while. I've changed a directory name and forgot to update the  
CMakeListst.txt file accordingly.
The error looked really like another issue I've never been able to  
track down (see below), so I thought I finally had a way to track down  
the issue. Truth is that I got it wrong: two issues were not related ;-)


The error I can't resolved is something that only occurs on Linux  
Ubuntu hosts.
Our CMakeListst.txt files do work on Cygwin, Linux Debian & Mandriva,  
and Mac OS X. But it sometimes fails on Linux Ubuntu.
It looks like a dependency inversion, although I still need to  
investigate the actual error: sometimes the generated "merged" library  
contains code from previous builds, i.e. like if the library merge  
were occurring before the actual compilation of the unit libraries...


The only difference I can think of between Ubuntu and other hosts is  
the shell: Dash (100% POSIX) vs. Bash. But I don't see how this could  
impact the results of a CMake/Makefile build sessions. This is really  
weird...


Cheers,
Manu

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] CMake 2.6.3 small installation issue on OS/X

2009-02-23 Thread Emmanuel Blot
The installer for CMake 2.6.3 fails to create symbolic links on OS/X  
if links already exist (from a previous installation, e.g. CMake 2.6.2  
on my machine)

It pops up one error box for each link it fails to create.

Cheers,
Manu

On 23 Feb 2009, at 19:16, Bill Hoffman wrote:


On behalf of myself, Ken, Brad, Dave, Alex and the rest of the
CMake team, we are pleased to announce that CMake 2.6.3 is
available for download at:

 http://www.cmake.org/cmake/resources/software.html

The documentation for 2.6.3 can be found here:

 http://www.cmake.org/cmake/help/documentation.html

If you have any problems or find any bugs, please report them at
www.cmake.org/Bug.

A full list of changes for the 2.6 release tree can be found here:

 http://www.cmake.org/files/v2.6/CMakeChangeLog-2.6.3

Some notable changes are:

- Add parenthetical expressions to if
- Improve scoping of policies (see cmake_policy and CMP0011)
- Teach find_package more config file locations
- Many improved Find scripts in Modules
- Added an unset command
- Qt cmake-gui is the primary GUI for windows, deprecate CMakeSetup
- Better reporting when nmake compiler environment is not correct
- lots of bug fixes


Thanks, Bill


___
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


___
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] Help with cmake_policy

2009-02-26 Thread Emmanuel Blot

Manu, are you actually cutting release snapshots for the customer and
delivering them outside your version control trunk?  In that case you
can make -Wno-dev the default by adding


We deliver SDKs, however CMake binaries are not bundled along with our  
SDKs.


A SDK that builds w/o a single warning message in our premises may  
throw "unexpected" warning messages when a client builds it with a  
newer CMake version (patch-release). I'd really like to avoid this  
kind of trouble.


It would be ok to get a single line about missing policy, but the  
current warning messages do look scary.



 if(NOT DEFINED CMAKE_SUPPRESS_DEVELOPER_WARNINGS)
   set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS 1 CACHE INTERNAL "No dev  
warnings")

 endif()


Yeah, this could be an option.

I agree with Alexander though: it would be nice to get a less scary  
warning message when a new policy is yet to be defined.


BTW, it would be nice to get a *single* warning message about the  
experimental status of assembly language support:
for now, if a project contains N subprojects (library, executable)  
using ASM, CMake throws N identical warning messages.


Thanks for your help,
Manu

___
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] Executable and library dependencies

2009-05-05 Thread Emmanuel Blot
Doing in-source builds is generally considered a bad idea.  
Instead do

something like:

   ADD_SUBDIRECTORY (${prj} ${prj}/build)


Huh? That snippet above has absolutely nothing to do with in- 
source vs.

out-of-source builds. He simply accumulates all his subprojects in a
variable instead of listing each with its own add_subdirectory call.


I disagree. From the docs:

add_subdirectory: Add a subdirectory to the build.


Heh, didn't see the second argument :)


I always do out-of-source builds, believe me.

${prj} is a relative path, not an absolute path

in other words, I guess CMake interprets the command as

ADD_DIRECTORY (${CMAKE_CURRENT_SOURCE_DIR}/${prj} $ 
{CMAKE_CURRENT_BINARY_DIR}/${prj})


using ${prj}/build would be a bad idea, as every subproject would  
construct a build directory within the source tree.


all the subprojects are built into a build/ tree which is fully  
external from the source tree


Cheers,
Manu

___
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] Executable and library dependencies

2009-05-05 Thread Emmanuel Blot

Ideally you wouldn't use linker flags, but just use the target you've
created via add_library. But I guess that doesn't work with the  
start-group

stuff. So...


Yeah, at least I've been unable to find a better way to use --start- 
group / --end-group


There is no explicit dependencies between myapp and mylib, which I  
guess explain why CMake allows myapp to be built before mylib is  
built.


What would be the best way to add a dependency to solve this issue?
In other word, I'll go for ADD_DEPENDENCY(myapp x), but I'm not  
sure how to define 'x' here.


This would be the right way and "x" should simply be "mylib" in your
example, which creates a dependency between the myapp target and the  
mylib

target in your project.


Works fine, thanks !

Cheers,
Manu
___
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] Executable and library dependencies

2009-05-05 Thread Emmanuel Blot

But then the second parameter is completely superflous, it just adds
noise and confusion. If you use just add_directory(foo) cmake will
automatically use /foo as builddir for foo.


I don't remember when I've added it, but I *had* to add it at some  
point: CMake was not working as expected before.
Maybe it works fine w/o the second argument by now (2.6.4), but I'm  
sure it uses to fail at some point last year.


Cheers,
Manu

___
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] Cmake 2.8 and cross compilation

2009-11-16 Thread Emmanuel Blot
Hi All,

I've just upgraded my CMake installation to 2.8.0, as my collegues
reported me some compilation errors with the new release of CMake
(they use Debian/unstable).

Before I'm able to reproduce the same error they got, I got another
error, on Mac OS X hosts.
It seems that CMake 2.8.0 forces compiler option such as:
"-mmacosx-version-min=10.6", *whatever the compiler being used*.

The trouble is that our projects use a GCC cross compiler, not Apple's.
So this option is fully invalid with a GCC compiler that does not
target a Mac OS X host.

How can I disable this new (invalid) option - and be sure that the
resulting CMakeLists.txt keeps working with previous releases of CMake
(2.6+)?

Thanks,
Emmanuel.
___
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] Cmake 2.8 and cross compilation

2009-11-16 Thread Emmanuel Blot
> Can you create a bug entry for this?

Sure,  I'll do it

> As a quick fix I think if you set CMAKE_OSX_DEPLOYMENT_TARGET to empty it
> will stop CMake form doing this.  You should be able to do that either in
> the cache or in your project.

Ok, it seems to work, thanks for the workaround.

Now the actual issue, as I'm able to reproduce the original Linux host error:
Assembly support seems broken, or at least not compatible with ATT
mode from 2.5/2.6:

Here is a CMake snippet of what we've been using up to now to build
assembly source files:
ENABLE_LANGUAGE (ASM-ATT OPTIONAL)
SET (CMAKE_ASM-ATT_COMPILER ${xcc})
SET (CMAKE_ASM-ATT_COMPILE_OBJECT
 "  -c -o  ")
SET (CMAKE_ASM-ATT_FLAGS "${ARCH} -Wall")
SET (CMAKE_ASM-ATT_FLAGS_DEBUG "-DDEBUG")
SET (CMAKE_ASM-ATT_FLAGS_RELEASE "-DNDEBUG")

then, to create an executable from mixed sources (.S and .c), we use
the following syntax:
ADD_EXECUTABLE(myapp myc.c myasm.S)

when I enable a VERBOSE build, CMake does not attempt to assemble the
.S file, and it does not attempt to link it neither.

I nevertheless get these information strings:

-- Found assembler: /usr/local/gnu-eabi/bin/arm-eabi-gcc
-- Loaded CMakeASM-ATTInformation - ASM-ATT support is still
experimental, please report issues

Any way to enable back ASM support ?

Thanks a lot,
Manu
___
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] Visual Studio generator and cross-compilation

2008-02-03 Thread Emmanuel Blot

Hi all,

Does cmake (2.5 pre) support generation of build files for Visual  
Studio (2008 if that matters) projects for cross-compiling to a  
different OS/CPU (needs: eCos/ARM).


It seems that when such a generator is selected, CMake simply ignores  
the "force compiler" directives and select CL as the compiler, whereas  
the CMake file project does specify an alternate compiler (arm-elf-gcc  
in my example).


Is there any method to tell CMake to generate the IDE files for use  
with Visual Studio, but to create regular makefiles such as with the  
"Unix Makefiles" target, so that Visual Studio can launch a cross- 
compilation session ?


Thanks,
Emmanuel.

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Visual Studio generator and cross-compilation

2008-02-04 Thread Emmanuel Blot

This is currently not supported for the MSVC generator.
How about using Eclipse and the CMake Eclipse generator ?
It currently has issues with out-of-source builds, but as long as  
you use the

Eclipse generator with in-source builds it should work nicely :-)


Sure, but I really don' t like/don't want to use Eclipse.

I'm looking for a solution to use with Visual Studio Express for our  
customers.

I personally use VIm and SlickEdit.

Thanks,
Emmanuel.

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] External dependencies (static library)

2008-02-15 Thread Emmanuel Blot

Hi All,

I'm using CMake to cross-compile projects for eCos on ARM9 targets  
(hosts: Windows, Linux & Mac OS X).


Some CMake projects are unit tests (ELF executable files), which need  
to be linked against some static libraries (lib.a).
I'd like to add an extra dependency so that the ELF exe file is re- 
compiled or re-linked whenever one of those libraries is updated (or a  
library header file is updated).


These external libraries are *not* built with CMake.
Is there a way to add a dependency onto a non-dynamic, non-CMake- 
generated library ?


Thanks,
Emmanuel.

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Pure Python project

2008-05-20 Thread Emmanuel Blot

Hi,

I'm using CMake (2.6) to build several C and C++ projects.
I'd like to add another project which would be a pure Python project:

CMake would simply have to invoke Python script (which in turn  
generates an output file based on two input files).

What would be the rules to do so ?

I've tried ADD_CUSTOM_COMMAND and ADD_CUSTOM_TARGET with no luck:
CMake does create the Makefile files, but running "make" simply does  
nothing (no error, simply does nothing)


TIA,
Manu.

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Inter-project dependencies

2008-05-20 Thread Emmanuel Blot

Hi,

I'm using CMake to build two C-based projects

The first CMake project builds several static libraries (ARM elf / eCos)
The second CMake project builds several application which do link  
against the static libraries produced within the first project.

However, both CMake projects are unrelated from CMake perspective.

I've not been able to find a CMake rule to tell CMake to force  
relinking an application of the second project when a library  
generated in the first project has been updated. I always need to  
"touch" a source file of the second project so that Make rebuilds the  
file and is forced to relink the application with the static libraries  
of the first project.


Which CMake rule should/could I use to add a dependency from the 2nd  
project onto an external static library (of the 1st project) ?


TIA,
Emmanuel.

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Pure Python project

2008-05-21 Thread Emmanuel Blot

The command
  add_custom_command(OUTPUT myout.txt COMMAND ...)
tells CMake how to generate myout.txt.  Then you have to tell CMake  
you

want to generate it by depending on the output from a target.  The
target can either be an executable you're already building:
 add_custom_target(MyDriverTarget ALL DEPENDS myout.txt)
The "ALL" option makes the custom target build by default.

-Brad


Thanks Brad, it works perfectly.
Thanks also for the clarification about ADD_CUSTOM_TARGET vs.  
ADD_CUSTOM_TARGET, I got lost.


Cheers,
Manu
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Inter-project dependencies

2008-05-21 Thread Emmanuel Blot

In the second project make sure you specify the libraries to link from
the first project by full path.  Then the dependencies will be hooked
up.  Without a full path CMake does not know how to add a build-time
dependency on a library.  You can get a full path in the second  
project

by using find_library.  Even better, use export/import capabilities:

http://www.cmake.org/Wiki/CMake_2.6_Notes#Exporting_and_Importing_Targets


Hi,

I tried the importing target feature, but unfortunately, it does not  
seem to work as (I ?) expected.
The executable of the second CMake project does not get relinked when  
a library of the first project is updated (i.e. more recent than the  
executable).


I've tried to change the rule
set_property(TARGET foo PROPERTY IMPORTED_LOCATION /path/to/libfoo.a)
with a non-existing file, i.e.
set_property(TARGET foo PROPERTY IMPORTED_LOCATION /path/to/libfoo2.a)

GCC fails to link the executable against the libfoo2.a library, as  
expected.
Note that the missing file as reported from GCC is a full path, which  
demonstrates that full path to the library are actually generated by  
CMake
(I also run make VERBOSE=1 to cross check: full path name to the  
libraries are definitely used)


Then, I reverted the invalid change to the proper library file path:
set_property(TARGET foo PROPERTY IMPORTED_LOCATION /path/to/libfoo.a)
and re-run make. At this point the executable DID get relinked (not  
rebuild, as expected).
So it seems that it gets closer to what I'd like to achieve, but  
there's still some issue with the dependency processing.


"touching" the libfoo.a never leads to relink the executable file.

I'm using CMake 2.6:

$> cmake --version
cmake version 2.6-patch 0

As a side note,

http://www.cmake.org/Wiki/CMake_2.6_Notes#Exporting_and_Importing_Targets

uses the following example:
add_library(foo IMPORTED)
but it seems that this statement is not valid: the type of the library  
is required (STATIC, SHARED, etc) such as in

add_library(foo STATIC IMPORTED)

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Out-of-source build broken ?

2008-06-18 Thread Emmanuel Blot
I can't figure out why CMake keeps building in the source directory  
rather than in the current directory:


$ cmake --version
cmake version 2.6-patch 0

$ echo $PWD
/home/eblot/t380/host/build/project

$ cmake ../../src/project
-- Configuring done
-- Generating done
-- Build files have been written to: /home/eblot/t380/host/src/project

Should I need to set some specific configuration parameters to enable  
out-of-source build ?


This issue occurs on Cygwin (WinXP SP3) - at least

Thanks,
Manu


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Out-of-source build broken ?

2008-06-18 Thread Emmanuel Blot
Once you configure in the source tree, CMake will continue to use  
the same build tree.  So, you need to remove the CMakeCache.txt and  
CMakeFiles directory and any configured files from your source tree  
and try again.


Ok, thanks a lot.
I thought I had fully cleaned up the source directory, but I obviously  
left some cache file, since it now works as expected.


Sorry for the noise.
Manu

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] GCC version variable

2008-06-18 Thread Emmanuel Blot
Is there some CMake macro to report the version of the GCC compiler  
version?
It seems these macros exist for the CL compiler, but I've not found  
the matching macros for GCC.


Some warnings are produced w/ GCC 4, but the matching warning shut-off  
option only exists for GCC 4 (not for GCC3).
I'd like to enable the -Wno-... option switch only for build built  
with gcc 4, and do nothing with GCC 3.


Thanks,
Manu

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] GCC version variable

2008-06-18 Thread Emmanuel Blot
This is taken from a FindBoost.cmake file I had laying around.  
Adjust for your needs:


Thanks, works smoothly.
Manu

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ASM Cross Compiler Help

2008-06-18 Thread Emmanuel Blot

Are you using GNU as ?
Then the ASM-ATT files should work for you.


I can confirm: ASM-ATT allows to use .s / .S files along with C projects
(GCC for arm-elf within my environment).

BTW, I was wondering how/why the "ATT" version of the ASM module is to  
be used ?
I've started using it because the ASM module do not work for me, but I  
have not understood why the module is named after "ATT" ?


Cheers,
Manu

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] GCC version variable

2008-06-19 Thread Emmanuel Blot

To do that, you could use CheckC[XX]CompilerFlag module and command.


Good point, I have not thought about this option. Thanks.

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] XCode generator and cross-compilation

2008-07-24 Thread Emmanuel Blot

Hi,

Is it possible to use the Xcode generator to produce Xcode projects  
for cross-compilation?
It seems that in such a case, CMake ignores the cross-compiler (gcc  
4.x), which in turn make Xcode use the native GCC compiler.


Thanks,
Manu

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] XCode generator and cross-compilation

2008-07-24 Thread Emmanuel Blot
Until now only the makefile-based generators have been tested for  
cross
compiling. XCode probably doesn't work. I have no idea how hard it  
would be

to support cross compiling with XCode.


Ok. I've tried to find some information about supporting cross  
compilation w/ Xcode, but it's far from being easy to find useful  
docs...


Thanks
Manu

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] install(QUIET ...)

2014-04-05 Thread Emmanuel Blot
Hi Stefan,

Which cmake base version should be used to apply the patch?
(I tried against 2.8.12.2 and 3.0.0-rc1-1 but I got failure in both cases)

Thanks,
Manu


On Fri, Apr 4, 2014 at 7:17 PM, Stefan Eilemann  wrote:
> Hi,
>
> I gave the implementation of install(QUIET) a shot since it became an 
> annoyance in a project. Please see http://www.cmake.org/Bug/view.php?id=13761 
> for a patch - feedback and merge into master are welcome!
>
>
> Cheers,
>
> Stefan.
> --
> http://www.eyescale.ch
> https://github.com/Eyescale/
> http://www.linkedin.com/in/eilemann
>
>
>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


[CMake] Changing object file names

2014-04-08 Thread Emmanuel Blot
Hi,

Is there a way, in CMake, to change the pattern of the output object
files - that is for each .c compiled, the name of the output binary .o
files.
I'm not refering to the file extension, nor any library name for which
I already found answers in CMake doc, but the basename.

The issue I'm facing is that several existing libraries used the same
name for source files, and when archived into the same final library
(.a), the names of both object file collide. I cannot really keep both
.a files for several reasons.

The idea would be to add a prefix to each object file based on the
original library name, to avoid collision, that is:

liba/x.c  -> liba_x.o
liba/y.c  -> liba_y.o
libb/x.c  -> libb_x.o
libb/y.c  -> libb_y.o

final.a <-- liba_x.o, libb_x.o, libb_x.o, libb_y.o

I cannot / do not want to change the name of the source files, to ease
upstream merge.

What would be the best way to change the name of the output object
files with CMake?

Thanks,
Manu
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] install(QUIET ...)

2014-04-09 Thread Emmanuel Blot
Succesfully tested, thanks a lot!

Too bad it did not make it to RC3...
This is a really nice feature.

Cheers,
Manu

On Mon, Apr 7, 2014 at 3:07 PM, David Cole  wrote:
>> On 6. Apr 2014, at 16:48, David Cole  wrote:
>>
>> > The patch says it's based on
>
> "9dadcae57bc8545d1af66ede4c91c06eaa49f9d6" but I
>>
>> > don't see that commit in CMake 'master' or 'next' branches..
>> > Where is that commit?
>>
>> It's my local commit containing the changes. I don't think I have
>
> push rights to
>>
>> the remote repo.
>
>
> Ah, right. Sorry -- I thought that was supposed to be the parent commit 
>
> D
>
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] install(QUIET ...)

2014-05-15 Thread Emmanuel Blot
> Too bad it did not make it to RC3...
> This is a really nice feature.

Neither RC4 nor RC5.
Any chance to get it pulled?

Cheers,
Manu
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] install(QUIET ...)

2014-06-13 Thread Emmanuel Blot
I do not think so: there have been no activity on the ticket, no
answer on the mailing list since RC3 :-(

Maybe there is a better way than the ML or the bug tracker to get a
status update from CMake's team?

Cheers,
Manu


On Fri, Jun 13, 2014 at 5:09 AM, J Decker  wrote:
> Did this make it to 3.0 release?   Could it have been implemented as more of
> a global flag so I don't have to modify every single install() I have?
>
>
> On Thu, May 15, 2014 at 6:07 AM, Emmanuel Blot  wrote:
>>
>> > Too bad it did not make it to RC3...
>> > This is a really nice feature.
>>
>> Neither RC4 nor RC5.
>> Any chance to get it pulled?
>>
>> Cheers,
>> Manu
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
>
>
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


[CMake] Invoking genassym from cmake

2014-10-22 Thread Emmanuel Blot
Hi,

I'd like to call genassym from cmake.

>From FreeBSD man page:
   sh genassym.sh [-c] C compiler invocation

I do not really get how to perform such a task from CMake, as the "C
compiler invokation" string is similar to what is defined with the
   (as retrieved from the
CMAKE_C_COMPILE_OBJECT var) but I cannot figure a way to retrieve
 and  contents here. I tried with (too) many
combinations of GET_PROPERTY, with no luck.

What would be the best way to retrieve all the definitions and flags
used for the current target, but invoke the compiler though
genassym.sh?

Thanks,
Manu
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


[CMake] Definiting output extension for cross-compilation

2014-10-23 Thread Emmanuel Blot
Hi,

How to tell CMake to use '.o' output object file (instead of the
Windows' .obj forced alternative) when cross-compiling ?

SET (CMAKE_SYSTEM_NAME Generic)
...
SET (CMAKE_C_OUTPUT_EXTENSION .o)

has no effect from a project file.

forcing SET (UNIX 1) does work, but this is a terrible workaround

Thanks,
Manu
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


[CMake] Is there really no way in CMake to retrieve the objects file for a target?

2014-10-28 Thread Emmanuel Blot
Hi,

I need to tweak object files for a target before linking them to the
final executable.

I'm striving for retrieving the file object paths for a target:

ADD_LIBRARY(tgt OBJECT file1.c file2.S)

1. $ is not available from
ADD_CUSTOM_COMMAND/ADD_CUSTOM_TARGET

2. Actual object paths could be deduced from the source file name, but
it seems difficult to predict the actual path when source files are
relative to the current directory: ".." is replaced with "__" for
example.

3. GET_TARGET_PROPERTY(var tgt SOURCES) provides absolute source
paths, which makes source to object file path computation impossible,
because of the ".." to "__" automatic replacement

This seems so convoluted that I guess I'm missing the proper way to
properly add an intermediate step between the compilation and link
stages, but I keep failing to find any useful advice from Google and
the mailing list.

Thanks,
Manu.
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


[CMake] Using clang + assembly language (cross compilation)

2014-12-17 Thread Emmanuel Blot
Hi,

Is there a special order to make CMake recognize .S files - with Clang
toolchain - as valid source files?

-- ASM: /usr/local/bin/clang
-- The ASM compiler identification is Clang
-- Found assembler: /usr/local/bin/clang
-- Configuring done
CMake Error at lib/CMakeLists.txt:9 (ADD_LIBRARY):
  Cannot find source file:

   .../lib/arch/arm/gen/divide.S

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx

with

INCLUDE (Platform/Generic)
...
FIND_PROGRAM (xcc clang)

SET (CMAKE_ASM_COMPILER_ID Clang)

INCLUDE (CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER (${xcc} Clang)
CMAKE_FORCE_CXX_COMPILER (${xcc} Clang)
SET (CMAKE_ASM_COMPILER ${xcc})

...

PROJECT (project C ASM)

...


Thanks,
Manu.
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Using clang + assembly language (cross compilation)

2014-12-17 Thread Emmanuel Blot
Ooops, sorry for the noise, there was an issue with the CMakeLists.txt file.
Please ignore my last post.

On Wed, Dec 17, 2014 at 10:15 AM, Emmanuel Blot  wrote:
> Hi,
>
> Is there a special order to make CMake recognize .S files - with Clang
> toolchain - as valid source files?
>
> -- ASM: /usr/local/bin/clang
> -- The ASM compiler identification is Clang
> -- Found assembler: /usr/local/bin/clang
> -- Configuring done
> CMake Error at lib/CMakeLists.txt:9 (ADD_LIBRARY):
>   Cannot find source file:
>
>.../lib/arch/arm/gen/divide.S
>
>   Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
>   .hxx .in .txx
>
> with
>
> INCLUDE (Platform/Generic)
> ...
> FIND_PROGRAM (xcc clang)
>
> SET (CMAKE_ASM_COMPILER_ID Clang)
>
> INCLUDE (CMakeForceCompiler)
> CMAKE_FORCE_C_COMPILER (${xcc} Clang)
> CMAKE_FORCE_CXX_COMPILER (${xcc} Clang)
> SET (CMAKE_ASM_COMPILER ${xcc})
>
> ...
>
> PROJECT (project C ASM)
>
> ...
>
>
> Thanks,
> Manu.
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


[CMake] Sublime Text 2 - Ninja generator

2015-01-16 Thread Emmanuel Blot
Hi,

Is there a way from CMake to provide the build system "path" for a build target?

Sublime Text 2 builds with the defaut system path, which makes the
project build to fail. When the project is built from the shell from
which ST is started there is no issue has the current PATH env. var.
is used.

Adding a "path" definition for all the build systems in the generated
sublime-project file fixes this issue.

Thanks,
Manu
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


[CMake] How to define a compiler flags that do not appear in linker command line

2013-06-17 Thread Emmanuel Blot
Hi,

I'm using CMake (2.8.10.1) to cross-compile from OS X and Linux x86_64
hosts to ARM EABI platform running eCos.

I'm looking for a way (and if possible, a clean one ;-)) to define C
compiler flags that are not propagated to the final link stage.

My current CMake files use:

SET (CMAKE_SYSTEM_NAME eCos)
  then
SET (CMAKE_C_FLAGS …)

It seems that the CMAKE_C_FLAGS is also expanded into the link command
line, that is the "" parameter in

  set(CMAKE_C_LINK_EXECUTABLE"   
 -o  -nostdlib
-nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld  ")

defined with CMake's Modules/Platform/eCos.cmake file (line 56).

As it seems there is no way to tweak  here, I guess there is a
better way to define compiler C flags that are distinct from the linker
flags. In other word, I guess I should not use CMAKE_C_FLAGS but another
variable to define the flags that should appear at compile time but not at
link time.

Anyway, any piece of advice would be warmly welcomed, as I'm unable to find
a clue within the documentation.
It seems there are many way to deal with compiler flags, I tried several of
them (inclusing the TARGET properties) but I've not been able to find a
working solution.

BTW, what does mean the <...> modifiers (rather than the common ${...} one)
? Can/could they be changed ?

Thanks in advance,
Manu
--

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] Objective-C support

2013-08-06 Thread Emmanuel Blot
Hi,

What is the recommended way to specify compiler flags for Objective-C
source files?

Objective-C is not defined as a specific language in the default CMake
modules (vs. C and C++ for exemple), so CMake does not seem to handle
OBJC flags at all.

How to define OBJCFLAGS for a whole project, in such a way that those
flags are only applied to .m source files, not the other source files
(.c, .cxx, etc.)?

Thanks,
Manu
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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