[CMake] Re: CMake, CPack, RPM

2007-10-10 Thread Eric Noulard
2007/10/10, kent williams <[EMAIL PROTECTED]>:
> OK, so... if I use the built in RPM generator it will generate an RPM.
>  It isn't clear to me what ends up in that RPM aside from the files in
> the manifest -- no dependencies seem to be mentioned.

That's almost true.
RPM generator cannot guess your dependencies and
will package all files which are INSTALL() in your CMakeLists.txt files.
You'll get some dependencies because CPack RPM use
rpmbuild command to build the RPM and this command
try it's best to add "guessable" binary dependencies.

> Using UseRPMTools.cmake to try and generate a source RPM doesn't work
> so hot. You can only make a source RPM if there's a package 'cmake' in
> the RPM database apparently. If you haven't installed such an RPM (and
> I'm not sure who installs CMake from an RPM) you're SOL, even if you
> do have CMake installed and available.

The specs file generated by UseRPMTools
include the requirement:

BuildRequires:  cmake

This is "logical" since the Source RPM you will build
 precisely WILL NEED cmake to produce the binary RPM.

Many RPM based distros I know DO provide cmake prebuilt RPM.
I don't yours but you may try: http://rpm.pbone.net/ in order
to see if you can find one.

>
> Which is kind of a cart-before-horse situation.  Obviously you have
> CMake installed, if you're using CMake to build the RPM.  On the other
> hand, you probably should require CMake as a prerequisite.

You get it.
That's why CPack builtin RPM don't put *any* requirement,
using CPack buitlin RPM you should be able to build a binary RPM
(including CMake RPM itself if you compile CMake yourself).


> This particular program requires ITK, VTK, KWWidgets, (header and
> libs) and CMake (executable) at a minimum for a source distribution.
> For a binary distribution you don't need CMake, but you do need all
> the SO Libraries from ITK, VTK, KWWidgets.  Not sure how I'd put that
> into the spec files.

If you use either CPack built-in RPM or UseRPMTools macro
you are able to specify your own .spec file which may include
your requirement.
See http://wiki.rpm.org/Docs for informations about the content
of a spec file.

For example for RPMTools:

RPMTools_ADD_RPM_TARGETS(packagename)

will generate a "minimal" spec file for you
whereas
RPMTools_ADD_RPM_TARGETS(packagename ${CMAKE_SOURCE_DIR}/package.spec)

will use the provided spec file.

Using CPack built-in RPM
SET(RPM_USER_BINARY_SPECFILE )
will provide the user spec file to the generator.
Currently this may not work because:
http://www.cmake.org/pipermail/cmake/2007-September/016606.html

The trouble is that nor CPack nor UseRPMTools may guess
the requirement you probably "manually" set-up using
a bunch of FIND_PACKAGE + TARGET_LIBRARY +...

May be I can think about a way to "only specify" dependencies
and not the "whole spec file".

I don't know if I would have time for working on this, by the end of this week
but I may give it a try next week.

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


Re: [CMake] adding dependencies on all targets to force CMake to rerun itself

2007-10-10 Thread Philip Lowman
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Alan W. Irwin wrote:
> On 2007-10-10 12:40-0400 Philip Lowman wrote:
>> Basically I have something like this but I want all targets in the build
>> to depend on changes to foo.txt so that CMake runs itself again.
>>
>> MACRO(Foo)
>> FILE(READ ${PROJECT_SOURCE_DIR}/foo.txt contents)
>> ... define variables for include path, directory recursion,
>>etc., that get used later
>> ENDMACRO(Foo)
> 
> It appears you are
> reading the file to "define variables for include path, directory
> recursion,
> etc., that get used later".  Why not simply do that task using CMake
> instructions that are INCLUDEd from a file?
> 
> For example,
> 
> SET (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
> INCLUDE (plplot)

Actually that's probably not a bad idea now.  Originally I had devised
the CMake macro to read a custom file because that's how developers were
used to defining all of the libraries and their allowable include paths
and I didn't want to change existing behavior.  Now that everyone's
bought into CMake perhaps this is a moot point now. :)

- --
Philip Lowman
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHDYhUe0tOktX6RKkRAiDZAJ9l9opBgL/E+R0FP8iktEh1m0UPkQCfbRF6
fCVhSIApMCrB7OoTTkKuuxI=
=ahoA
-END PGP SIGNATURE-
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Re: CMake, CPack, RPM

2007-10-10 Thread kent williams
OK, so... if I use the built in RPM generator it will generate an RPM.
 It isn't clear to me what ends up in that RPM aside from the files in
the manifest -- no dependencies seem to be mentioned.

Using UseRPMTools.cmake to try and generate a source RPM doesn't work
so hot. You can only make a source RPM if there's a package 'cmake' in
the RPM database apparently. If you haven't installed such an RPM (and
I'm not sure who installs CMake from an RPM) you're SOL, even if you
do have CMake installed and available.

Which is kind of a cart-before-horse situation.  Obviously you have
CMake installed, if you're using CMake to build the RPM.  On the other
hand, you probably should require CMake as a prerequisite.

This particular program requires ITK, VTK, KWWidgets, (header and
libs) and CMake (executable) at a minimum for a source distribution.
For a binary distribution you don't need CMake, but you do need all
the SO Libraries from ITK, VTK, KWWidgets.  Not sure how I'd put that
into the spec files.


 make ImageEval_srpm
CPack: Create package using TGZ
CPack: Install projects
CPack: - Install directory: /scratch/kent/temp/slicer/ImageEval
CPack: Compress package
CPack: Finalize package
CPack: Package 
/scratch/kent/temp/slicer/ImageEval-build/ImageEval-1.0.0-Source.tar.gz
generated.
error: Failed build dependencies:
cmake is needed by ImageEval-1.0.0-1.i386
make[3]: *** [CMakeFiles/ImageEval_srpm] Error 1
make[2]: *** [CMakeFiles/ImageEval_srpm.dir/all] Error 2
make[1]: *** [CMakeFiles/ImageEval_srpm.dir/rule] Error 2
make: *** [ImageEval_srpm] Error 2
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] adding dependencies on all targets to force CMake to rerun itself

2007-10-10 Thread Alan W. Irwin

On 2007-10-10 12:40-0400 Philip Lowman wrote:


Hi,

I have a text file that is read in via a CMake macro that dynamically
adjusts the include paths, preprocessor definitions, and link
directives.  CMake automatically rebuilds the code as needed which is
wonderful.

One issue I haven't solved yet is modification of this text file doesn't
force CMake to run itself again.  I was wondering if anyone would have
any ideas how to do this.

Basically I have something like this but I want all targets in the build
to depend on changes to foo.txt so that CMake runs itself again.

MACRO(Foo)
FILE(READ ${PROJECT_SOURCE_DIR}/foo.txt contents)
... define variables for include path, directory recursion,
   etc., that get used later
ENDMACRO(Foo)


It appears you are
reading the file to "define variables for include path, directory recursion,
etc., that get used later".  Why not simply do that task using CMake
instructions that are INCLUDEd from a file?

For example,

SET (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
INCLUDE (plplot)

That second command looks for
${PROJECT_SOURCE_DIR}/cmake/modules/plplot.cmake and includes the lines in
that file just like those lines were part of the current (usually top-level)
CMakeLists.txt file.  The INCLUDE command can be nested so we have something
like 60 *.cmake files in our cmake/modules directory.  That keeps everything
well organized and also keeps our top-level CMakeLists.txt file relatively
small. A change to any of these files which are INCLUDEd (either directly or
through nesting) in our top-level CMakeLists.txt file means that cmake is
automatically rerun which I believe is exactly what you want.

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__

Linux-powered Science
__
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] How to compile java files using cmake?

2007-10-10 Thread Rakesh Kukkamalla
Hi,

 

I am new to cmake and I am trying to compile java classes. I used
ADD_LIBRARY with Java language support but the jar file created has many
more unnecessary files apart from the class file.

 

I can use ADD_CUSTOM_COMMAND and create the class files but I wonder if
there is any better solution to compile java files and build jars using
cmake?

 

Thank you.

Rakesh Kukkamalla

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

Re: [CMake] how broken is the RPM support?

2007-10-10 Thread Eric Noulard
2007/10/10, kent williams <[EMAIL PROTECTED]>:
> I just installed the CVS CMake.  There is a CPackRPM.cmake file in the
> Modules directory, but it's not clear to me how to tell CPack I want
> to generate an RPM, or a Source RPM.
>
> Anyone have any clues for me?

I forgot to tell that CPack RPM and/or UseRPMTools
only works on a _linux_ machine.


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


Re: [CMake] how broken is the RPM support?

2007-10-10 Thread Eric Noulard
2007/10/10, kent williams <[EMAIL PROTECTED]>:
> I just installed the CVS CMake.  There is a CPackRPM.cmake file in the
> Modules directory, but it's not clear to me how to tell CPack I want
> to generate an RPM, or a Source RPM.

If you want to tell CPack to generate RPM you should either:

1) Add RPM generator to the list of CPack generator
in your CMakeLists.txt

SET(CPACK_GENERATOR "TGZ;RPM")
INCLUDE(CPack)

   Then make package will build both TGZ and RPM.

2) or Invoke cpack command manually like:
cpack -G RPM [-C CPackConfig.cmake]

You could check package generator built-in CPack using
cpack --help.

>
> Anyone have any clues for me?

More info on current CPack RPM support and limitations here:
http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM
and included links.

The main limitation of current CPack RPM support is that it can
only build binary RPM.
If you need to build source RPM you may use UseRPMTools.cmake
see:
http://www.cmake.org/Wiki/CMakeUserUseRPMTools

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


[CMake] how broken is the RPM support?

2007-10-10 Thread kent williams
I just installed the CVS CMake.  There is a CPackRPM.cmake file in the
Modules directory, but it's not clear to me how to tell CPack I want
to generate an RPM, or a Source RPM.

Anyone have any clues for me?
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Getting CMake to run on OpenVMS

2007-10-10 Thread Alan Antonuk
Getting closer - got over what I think are most of the issues involving the
HP C-RTL and the differences between Unix and OpenVMS pathnames.  Two issues
up next:

1. The OpenVMS version of the fork() syscall (a.k.a., vfork) doesn't have
the same semantics as the Unix/Linux version of fork.  The big difference
being OpenVMS fork does not actually fork off into a new process until
exec*() is called.  This means the two threads are operating in the same
address space until that exec*() function is called (see
http://h71000.www7.hp.com/doc/82FINAL/5763/5763pro_014.html).  Only place
this is an issue is in the kwsys/ProcessUNIX.c in kwsysProcessFork and in
kwsysProcessCreate

Is there any reason that there may be some issue with this?  I believe that
the way the code is structured that this won't cause an issue, but I'm not
100% sure in that assertation.

2. When running cmake I'm now getting this error message:
loading initial cache file /CMAKE_BIN/Bootstrap^.cmk/InitialCacheFlags.cmake
Error processing file:/CMAKE_BIN/Bootstrap^.cmk/InitialCacheFlags.cmake
CMake Error: CMake was unable to find a build program corresponding to "Unix
Mak
efiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a
differen
t build tool.
CMake Error: Error required internal CMake variable not set, cmake may be
not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be
not be
 built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module
file:/CMAKE_SRC/00/CMakeFiles/CMake
CCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be
not be
 built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be
not be
 built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module
file:/CMAKE_SRC/00/CMakeFiles/CMake
CXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring done

Suggestions as to where to start tackling this second issue?

-Alan


>
> On 9/28/07, Bill Hoffman <[EMAIL PROTECTED]> wrote:
> >
> > Well, either an ifdef VMS, or a try_compile should be used to get the
> > right signature for the handler.
> > Sounds like you are making good progress.  I would recommend getting it
> > to build any way possible,
> > then send diffs to me and we can work out the right way to do it.
> > Sounds like you are making good
> > progress!
> >
> > -Bill
> >
> >
>
>
> --
> +––– –– –  –   – –  –
> | Alan Antonuk
> | [EMAIL PROTECTED], [EMAIL PROTECTED]
>   tel cell: (734) 646-4476
> | tel work: (734) 647-1386
>   addr: 1705 Morehead Dr., Ann Arbor, MI 48103
> | aim: alanxz1
>



-- 
+––– –– –  –   – –  –
| Alan Antonuk
| [EMAIL PROTECTED], [EMAIL PROTECTED]
  tel cell: (734) 646-4476
| tel work: (734) 647-1386
  addr: 1705 Morehead Dr., Ann Arbor, MI 48103
| aim: alanxz1
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] qmake to cmake

2007-10-10 Thread Marie-Christine Vallet

Brandon Van Every wrote:

On 10/10/07, Ajay Divekar <[EMAIL PROTECTED]> wrote:
  

Hello Experts,

I found this ruby script on

http://www.cmake.org/Wiki/CMake:ConvertFromQmake

 which helps in converting from qmake to cmake. Has anyone tried it and if
so what has been there experience? Also before I start if anyone has any
suggestion they are welcome.



  

Hi,
I am no expert but I used this converted, and ended up doing some 
modifications by hand.

But if your .pro files are not too complex, it's pretty straightforward.
Marie

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


[CMake] purify targets

2007-10-10 Thread Juan Sanchez
Hello,

Is it possible to build both purify and non purify targets by changing
CMAKE_CXX_LINK_EXECUTABLE?  Unfortunately the following example purify's
both binaries.

ADD_EXECUTABLE(hello helloworld.cc)
SET (CMAKE_CXX_LINK_EXECUTABLE "purify -cache-dir=/tmp
${CMAKE_CXX_LINK_EXECUTABLE}")
ADD_EXECUTABLE(hello.purify helloworld.cc)

Thanks,

Juan


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


[CMake] adding dependencies on all targets to force CMake to rerun itself

2007-10-10 Thread Philip Lowman
Hi,

I have a text file that is read in via a CMake macro that dynamically
adjusts the include paths, preprocessor definitions, and link
directives.  CMake automatically rebuilds the code as needed which is
wonderful.

One issue I haven't solved yet is modification of this text file doesn't
force CMake to run itself again.  I was wondering if anyone would have
any ideas how to do this.

Basically I have something like this but I want all targets in the build
to depend on changes to foo.txt so that CMake runs itself again.

MACRO(Foo)
FILE(READ ${PROJECT_SOURCE_DIR}/foo.txt contents)
... define variables for include path, directory recursion,
etc., that get used later
ENDMACRO(Foo)

-- 
Philip Lowman
Sr. Simulation Development Engineer, Modeling and Simulation Technology
General Dynamics Land Systems
http://www.gdls.com
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Custom Command Target Pre_Link

2007-10-10 Thread alexander
Hi all,

I have a problem with a custom command.
This custom command should be called after all custom commands, so i decided to 
used the TARGET specific one with the option PRE_LINK. But when i run first 
cmake and then make, the custom command will not be build.

I use Linux and the command which I wrote looks similar to:
ADD_CUSTOM_COMMAND(TARGET FOO PRE_LINK
   
   COMMENT "Building for target foo")

I can't use a custom command with OUTPUT because i use the name (source files) 
already in a macro, so cmake will complain about that.

So the idea was to use this custom command with target as a postprocessing of 
my generated files (generated during macro use). The macro is for general use, 
so I can't put the custom command target into the macro, because sometimes I 
don't have postprocessing and sometimes the postprocess differ.

So now my questions:

1. Have I understand the docu correctly? Because my custom command target is 
never called. Even if i have forced a dependency with ADD_DEPENDENCIES!

2. Is there any other way I can do the postprocessing? What I don't want to use 
is a custom target with ADD_CUSTOM_TARGET, because the postprocess should only 
be invoked when the files have changed and the postprocessed files should be 
deleted when i call clean.

Any help would be recommended.

Greetings

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


Re: [CMake] qmake to cmake

2007-10-10 Thread Brandon Van Every
On 10/10/07, Ajay Divekar <[EMAIL PROTECTED]> wrote:
> Hello Experts,
>
> I found this ruby script on
>
> http://www.cmake.org/Wiki/CMake:ConvertFromQmake
>
>  which helps in converting from qmake to cmake. Has anyone tried it and if
> so what has been there experience? Also before I start if anyone has any
> suggestion they are welcome.

That's a teeny weeny little conversion script.  It's not going to do
much for you, so I don't see a point in setting any expectations.  If
you know your way around regular expressions, it represents a day's
worth of coding at best.  So use it or don't use it, it doesn't really
matter.  You should see the monster of a conversion script I'm working
on.  Sorry, the contract prevents me from talking more about it or
showing it off.  Let's just say it ain't no 1 page thing.


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


Re: [CMake] get the target name in add_custom_command

2007-10-10 Thread Brandon Van Every
On 10/9/07, Juan Sanchez <[EMAIL PROTECTED]> wrote:
> In this example, the target name foo has a different OUTPUT_NAME.  How
> do I tell ADD_CUSTOM_COMMAND to use the real name of the target when I
> try to use the copy command within?

GET_TARGET_PROPERTY.  Set a variable outside the ADD_CUSTOM_COMMAND,
then use it.

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


[CMake] qmake to cmake

2007-10-10 Thread Ajay Divekar
Hello Experts,

I found this ruby script on

http://www.cmake.org/Wiki/CMake:ConvertFromQmake

which helps in converting from qmake to cmake. Has anyone tried it and if so
what has been there experience? Also before I start if anyone has any
suggestion they are welcome.

Regards,

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

[CMake] adding library

2007-10-10 Thread Javier Gonzalez
Hi all,

Quick question: isn't it possible to create a target library and later
specify the sources?  (ADD_LIBRARY first and something like
SET_TARGET_PROPERTIES(... SOURCES ...)  later) or at least add to the
sources.

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


Re: [CMake] How can I avoid the addition of Debug/Release to the link path?

2007-10-10 Thread Sylvain Benner


If it is something not being built by cmake, then a full path should 
be used,

and cmake should do the right thing.   LINK_DIRECTORIES should be
used as a last resort.   If the library does not exist at cmake run 
time, because
it will be built by the cmake project, then it should work.  If the 
library
does exist at configure time, then a full path to the library should 
be used.
Ok, so the answer to the original issue is to provide the full path to 
the required libraries with LINK_LIBRARIES or TARGET_LINK_LIBRARIES 
provided they are not built by the CMake project, that's right ?


I'm sorry for the confusion I've put, here we use a complete new 
generator for XCode which mimics the Solution/Project structure of 
Visual Studio, and so I'm not aware of normal CMake usage.


--Sylvain

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