[CMake] Install a certain target

2008-01-28 Thread Salvatore Iovene
Hi,

I have a project with several libraries and dependencies. Let's say
libA, libB and libC where libA depends on libB, which depends on libC.

If I just want to build libB (and libC too of course), I know I can just
do make B. But if I do make install also A will be built. Is there a
way to cpack of install everything up to libB?

Thanks.

-- 
Salvatore Iovene
http://www.iovene.com/


signature.asc
Description: Digital signature
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Coverage without bullseye?

2007-12-19 Thread Salvatore Iovene
On Dec 18, 2007 4:09 PM, Bill Hoffman [EMAIL PROTECTED] wrote:
 Salvatore Iovene wrote:
  Hi,
  from http://www.cmake.org/Wiki/CTest:Coverage I seem
  to understand that coverage can be analyzed in the dart
  dashboard only by purchasing Bullseye. Is that true?
  If not, how to submit coverage analysis to the dashboard?
 

 Uhhh...

 How about the first paragraph of that wiki page:
 http://www.cmake.org/Wiki/CTest:Coverage#Coverage_With_C.2B.2B

 Currently, you can do coverage with gcc gcov or bullseye (in CVS CMake
 only).

 See the Coverage section here for examples:
 http://public.kitware.com/dashboard.php?name=cmake

 Here is a ctest script used to do gcc coverage:

 http://www.cmake.org/Testing/Sites/dash17.kitware/Linux-g++4.0/20071218-0100-Nightly/Notes.html

Thanks, I'll try that. In the meantime I have another related question:
some of my test are actually wrapped inside a python script. The python
script will be run from ctest (as I added it with ADD_TEST) and it will
spawn an executable built by cmake with the compiler options for
coverage. Will the coverage report work in this case?

Thanks!

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] CHECK_CXX_COMPILER_FLAG(-fprofile-arcs HAVE_FPROFILE_ARCS_FLAG)

2007-12-19 Thread Salvatore Iovene
How come this configure check fails for my gcc?

$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --with-tune=i686
--enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

After the line in the subject, HAVE_FPROFILE_ARCS_FLAG is OFF, even
tho the compiler is supposed to have that flag.

Thanks!

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Coverage without bullseye?

2007-12-18 Thread Salvatore Iovene
Hi,
from http://www.cmake.org/Wiki/CTest:Coverage I seem
to understand that coverage can be analyzed in the dart
dashboard only by purchasing Bullseye. Is that true?
If not, how to submit coverage analysis to the dashboard?

Thanks!

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cross compiling

2007-11-29 Thread Salvatore Iovene
On Nov 29, 2007 8:19 PM, Jesse Corrington [EMAIL PROTECTED] wrote:
 The inf and mmp files are the build files for symbian. They are similar to a
 make file, but simpler and with a different sytax. These are what I need to
 generate. Currently I am very confused as to where I will need to write the
 code/script to generate these files. I am hearing that I only need to write
 a new platform module file, is this true, or do I need to extend the cpp
 source with a new output generator, or whatever they are called. I should
 have no problem writting the cmake scripts and/or cpp code, but I really
 need some clarity on where I need to put everything. Thanks.

Hi Jesse,
I'm very interested to your issue, as, for work reasons, I'm
considering to do the
same.

I was inspecting 2 possibilities:

1) Hack CMake so that it would have a new Generator, that would generate
.inf and .mmp files (rather than Unix Makefiles, or NMake Makefiles or VS
Project files).

2) Hack CMake so that it would cross compile for Symbian using Unix
Makefiles and the gcce compiler.

Number 2) seems obviously less work, even tho number 1) is attractive,
because would let developers use their favorite IDE which loads and
interprets .mmp files.

Can you give me more information about the toolchain approach you
mentioned?

I'm interested in cooperating into branching cmake for symbian support
(my company is willing to support this effort).

Of course I'd like to contribute everything I can to the cmake project.

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] ADD_TEST and need of other files

2007-11-22 Thread Salvatore Iovene
Hi,
I add a test that needs to load a certain xml file and process its
content. The xml file is in the same directory as the test sources, in
the source tree. How can I install this xml file so that it will be
available in the binary tree, in the same directory as the test
executable?

Thanks!

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ADD_TEST and need of other files

2007-11-22 Thread Salvatore Iovene
On Nov 22, 2007 5:40 PM, Alan W. Irwin [EMAIL PROTECTED] wrote:
 Second, if it is really necessary in this case, then you can
 CONFIGURE_FILE with the COPYONLY attribute at cmake time or execute

Hi, that fit me very well, thanks!

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] $ENV{HOSTNAME}

2007-11-21 Thread Salvatore Iovene
Hi,
notice the following code:

[EMAIL PROTECTED]:/tmp/foo$ cat CMakeLists.txt
MESSAGE(STATUS HOSTNAME = $ENV{HOSTNAME})
MESSAGE(STATUS USER = $ENV{USER})
MESSAGE(STATUS HOME = $ENV{HOME})

And its output:

[EMAIL PROTECTED]:/tmp/foo$ cmake .
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Check size of void*
-- Check size of void* - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- HOSTNAME =
-- USER = siovene
-- HOME = /home/siovene
-- ENV = $ENV
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/foo

In spite of:

[EMAIL PROTECTED]:/tmp/foo$ echo $HOSTNAME
sd024

A bug? Thanks.


-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] $ENV{HOSTNAME}

2007-11-21 Thread Salvatore Iovene
On Nov 21, 2007 3:56 PM, Gonzalo Garramuño [EMAIL PROTECTED] wrote:
 Salvatore Iovene wrote:
 
  A bug? Thanks.
 

 Nope.

 $ echo $HOSTNAME
 aura1

 $ sh -c echo \$HOSTNAME

 $ bash -c echo \$HOSTNAME
 aura1

 Basically, HOSTNAME is a variable that is set by some shells like bash
 only, but cmake for speed and consistency runs commands using the most
 basic unix shell (ie. sh), which does not set that variable by default.

Thanks. How can I work this around? I really need to get the HOSTNAME in a
shell-independent way. Maybe there's a way to execute the `hostname`
command?
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] $ENV{HOSTNAME}

2007-11-21 Thread Salvatore Iovene
 On Nov 21, 2007 3:56 PM, Gonzalo Garramuño [EMAIL PROTECTED] wrote:
  Salvatore Iovene wrote:
  
   A bug? Thanks.
  
 
  Nope.
 
  $ echo $HOSTNAME
  aura1
 
  $ sh -c echo \$HOSTNAME
 
  $ bash -c echo \$HOSTNAME
  aura1
 
  Basically, HOSTNAME is a variable that is set by some shells like bash
  only, but cmake for speed and consistency runs commands using the most
  basic unix shell (ie. sh), which does not set that variable by default.

 Thanks. How can I work this around? I really need to get the HOSTNAME in a
 shell-independent way. Maybe there's a way to execute the `hostname`
 command?

Besides:

[EMAIL PROTECTED]:/work/trunk/libraries$ sh -c echo \$HOSTNAME
sd024
[EMAIL PROTECTED]:/work/trunk/libraries$ /bin/sh -c echo \$HOSTNAME
sd024
[EMAIL PROTECTED]:/work/trunk/libraries$ ls -lh /bin/sh
lrwxrwxrwx 1 root root 4 2007-11-13 16:18 /bin/sh - bash

So sh is actually bash, on my machine.


-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] $ENV{HOSTNAME}

2007-11-21 Thread Salvatore Iovene
On Nov 21, 2007 4:02 PM, Salvatore Iovene
[EMAIL PROTECTED] wrote:

  On Nov 21, 2007 3:56 PM, Gonzalo Garramuño [EMAIL PROTECTED] wrote:
   Salvatore Iovene wrote:
   
A bug? Thanks.
   
  
   Nope.
  
   $ echo $HOSTNAME
   aura1
  
   $ sh -c echo \$HOSTNAME
  
   $ bash -c echo \$HOSTNAME
   aura1
  
   Basically, HOSTNAME is a variable that is set by some shells like bash
   only, but cmake for speed and consistency runs commands using the most
   basic unix shell (ie. sh), which does not set that variable by default.
 
  Thanks. How can I work this around? I really need to get the HOSTNAME in a
  shell-independent way. Maybe there's a way to execute the `hostname`
  command?

 Besides:

 [EMAIL PROTECTED]:/work/trunk/libraries$ sh -c echo \$HOSTNAME
 sd024
 [EMAIL PROTECTED]:/work/trunk/libraries$ /bin/sh -c echo \$HOSTNAME
 sd024
 [EMAIL PROTECTED]:/work/trunk/libraries$ ls -lh /bin/sh
 lrwxrwxrwx 1 root root 4 2007-11-13 16:18 /bin/sh - bash

 So sh is actually bash, on my machine.

Ok, I see now. HOSTNAME is a shell variable, but not an environment
variable. Check this thread here:

http://lists.freebsd.org/pipermail/freebsd-questions/2004-July/052424.html

So, is there another way I could get the hostname in CMake?
Thanks.


-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] $ENV{HOSTNAME}

2007-11-21 Thread Salvatore Iovene
On Nov 21, 2007 5:14 PM, David Cole [EMAIL PROTECTED] wrote:
 The CMake SITE_NAME command does this in a shell / platform independent
 way...

 See output of cmake --help-command SITE_NAME

That doesn't mention stripping whitespaces at all.

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Persistency of cmake options

2007-11-19 Thread Salvatore Iovene
Hi,

If I call cmake with, say, -DFOO:STRING=Bar, how can I do so that the
value of FOO will be remembered the next time cmake is issued, without
having to give it explicitly? This is particularly usefule in case I
just wanna do make again and have the makefiles be updated anyways.

Thanks!

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] setting configuration specific options in visual studio

2007-11-19 Thread Salvatore Iovene
On Nov 20, 2007 1:38 AM, Jesse Corrington [EMAIL PROTECTED] wrote:
 I searched the archives and couldn't find any good information about this
 task, which I would assume is important to many people. I need to set
 options in visual studio that are different in debug and release modes. For
 example I need to set preprocessor defines, change compiler flags, link with
 different libraries, and other settings.

 Is there anyway to do something like this.

 IF ( RELEASE )
 ADD_DEFINITIONS( -DREL1 )
 ELSEIF ( DEBUG )
 ADD_DEFINITIONS( -DDEB1 )
 ENDIF ()

Look at the CMAKE_BUILD_TYPE variable in
http://www.cmake.org/Wiki/CMake_Useful_Variables
Basically you can have variables like CMAKE_CXX_FLAGS_DEBUG,
CMAKE_CXX_FLAGS_RELEASE, CMAKE_CXX_FLAGS_WHATEVER, and the correct
variable is chosen by cmake according to the value of CMAKE_BUILD_TYPE
(e.g. DEBUG, RELEASE or WHATEVER.

--
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Persistency of cmake options

2007-11-19 Thread Salvatore Iovene
On Nov 19, 2007 7:12 PM, Alexander Neundorf [EMAIL PROTECTED] wrote:
 On Monday 19 November 2007, Salvatore Iovene wrote:
  Hi,
 
  If I call cmake with, say, -DFOO:STRING=Bar, how can I do so that the
  value of FOO will be remembered the next time cmake is issued, without
  having to give it explicitly? This is particularly usefule in case I

 If you use the type as given in your example it will always go in the cache.
 If you omit the type, it will go in the cache if the type is defined later on
 in any of the cmake files or if you are using cmake cvs.

Ok, then my problem was that I wasn't using the type in my real life
app, but only in the example in the email :)
Thanks!

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Win32: INSTALL command fails to package .dll, packages .lib

2007-11-16 Thread Salvatore Iovene
On Nov 16, 2007 12:15 PM, Stephen Collyer [EMAIL PROTECTED] wrote:
 I have a trivial library that I'm building with a SHARED attribute
 and I'm installing it into a lib directory with a cmake list file thus:

 ADD_LIBRARY(Test SHARED Test.cpp)

 INSTALL(TARGETS Test LIBRARY DESTINATION lib)

Try the following:

INSTALL(
TARGETS Test
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Performing cross-platform build - how ?

2007-11-14 Thread Salvatore Iovene
On Nov 14, 2007 1:02 PM, Stephen Collyer [EMAIL PROTECTED] wrote:
 Presumably some switch makes it produce
 something suitable for nmake ?

That would be -GNMake Makefiles.

--
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Visual Studio 7.1 and ADD_DEPENDENCIES

2007-11-14 Thread Salvatore Iovene
Hi,
when I use CMake 2.4.7 to generate NMake Makefiles everything builds
fine, but if I generate Visual Studio 7.1 project files, and then open
the Visual Studio Solution, I notice that some things get linked just
for appearing as a dependency.

ADD_DEPENDENCIES(my_lib my_otherlib), where both libs are STATIC,
will cause my_otherlib to be linked to my_lib even tho I didn't
explicitly request so using the TARGET_LINK_LIBRARY command. Is this a
bug or am I missing something?

Thanks.

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] library and executable with the same name

2007-11-14 Thread Salvatore Iovene
On Nov 14, 2007 2:33 PM, tek [EMAIL PROTECTED] wrote:
 Hello,

 I have libfoo.so and an executable named foo, and I can't find out how to
 manage this situation. The RENAME option of INSTALL doesen't work on TARGETS,
 and if I name them both foo, the library is installed twice. Is there a way
 to accomplish this?

Try changing the target name of the executable to foo_executable and
then TARGET_SET_PROPERTY(foo_executable PROPERTIES OUTPUT_NAME foo)


-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Visual Studio 7.1 and ADD_DEPENDENCIES

2007-11-14 Thread Salvatore Iovene
On Nov 14, 2007 5:44 PM, Brandon Van Every [EMAIL PROTECTED] wrote:
 On Nov 14, 2007 7:12 AM, Salvatore Iovene
 [EMAIL PROTECTED] wrote:
  Hi,
  when I use CMake 2.4.7 to generate NMake Makefiles everything builds
  fine, but if I generate Visual Studio 7.1 project files, and then open
  the Visual Studio Solution, I notice that some things get linked just
  for appearing as a dependency.
 
  ADD_DEPENDENCIES(my_lib my_otherlib), where both libs are STATIC,
  will cause my_otherlib to be linked to my_lib even tho I didn't
  explicitly request so using the TARGET_LINK_LIBRARY command. Is this a
  bug or am I missing something?

 Perhaps a bug... but why are you specifying a dependency, if my_lib
 doesn't utilize my_otherlib?

It _does_ use it. But if do both ADD_DEPENDENCIES and
TARGET_LINK_LIBRARY I'll end up with many many warnings about symbols
already defined, and ignoring because linking twice, which is
annoying. So, perhaps a bug?

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Linking problem

2007-11-07 Thread Salvatore Iovene
On 11/7/07, Brandon Van Every [EMAIL PROTECTED] wrote:
 On Nov 7, 2007 2:12 AM, Salvatore Iovene
 [EMAIL PROTECTED] wrote:
  Hi,
  I'm not 100% sure this is really a CMake related question, but I'll
  fire it up anyway:
 
  I'm building a series of static libraries, name them liba.a, libb.a
  and libc.a, and linking them into a shared library libfoo.so.
 
  Then I'm building libx.a liby.a and libz.a and linking them into the
  shared libbar.so.
 
  Then I have an executable whatever.exe that's linked to to libfoo.so
  and libbar.so. The linking of the executable fails complaining of
  certain missing simbols. Some symbols from liba.a are missing in
  libbar.so.

 I'm not a linking expert, but why should static symbols that you
 embedded in libfoo.so be visible to libbar.so?

Because libbar uses libfoo.

  So far I have fixed the issue by linking one of the libs of
  libfoo.so (say libx.a) to libbar.so. But this smells of nasy
  workaround.

 Why should it be?  You're saying you really don't want those
 underlying static libs to know about each other.  If you want symbols
 from a to be visible to everyone, you should be making it a dynamic
 liba.so.

My assumption here is that linking all the static libs liba.a, libb.a
and libc.a in libfoo.so, the symbols in liba, libb and libc will be
visible from libraries that link against libfoo. Maybe this is the
problem?
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Linking problem

2007-11-07 Thread Salvatore Iovene
On 11/7/07, Renaud Detry [EMAIL PROTECTED] wrote:

 On 07 Nov 2007, at 09:59, Salvatore Iovene wrote:

  On 11/7/07, Brandon Van Every [EMAIL PROTECTED] wrote:
  On Nov 7, 2007 2:12 AM, Salvatore Iovene
  [EMAIL PROTECTED] wrote:
  Hi,
  I'm not 100% sure this is really a CMake related question, but I'll
  fire it up anyway:
 
  I'm building a series of static libraries, name them liba.a, libb.a
  and libc.a, and linking them into a shared library libfoo.so.
 
  Then I'm building libx.a liby.a and libz.a and linking them into the
  shared libbar.so.
 
  Then I have an executable whatever.exe that's linked to to libfoo.so
  and libbar.so. The linking of the executable fails complaining of
  certain missing simbols. Some symbols from liba.a are missing in
  libbar.so.

 Let's say that there's a symbol S in liba.a, that S is the only symbol
 in its object, and that S is not used by libfoo. In Darwin, S will not
 be included in libfoo, and the result you get is expectable. I don't
 know if this simple explanation translates to Linux.

I don't know either, but that seems to be the case. Any ideas on how to fix it?

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Linking problem

2007-11-07 Thread Salvatore Iovene
On 11/7/07, Renaud Detry [EMAIL PROTECTED] wrote:

 On 07 Nov 2007, at 11:04, Salvatore Iovene wrote:

  On 11/7/07, Renaud Detry [EMAIL PROTECTED] wrote:
 
  On 07 Nov 2007, at 09:59, Salvatore Iovene wrote:
 
  On 11/7/07, Brandon Van Every [EMAIL PROTECTED] wrote:
  On Nov 7, 2007 2:12 AM, Salvatore Iovene
  [EMAIL PROTECTED] wrote:
  Hi,
  I'm not 100% sure this is really a CMake related question, but
  I'll
  fire it up anyway:
 
  I'm building a series of static libraries, name them liba.a,
  libb.a
  and libc.a, and linking them into a shared library libfoo.so.
 
  Then I'm building libx.a liby.a and libz.a and linking them
  into the
  shared libbar.so.
 
  Then I have an executable whatever.exe that's linked to to
  libfoo.so
  and libbar.so. The linking of the executable fails complaining of
  certain missing simbols. Some symbols from liba.a are missing in
  libbar.so.
 
  Let's say that there's a symbol S in liba.a, that S is the only
  symbol
  in its object, and that S is not used by libfoo. In Darwin, S will
  not
  be included in libfoo, and the result you get is expectable. I don't
  know if this simple explanation translates to Linux.
 
  I don't know either, but that seems to be the case. Any ideas on
  how to fix it?

 IMHO, you shouldn't use symbols from liba in libbar if libbar doesn't
 link against liba.

 I think you could do either of

 1.- make all your static libs dynamic, and link libbar against liba if
  libbar uses symbols from liba.

 2.- link neither libfoo nor libbar to liba, but link whatever.exe to
  liba. This will require an extra flag about undefined symbols
  under Darwin, but I don't think ld will complain under Linux.

 Option (1) seems far nicer to me.

 Hope this helps.
 Renaud.

Thanks. Your options seem very reasonable. The thing is, though, that
the various liba, libb, libc were meant to be only used to build a
bigger library called libfoo. So what I really want is that symbols in
liba are defined in libfoo even if libfoo doesn't use them.

Does it make sense?

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Linking problem

2007-11-07 Thread Salvatore Iovene
On 11/7/07, Renaud Detry [EMAIL PROTECTED] wrote:

 On 07 Nov 2007, at 11:35, Salvatore Iovene wrote:

  On 11/7/07, Renaud Detry [EMAIL PROTECTED] wrote:
 
  On 07 Nov 2007, at 11:04, Salvatore Iovene wrote:
 
  On 11/7/07, Renaud Detry [EMAIL PROTECTED] wrote:
 
  On 07 Nov 2007, at 09:59, Salvatore Iovene wrote:
 
  On 11/7/07, Brandon Van Every [EMAIL PROTECTED] wrote:
  On Nov 7, 2007 2:12 AM, Salvatore Iovene
  [EMAIL PROTECTED] wrote:
  Hi,
  I'm not 100% sure this is really a CMake related question, but
  I'll
  fire it up anyway:
 
  I'm building a series of static libraries, name them liba.a,
  libb.a
  and libc.a, and linking them into a shared library libfoo.so.
 
  Then I'm building libx.a liby.a and libz.a and linking them
  into the
  shared libbar.so.
 
  Then I have an executable whatever.exe that's linked to to
  libfoo.so
  and libbar.so. The linking of the executable fails
  complaining of
  certain missing simbols. Some symbols from liba.a are missing in
  libbar.so.
 
  Let's say that there's a symbol S in liba.a, that S is the only
  symbol
  in its object, and that S is not used by libfoo. In Darwin, S will
  not
  be included in libfoo, and the result you get is expectable. I
  don't
  know if this simple explanation translates to Linux.
 
  I don't know either, but that seems to be the case. Any ideas on
  how to fix it?
 
  IMHO, you shouldn't use symbols from liba in libbar if libbar doesn't
  link against liba.
 
  I think you could do either of
 
  1.- make all your static libs dynamic, and link libbar against
  liba if
   libbar uses symbols from liba.
 
  2.- link neither libfoo nor libbar to liba, but link whatever.exe to
   liba. This will require an extra flag about undefined symbols
   under Darwin, but I don't think ld will complain under Linux.
 
  Option (1) seems far nicer to me.
 
  Hope this helps.
  Renaud.
 
  Thanks. Your options seem very reasonable. The thing is, though, that
  the various liba, libb, libc were meant to be only used to build a
  bigger library called libfoo.

 Then why don't you build all objects from foo, a, b, c to be PIC and
 pack them all together in foo? Or if you really want intermediate
 archives, maybe you can build the objects of a, b, c to be PIC,
 archive them in .a archives, and use ld to put them together. But this
 is not the same thing as linking foo to a, b, c using gcc and -la -lb
 -lc, which means to only fetch needed symbols.

 The bottom line is, what you mean to do is probably not very common,
 and I don't think there will be a high-level CMake primitive that will
 do that for you.

 This is just my opinion though :-)

What do you mean by PIC?
Thanks!

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Linking problem

2007-11-07 Thread Salvatore Iovene
On 11/7/07, Hendrik Sattler [EMAIL PROTECTED] wrote:
 Quoting Salvatore Iovene [EMAIL PROTECTED]:
  On 11/7/07, Salvatore Iovene [EMAIL PROTECTED] wrote:
 
  What do you mean by PIC?
  Thanks!
 
  Oh, -fPIC. I figured it out. Seems to work fine on Linux. I still have
  to try it on Windows tho. I hope it's good as a solution and not just
  a hack! :)

 Windows DLLs work differently.

 When putting code into shared object under Linux, they _must_ be
 compiled as PIC. Back to your problem: GNU ld has an option to
 forcibly include all symbols during linking instead of only the used
 ones, take a look at its manpage.


Thanks f or your answer. I checked ld man page and I think you refer
to the --export-dynamic option. Building my libs with -fPIC seemed to
fix the problem on Linux, so do I really need that ld option?

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Linking problem

2007-11-07 Thread Salvatore Iovene
On 11/7/07, Salvatore Iovene [EMAIL PROTECTED] wrote:

 What do you mean by PIC?
 Thanks!

Oh, -fPIC. I figured it out. Seems to work fine on Linux. I still have
to try it on Windows tho. I hope it's good as a solution and not just
a hack! :)



-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] -pipe, -g and -fPIC on WIN32

2007-11-07 Thread Salvatore Iovene
Hi list,
I'm doing the following:

CHECK_CXX_COMPILER_FLAG(-fPIC HAVE_FPIC_FLAG)

IF(HAVE_FPIC_FLAG)
  SET(${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS} -fPIC)
ENDIF(HAVE_FPIC_FLAG)

And the same with -pipe and -g.

This works fine in Linux, but when trying on WIN32 with Visual Studio
command line prompt, I get that the check for the flag succedes, but
then the compiler options are actually -pipe -g -fPIC and the compiler
issues a warning about ignoring those unknown options.

What is the right way of doing this?
Thanks!

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Conditional dependency

2007-11-06 Thread Salvatore Iovene
On 11/6/07, Nicholas Yue [EMAIL PROTECTED] wrote:
 Hi,

   I have a project which is build a library fine with CMake (has
 around 100 source file).

   ADD_LIBRARY ( mylib STATIC a.cpp b.cpp c.cpp etc )

   The content in b.cpp is relevant to only some platform platform.

   How do I tell CMake that file b.cpp is only to be include as depends
 of library mylib only if a platform string match.

   I can achieve the desired effect with

   IF (WIN32)
   ADD_LIBRARY ( mylib STATIC a.cpp c.cpp etc)
   ELSE (WIN32)
   ADD_LIBRARY ( mylib STATIC a.cpp b.cpp c.cpp etc)
   ENDIF (WIN32)

   As there are hundreds of file, I want to avoid duplicating and add
 to maintainence.

Try this:

IF(NOT WIN32)
 SET(b_SOUCE b.cpp)
ENDIF(NOT WIN32)

ADD_LIBRARY ( myLib STATIC a.cpp ${b_SOURCE} c.cpp etc )

If you're not on WIN32, then the variable ${b_SOURCE} will be empty.


-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Linking problem

2007-11-06 Thread Salvatore Iovene
Hi,
I'm not 100% sure this is really a CMake related question, but I'll
fire it up anyway:

I'm building a series of static libraries, name them liba.a, libb.a
and libc.a, and linking them into a shared library libfoo.so.

Then I'm building libx.a liby.a and libz.a and linking them into the
shared libbar.so.

Then I have an executable whatever.exe that's linked to to libfoo.so
and libbar.so. The linking of the executable fails complaining of
certain missing simbols. Some symbols from liba.a are missing in
libbar.so.

So far I have fixed the issue by linking one of the libs of
libfoo.so (say libx.a) to libbar.so. But this smells of nasy
workaround.

Obviously I'm doing something wrong here, so could anyone please help?

Thanks!

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Symbian support

2007-11-05 Thread Salvatore Iovene
On 11/3/07, Alexander Neundorf [EMAIL PROTECTED] wrote:
 What is the development platform ?

Platforms for S60 3rd edition: winscw (emulator), gcce (phone)

 Which compiler do you use ?

mwccsym2.exe (Nokia codewarrior C/C++ compiler for winscw platform)
and gcce (for GCCE platform)

 What are the naming conventions for object files, static libs, shared libs,
 executables on Symbian ?

objfilename.o, staticlibname.lib, dllname.dll, executable.exe

 Are shared libs supported ?

yes, in the form of dlls.

Any thoughts? Thanks.


-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] INCLUDE_DIRECTORIES oddity

2007-03-24 Thread Salvatore Iovene
Hello,
I'm experiencing an odd behaviour of the INCLUDE_DIRECTORY command.
Here's the relevant code:

INCLUDE(UsePkgConfig)
FOREACH(library sdl libpng freetype2)
  PKGCONFIG(${library} INC LIB LD C)
  IF(C)
INCLUDE_DIRECTORIES(${C})
TARGET_LINK_LIBRARIES(wowtris ${LD})
  ELSE(C)
MESSAGE(FATAL_ERROR ${library} is missing.)
  ENDIF(C)
ENDFOREACH(library)

Here's what happens when I make:

/usr/bin/c++   -I/home/siovene/projects/wowtris
-I/home/siovene/projects/wowtris/-D_GNU_SOURCE=1\ -D_REENTRANT\
-I/usr/include/SDL
-I/home/siovene/projects/wowtris/
-I/home/siovene/projects/wowtris/-I/usr/include/freetype2
-I/usr/include/GL   -o CMakeFiles/wowtris.dir/src/Application.o
-c /home/siovene/projects/wowtris/src/Application.cpp

Notice how things like -I/usr/include/libpng12 get _prefixed_ by
-I/home/siovene/projects/wowtris/, so that the final include path will
be wrong.

Am I doing something obviously wrong?

My cmake version is 2.4-patch 5.

Thank you.

-- 
Salvatore Iovene
http://www.iovene.com


signature.asc
Description: PGP signature
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] INCLUDE_DIRECTORIES oddity

2007-03-24 Thread Salvatore Iovene
On Sat, 24 Mar 2007 07:56:21 -0700 Brandon J. Van Every
[EMAIL PROTECTED] wrote:

 Salvatore Iovene wrote:
 
  Am I doing something obviously wrong?

 
 Using an older version of CMake when making a bug report?  :-)

I'm not filing a bug report, as nowhere I alleged this would be a cmake
bug. I was just asking on the mailing list.

  My cmake version is 2.4-patch 5.

 
 See if it's a problem with 2.4.6.

Actually the thing seem to be that cmake adds -I/path/to/my_project to
what it finds in the .pc files. Using ADD_DEFINITION instead of
INCLUDE_DIRECTORIES removes the problem, but I don't think this would
the best way.

-- 
Salvatore Iovene
http://www.iovene.com


signature.asc
Description: PGP signature
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake