Asmodehn Shade | 1 Feb 02:20 2006
Picon

Lib / Examples cmake sample ?

Hi,

I am currently working with CMake on a library with some examples...

CMakeLists.txt
test/CMakeLists.txt

I tried to include one in the other, to add_subdirectory(test) in the first, but none of them gives me what I would like.
And both projects variable gets confused with the paths...
But I am also not sure what I can exactly expect...
I saw there are few bugs / limitations around this area. And I dont really know how I am supposed to do that.

I was just wondering if someone has one "sample simple" configuration that works that I can reproduce, using last version (2.2.3) of cmake.
Also, if I better go for the CVS version of cmake, just let me know.

Thanks a lot !

--
Asmodehn

_______________________________________________
CMake mailing list
CMake@...
http://www.cmake.org/mailman/listinfo/cmake
Filipe Sousa | 1 Feb 10:10 2006
Picon

Re: Lib / Examples cmake sample ?


Asmodehn Shade wrote:
> Hi,
> 
> I am currently working with CMake on a library with some examples...
> 
> CMakeLists.txt
> test/CMakeLists.txt
> 
> I tried to include one in the other, to add_subdirectory(test) in the first,
> but none of them gives me what I would like.
> And both projects variable gets confused with the paths...
> But I am also not sure what I can exactly expect...
> I saw there are few bugs / limitations around this area. And I dont really
> know how I am supposed to do that.
> 
> I was just wondering if someone has one "sample simple" configuration that
> works that I can reproduce, using last version (2.2.3) of cmake.

http://public.kitware.com/cgi-bin/viewcvs.cgi/Tests/?root=CMake

> Also, if I better go for the CVS version of cmake, just let me know.
> 
> Thanks a lot !
> 
> --
> Asmodehn
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> CMake mailing list
> CMake@...
> http://www.cmake.org/mailman/listinfo/cmake

--
Filipe Sousa
Filipe Sousa | 1 Feb 15:28 2006
Picon

[VS8] Option 'GZ' has been deprecated use 'RTC1' instead of 'GZ'


The fallowing warnings are from a program compiled with VS8:

Scanning dependencies of target example
Building C object analysis/example/CMakeFiles/example.dir/example.obj
cl : Command line warning D9035 : option 'GZ' has been deprecated and
will be removed in a future release
cl : Command line warning D9036 : use 'RTC1' instead of 'GZ'
example.c
Linking C shared module ..\..\bin\example.dll
   Creating library ..\..\bin\example.lib and object ..\..\bin\example.exp
Scanning dependencies of target example1
Building C object analysis/example1/CMakeFiles/example1.dir/example.obj
cl : Command line warning D9035 : option 'GZ' has been deprecated and
will be removed in a future release
cl : Command line warning D9036 : use 'RTC1' instead of 'GZ'
example.c
Linking C shared module ..\..\bin\example1.dll
   Creating library ..\..\bin\example1.lib and object ..\..\bin\example1.exp

C:\build\petri>cmake --version
cmake version 2.3-20060201
--
Filipe Sousa
Xavier Delannoy | 1 Feb 16:58 2006

CMake && FreeBSD


hi all, 

I wish to add "bsd.lib.mk" file or other mk files to the Makefile generated by CMake.

How is this possible with CMake ?

regards,

--

-- 
Xavier Delannoy
Tanner Lovelace | 1 Feb 23:00 2006
Picon

FindQt4 qt version message

Greetings,

In FindQt4.cmake the following line doesn't print out
a correct version number:

MESSAGE(STATUS "Found Qt-Version
${QT_INST_MAJOR_VERSION}.${QT_INST_MINOR_VERSION}.${QT_INST_PATCH_VERSION}")

Instead, since the major/minor/patch version variables don't ever
get set, it prints out this:

Found Qt-Version ..

Could it be changed to this instead?

MESSAGE(STATUS "Found Qt-Version ${QTVERSION}")

QTVERSION is set by querying qmake for the version.

Thanks very much.

Cheers,
Tanner Lovelace

--
Tanner Lovelace
clubjuggler at gmail dot com
http://wtl.wayfarer.org/
(fieldless) In fess two roundels in pale, a billet fesswise and an
increscent, all sable.
Asmodehn Shade | 2 Feb 13:37 2006
Picon

Re: VS8 and cmake 2.2.3 [Fwd: RE: [Fwd: visual studio 2005 free version]]

Hi all,

Just to confirm I have the same problem here... CMake 2.2.3

Fresh install of VS8Express + PSDK (option environment variable checked ON). Was able to build the win32 template (from the command line) and run it.
I have checked my paths, I can access cl from the command line, I can access cmake too, but something in between doesnt do it. Same from the CMakeSetup GUI of course.

Event from the Visual express command line which should have all the environement variables set up properly, I get the same error. And the CMakeError.log just says :

>Determining if the C compiler works failed with the following output:
>
>

Is there any way I can get more information on what actually happened ? Someone found more clues ?

Cheers,

30 Jan 2006 15:03:06 -0500, Steve Pieper <pieper <at> bwh.harvard.edu>:
Hi Bill, Karthik -

I've done all the steps on that setup page (including step 5, and
confirmed that a Win32 application will build and run).

Even so, with cmake 2.2.3 I get the message:

"The C compiler "cl" is not able to compile a simple test program.  It
fails with the following output:


Cmake will not be able to correctly generate this project."

I'm putting this into the cmake bug tracker.  I'll put the error log
there, although it's basically empty.

Any other ideas of things to try?

Thanks,
Steve


Karthik Krishnan wrote:
> And after intsalling Platform SDK, you need to go through the steps in
>
> http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
>
> -karthik
>
> William A. Hoffman wrote:
>
>> At 07:10 PM 1/26/2006, Steve Pieper wrote:
>>
>>
>>> Hi -
>>>
>>> Is anyone using the VC++ Express 2005?  We're running into the
>>> problems listed below.  Unless there's a known workaround I'll put
>>> this in the bugtracker.
>>>
>>> Andy,
>>>
>>> Just a little more information.  CMake 2.1 (sometime during that
>>> development lifetime)
>>> was able to perform its try/compiles and configure the project with
>>> the VS8 compiler.
>>> My ITK build with that could not locate windows.h but otherwise
>>> things built.
>>>
>>
>>
>> I just checked and someone here at Kitware is using vs express IDE
>> builds for
>> VTK/ITK with no problems.   I think the clue is that it could not
>> locate windows.h.
>> In addtion to installing VC++ Express 2005, you have to correctly
>> install the SDK
>> for windows.   The instructions are here:
>>
>> http://msdn.microsoft.com/vstudio/express/visualc/download/
>>
>> I think if you follow all 4 steps it works fine.
>>
>> -Bill
>>
>> _______________________________________________
>> CMake mailing list
>> CMake-wChDC6UyXvPYtjvyW6yDsg@public.gmane.org
>> http://www.cmake.org/mailman/listinfo/cmake
>>
>>
>>
_______________________________________________
CMake mailing list
CMake-wChDC6UyXvPYtjvyW6yDsg@public.gmane.org
http://www.cmake.org/mailman/listinfo/cmake

_______________________________________________
CMake mailing list
CMake@...
http://www.cmake.org/mailman/listinfo/cmake
Xavier Delannoy | 2 Feb 15:03 2006

shared and static library

hi all, 

Is there any proper way to build a shared AND static lib with cmake ?

( ADD_LIBRARY(libname SHARED sources ..) && ADD_LIBRARY(libname STATIC sources ..) doesn't work)

Do I need to have 2 directory, one for the shared and one for the static ?

best regards,

--

-- 
Xavier Delannoy
Darko Miletic | 2 Feb 15:31 2006

Re: shared and static library

Xavier Delannoy wrote:
> hi all, 
> 
> Is there any proper way to build a shared AND static lib with cmake ?

Not directly from the same script. You will have to write two separate
scripts for that. One that will produce static lib and another that will
produce shared lib. It can be represented like this:

<root_source_dir>
|
|--<srcdir>
|
|--<static_lib_dir> (script goes here)
|
|--<shared_lib_dir> (script goes here)

So in static_lib_dir CMakeLists.txt will be like this:

SET (SRCS a.cpp b.cpp ... x.cpp)

ADD_LIBRARY(<libname> STATIC ${SRCS})

And in shared_lib_dir CMakeLists.txt will be like this:

SET (SRCS a.cpp b.cpp ... x.cpp)

ADD_LIBRARY(<libname> SHARED ${SRCS})

Or even better you can have one file that lists source files in src
folder and include that one in both scripts like this:

sources.txt:

SET(SRC a.cpp b.cpp ... x.cpp)

So in static_lib_dir CMakeLists.txt will be like this:

INCLUDE(${CGILib_SOURCE_DIR}/src/sources.txt)

ADD_LIBRARY(<libname> STATIC ${SRCS})

And in shared_lib_dir CMakeLists.txt will be like this:

INCLUDE(${CGILib_SOURCE_DIR}/src/sources.txt)

ADD_LIBRARY(<libname> SHARED ${SRCS})

But you get the idea.
Xavier Delannoy | 2 Feb 15:59 2006

Re: shared and static library

On Thu, 02 Feb 2006 11:31:42 -0300
Darko Miletic <darko@...> wrote:

> Xavier Delannoy wrote:
> > hi all, 
> > 
> > Is there any proper way to build a shared AND static lib with cmake ?
> 
> Not directly from the same script. You will have to write two separate
> scripts for that. One that will produce static lib and another that will
> produce shared lib. It can be represented like this:
> 
> <root_source_dir>
> |
> |--<srcdir>
> |
> |--<static_lib_dir> (script goes here)
> |
> |--<shared_lib_dir> (script goes here)
> 
> So in static_lib_dir CMakeLists.txt will be like this:
> 
> SET (SRCS a.cpp b.cpp ... x.cpp)
> 
> ADD_LIBRARY(<libname> STATIC ${SRCS})
> 
> And in shared_lib_dir CMakeLists.txt will be like this:
> 
> SET (SRCS a.cpp b.cpp ... x.cpp)
> 
> ADD_LIBRARY(<libname> SHARED ${SRCS})
> 
> Or even better you can have one file that lists source files in src
> folder and include that one in both scripts like this:
> 
> sources.txt:
> 
> SET(SRC a.cpp b.cpp ... x.cpp)
> 
> 
> So in static_lib_dir CMakeLists.txt will be like this:
> 
> INCLUDE(${CGILib_SOURCE_DIR}/src/sources.txt)
> 
> ADD_LIBRARY(<libname> STATIC ${SRCS})
> 
> And in shared_lib_dir CMakeLists.txt will be like this:
> 
> INCLUDE(${CGILib_SOURCE_DIR}/src/sources.txt)
> 
> ADD_LIBRARY(<libname> SHARED ${SRCS})
> 
> But you get the idea.

this doesn't work, or maybe I do something wrong.

When I do this: 
cd static_lib_dir && cmake . && make 
cd shared_lib_dir && cmake . && make

In my LIBRARY_OUTPUT_PATH I have only have the last type of lib which was build (in this case the shared type).

Any suggestion ?
Mike Talbot | 2 Feb 16:02 2006
Picon

Re: shared and static library

Darko Miletic wrote:
Xavier Delannoy wrote:
hi all, Is there any proper way to build a shared AND static lib with cmake ?
Not directly from the same script. You will have to write two separate scripts for that. One that will produce static lib and another that will produce shared lib. It can be represented like this: <root_source_dir> | |--<srcdir> | |--<static_lib_dir> (script goes here) | |--<shared_lib_dir> (script goes here) So in static_lib_dir CMakeLists.txt will be like this: SET (SRCS a.cpp b.cpp ... x.cpp) ADD_LIBRARY(<libname> STATIC ${SRCS}) And in shared_lib_dir CMakeLists.txt will be like this: SET (SRCS a.cpp b.cpp ... x.cpp) ADD_LIBRARY(<libname> SHARED ${SRCS}) Or even better you can have one file that lists source files in src folder and include that one in both scripts like this: sources.txt: SET(SRC a.cpp b.cpp ... x.cpp) So in static_lib_dir CMakeLists.txt will be like this: INCLUDE(${CGILib_SOURCE_DIR}/src/sources.txt) ADD_LIBRARY(<libname> STATIC ${SRCS}) And in shared_lib_dir CMakeLists.txt will be like this: INCLUDE(${CGILib_SOURCE_DIR}/src/sources.txt) ADD_LIBRARY(<libname> SHARED ${SRCS}) But you get the idea.
I believe that if you don't specify STATIC or SHARED in the ADD_LIBRARY command, then you can control whether libraries are built as shared or static via the BUILD_SHARED_LIBS variable.  If you set this to true in your cache, then all libraries in your project that aren't explicitly STATIC will be built as shared and vice-versa.

something like this should do it:

cd static_lib_dir
cmake -D BUILD_SHARED_LIBS:BOOL=FALSE ../srcdir

cd shared_lib_dir
cmake -D BUILD_SHARED_LIBS:BOOL=TRUE ../srcdir

-- Mike Talbot Senior Software Developer Schlumberger Lambourn Court, Wyndyke Furlong, Abingdon Business Park, Abingdon, Oxfordshire, OX14 1UJ, UK Tel: +44 (0)1235 543 488
_______________________________________________
CMake mailing list
CMake@...
http://www.cmake.org/mailman/listinfo/cmake

Gmane