Re: [CMake] CMake & RPM problems

2009-05-12 Thread Eric Noulard
2009/5/10 Alexander Neundorf :
> On Sunday 10 May 2009, Eric Noulard wrote:

>>
>> Currently the INSTALL(SCRIPT/CODE ... ) script is too loose, moreover
>> as far as I know there aren't any "uninstall rules"...
>>
>> So currently I think we can get INSTALL(SCRIPT/CODE ... ) to be embedded
>> into RPM post-install rules, I do have to find where thoses scripts
>> are generated though.
>>
>> There will be several remaining issues:
>>     1) You usually don't want to run "INSTALL(SCRIPT/CODE ... )" when
>> building the RPM, however now since CPack basically do install with
>> relocation they are.
>
> Hmm, yes, usually, but maybe sometimes you do want to run them...

Yes agreed, but may be you should have the choice to launch them or not,
currently I think you do not have choice.
In fact you may want to specify that you DO want to run those scripts
if you do "make install"
but not if do "install" from within CPack.

In fact if CPack generator were running in some kind of chroot-ed
env it would be OK but currently, updating icon-cache  or menu entry
because you are **building** a package is plain wrong.


>>     2) There is no associated "uninstall" rules, which is just bad
>> because you may
>>          leave dangling menu entry and/or icon.
>
> Hmm ?

In package like RPMs you usually have symmetric  postinstall /
postuninstall actions.

e.g.:
postinstall --> install a freedesktop menu entry
postuninsrall (or may be preuninstall) --> uninstall the freedesktop menu entry

With the current "INSTALL(SCRIPT/CODE" thing you do not have way to
specify "UNINSTALL(SCRIPT/CODE"), this is basically because there is no

[make] uninstall target generated by cmake.

in fact

INSTALL(SCRIPT file) would better be:

INSTALL(SCRIPT doit.cmake
 UNSCRIPT undoit.cmake)

the "UNSCRIPT" part should be optionnal.

We should even have POST-SCRIPT POST-UNSCRIPT, PRE-SCRIPT, PRE-UNSCRIPT
if we want to know WHEN those install-time actions will take place.

The fact is I don't know if it's CMake job to do "install-time" actions,
but this is definitely a essential functions of package format
(RPM, NSIS, DEB,  etc...)
those formats comes with their own "install-time scripts language".
should we import the feature into CMake INSTALL(SCRIPT/UNSCRIPT) ?

My opinion is, I don't think so, but I may be wrong.
I would rather have trap-door to "native" package format scripts with
CPACK_RPM_XXX
CPACK_DEB_XXX
CPACK_NSIS_XXX

What do (all) you think?

>> Alex,
>> Does KDE uses INSTALL(SCRIPT/CODE ... ) ?
>
> Yes.
>
>> If yes how do packager do for handling that in DEB, RPM ... ?
>
> This is done completely independent.
> The official distribution packager build their packages themselves anyway.

That's why I wanted to support "custom spec file" with the CPack RPM generator,
this way if the CPack RPM -generated spec file is not "good enough" one
may use it's custom made one.

It's about the same kind of discussion we had about DEB generator being accepted
by debian developers. I think packager is a plain job in itself and
may be CPack
won't ever be good enough to be the working tool of packagers.

However I think CPack (RPM, DEB, NSIS, etc...) should give "enough" control
to newbie packager in order to get "not so bad" packages out-of-the-box.

Concerning CPack RPM what about commiting
http://public.kitware.com/Bug/view.php?id=8988 to HEAD?


-- 
Erk
___
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 & RPM problems

2009-05-10 Thread Alexander Neundorf
On Sunday 10 May 2009, Eric Noulard wrote:
> 2009/5/9 Alexander Neundorf :
> > On Thursday 07 May 2009, Eric Noulard wrote:
> > ...
> >
> >> 1) Add more CPACK_RPM_XXX specific var such like:
> >>      CPACK_RPM_POST_INSTALL_SCRIPT_FILE
> >>      CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
> >>
> >>      which may be used to specify the corresponding scripts
> >>      that will be embedded in the generated spec file.
> >
> > Just a thought, do you think this could in some way with the
> > INSTALL(SCRIPT/CODE ... ) command ?
> > I guess quite often this already does what is required (at least in KDE
> > it also does the update-icon-cache etc. stuff).
> > But a problem would be that then cmake would be necessary when installing
> > such a RPM :-/
>
> Yes I did think about that too just as you did.
> In fact the notion of install-time script may be supported by various
> CPack generator (DEB, RPM , NSIS etc...).

Yes.

> It would be a good thing to either:
>- launch INSTALL(SCRIPT/CODE ... ) with an extra cmake dependency
>  (the dependency may be added by the generator if it knows that
>   there exists some INSTALL(SCRIPT/CODE ... ) rules)
>
>   - translate INSTALL(SCRIPT/CODE ... ) into it's own supported language.
> For example RPM uses bash and I'm pretty sure CMake scripts may
> be translated into shell scripts.
> That would be nicer (no extra dependency) but surely harder to
> implement.

Yes.

>
> Another thing I did not look at is "WHEN" INSTALL(SCRIPT/CODE ... )
> are launched?
> In RPM you can usually chose between pre-install scripts and
> post-install scripts
> (and their uninstall counterpart).
>
> Currently the INSTALL(SCRIPT/CODE ... ) script is too loose, moreover
> as far as I know there aren't any "uninstall rules"...
>
> So currently I think we can get INSTALL(SCRIPT/CODE ... ) to be embedded
> into RPM post-install rules, I do have to find where thoses scripts
> are generated though.
>
> There will be several remaining issues:
> 1) You usually don't want to run "INSTALL(SCRIPT/CODE ... )" when
> building the RPM, however now since CPack basically do install with
> relocation they are.

Hmm, yes, usually, but maybe sometimes you do want to run them...

> 2) There is no associated "uninstall" rules, which is just bad
> because you may
>  leave dangling menu entry and/or icon.

Hmm ?

> 3) You ger an extra cmake dependency ...
>
>
> Alex,
> Does KDE uses INSTALL(SCRIPT/CODE ... ) ?

Yes.

> If yes how do packager do for handling that in DEB, RPM ... ?

This is done completely independent.
The official distribution packager build their packages themselves anyway.

Alex

___
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 & RPM problems

2009-05-10 Thread Eric Noulard
2009/5/9 Alexander Neundorf :
> On Thursday 07 May 2009, Eric Noulard wrote:
> ...
>> 1) Add more CPACK_RPM_XXX specific var such like:
>>      CPACK_RPM_POST_INSTALL_SCRIPT_FILE
>>      CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
>>
>>      which may be used to specify the corresponding scripts
>>      that will be embedded in the generated spec file.
>
> Just a thought, do you think this could in some way with the
> INSTALL(SCRIPT/CODE ... ) command ?
> I guess quite often this already does what is required (at least in KDE it
> also does the update-icon-cache etc. stuff).
> But a problem would be that then cmake would be necessary when installing such
> a RPM :-/

Yes I did think about that too just as you did.
In fact the notion of install-time script may be supported by various
CPack generator (DEB, RPM , NSIS etc...).

It would be a good thing to either:
   - launch INSTALL(SCRIPT/CODE ... ) with an extra cmake dependency
 (the dependency may be added by the generator if it knows that
  there exists some INSTALL(SCRIPT/CODE ... ) rules)

  - translate INSTALL(SCRIPT/CODE ... ) into it's own supported language.
For example RPM uses bash and I'm pretty sure CMake scripts may
be translated into shell scripts.
That would be nicer (no extra dependency) but surely harder to implement.

Another thing I did not look at is "WHEN" INSTALL(SCRIPT/CODE ... )
are launched?
In RPM you can usually chose between pre-install scripts and
post-install scripts
(and their uninstall counterpart).

Currently the INSTALL(SCRIPT/CODE ... ) script is too loose, moreover
as far as I know there aren't any "uninstall rules"...

So currently I think we can get INSTALL(SCRIPT/CODE ... ) to be embedded
into RPM post-install rules, I do have to find where thoses scripts
are generated though.

There will be several remaining issues:
1) You usually don't want to run "INSTALL(SCRIPT/CODE ... )" when building
 the RPM, however now since CPack basically do install with relocation
 they are.

2) There is no associated "uninstall" rules, which is just bad
because you may
 leave dangling menu entry and/or icon.

3) You ger an extra cmake dependency ...


Alex,
Does KDE uses INSTALL(SCRIPT/CODE ... ) ?
If yes how do packager do for handling that in DEB, RPM ... ?



-- 
Erk
___
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 & RPM problems

2009-05-09 Thread Alexander Neundorf
On Thursday 07 May 2009, Eric Noulard wrote:
...
> 1) Add more CPACK_RPM_XXX specific var such like:
>  CPACK_RPM_POST_INSTALL_SCRIPT_FILE
>  CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
>
>  which may be used to specify the corresponding scripts
>  that will be embedded in the generated spec file.

Just a thought, do you think this could in some way with the 
INSTALL(SCRIPT/CODE ... ) command ?
I guess quite often this already does what is required (at least in KDE it 
also does the update-icon-cache etc. stuff).
But a problem would be that then cmake would be necessary when installing such 
a RPM :-/

Alex
___
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 & RPM problems

2009-05-07 Thread Eric Noulard
2009/5/7 Florent Lagaye :

Florent,

Try not to drop CMake ML when answering.

>> Eric Noulard a écrit :
>> Could you explain us (or point the appropriate documentation)
>> on how the "freedesktop file" should work?
>
>
> Freedesktop is The standard used by gnome and kde to specify "desktop
> entries" which in fact are application launchers. That's why when you
> install a KDE app, the menu entry is also present in gnome menus.
>
> http://standards.freedesktop.org/desktop-entry-spec/latest/index.html

OK I'll read this.


>>     - How can I tell CPack to put instruction to create and associate new
>> mime-types ?
>
> For mime-types and icons I got a little further.
>
> The icon is in /share/icons/hicolor/scalable/apps/v4d.svg
>
> I built an xml file according to :
> http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html
> The file is in /share/mime/packages/viewer4d.mime.xml
>
> Now I should add in the RPM SPEC file the three commands needed to update
> the desktop database (update-desktop-database as root), the mime
> (update-mime-database) database and the icon database
> (gtk-update-icon-cache) in the %post and %postun sections.
>
> Would CPack allow to use a template SPEC file, which it would fill (much
> more like UseRpmTools), instead of creating a plain new one from scratch
> each time ?

CPackRPM should be able to work with a custom spec file,

SET(CPACK_RPM_USER_BINARY_SPECFILE   your_custom.spec)
The specified file will be
CONFIGURE_FILE( ... @ONLY)
the current state of the feature is "not tested", thus most probably
not working :-)

I should have time tomorrow for working on this, what I'll most
probably be doing
is to offer two ways to do this:

1) Add more CPACK_RPM_XXX specific var such like:
 CPACK_RPM_POST_INSTALL_SCRIPT_FILE
 CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE

 which may be used to specify the corresponding scripts
 that will be embedded in the generated spec file.

2) Effectively support the custom spec file usage.

I'd like to support both because it's not that intuitive to write a
proper spec file
which works with CPack because it's a kind of "short-cutted" one.
Have a look of the spec file currently generated and you'll see.
(no %prep, %build nor %install sections).


-- 
Erk
___
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 & RPM problems

2009-05-06 Thread Eric Noulard
2009/5/6 Florent Lagaye :
> Hi,
>
> Thanks so much, it works now ! I can build an rpm package ! so nice.

Nice to ear, I'll will take time to provide a patch in order to make
the working change go upstream.

> I've got new questions now the I can build the rpm.
>
>     - How can I embed a freedesktop file that links to an icon (svg) ?

I would say that you'll have to put the icon file in your source tree
and to install it with

INSTALL(FILE myicon.svg DESTINATION share/icons)

Then regarding the creation of the link and the "freedesktop file" I don't
know. How does it works? Should you create some sort of special link
to the SVG file?
Do you need to create the "freedesktop file" at installation time,
the concerned will then refer to the installed icon file?

Could you explain us (or point the appropriate documentation)
on how the "freedesktop file" should work?

>     - Where should I put the icon file ?

Like I said I would put the file in the source tree and then

INSTALL(FILE ) it with appropriate path.

>     - How can I tell CPack to put instruction to update the icon cache after
> installation ?

I bet CPack won't do it but the package used should, in this case RPM
I think it would be a post-install script to be embedded in the RPM.

I have to look into this but if you need such "pre/post install scripts" I bet
the current CPackRPM won't be enough you'll have to patch it to suit
those needs.

We may discuss this and propose appropriate patches to CMake developper.

Whatever the solution how would you "update the icon cache" "by hand",
is there some command to launch?

>     - How can I tell CPack to put instruction to create and associate new
> mime-types ?

Same question as before.

>
> Thanks very much Eric for your answers.

You are welcome.

-- 
Erk
___
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 & RPM problems

2009-05-06 Thread Florent Lagaye

Hi,

Thanks so much, it works now ! I can build an rpm package ! so nice.

I've got new questions now the I can build the rpm.

   - How can I embed a freedesktop file that links to an icon (svg) ?
   - Where should I put the icon file ?
   - How can I tell CPack to put instruction to update the icon cache 
after installation ?
   - How can I tell CPack to put instruction to create and associate 
new mime-types ?


Thanks very much Eric for your answers.

Regards,
Florent.

Eric Noulard a écrit :

2009/5/5 Florent Lagaye :
  

Yes all the other package types do work:



[...]

  

My distrib is fedora
core 10.  RPM versions follow:

$>rpmbuild --version
RPM version 4.6.0

$>rpm --version
RPM version 4.6.0



After some digging the same problem popped-up on march.
See:
http://www.cmake.org/pipermail/cmake/2009-March/028019.html

and the solution:
http://www.cmake.org/pipermail/cmake/2009-March/028301.html

I forgot to file a bug report, thus this issue has gone unfixed.
I did file a bug report this time:
http://public.kitware.com/Bug/view.php?id=8967

I'll try to submit a proper patch against CMake 2.6 tree and request
for inclusion in the nexr CMake/CPack 2.6 release.

In the meantime would try to use the proposed solution in:
http://www.cmake.org/pipermail/cmake/2009-March/028301.html

and comment if it works for you too on the tracker:
http://public.kitware.com/Bug/view.php?id=8967

  


___
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 & RPM problems

2009-05-05 Thread Eric Noulard
2009/5/5 Florent Lagaye :
> Thanks for the answer. There was really an INCLUDE(CPack) command don't know
> why it didn't get shiped with the mail. I was really using UseRPMTools, I
> changed that.

OK.

> Here's my new CMakeLists.txt:

[...]

Looks good.

[...]

> [100%] Built target viewer4d
> Run CPack packaging tool...
> CPack: Create package using RPM
> CPack: Install projects
> CPack: - Run preinstall target for: viewer4d
> CPack: - Install project: viewer4d
> CPack: Compress package
> CPack: Finalize package
> CPack Error: Problem copying the package:
> /local_scratch/lagaye/viewer4d/bin.release/_CPack_Packages/Linux/RPM/viewer4d-1.0.0-Linux.rpm
> to /local_scratch/lagaye/viewer4d/bin.release/viewer4d-1.0.0-Linux.rpm
> CPack Error: Error when generating package: viewer4d
> make: *** [package] Erreur 1

strange.

Does it work with with other CPack generator like, DEB, ZIP, TGZ ?

>
> Thanks what is it I miss ? I found the following error log in
> "my_build_dir/_CPack_Packages/Linux/RPM/rpmbuild.err" :

I'm running out of time for looking into it now.
I'll have a look tonight.

However would try 2 things:

1) Run CPack RPM in debug mode using

cd /to/build/dir
cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM

Then send me the output.

2) Add SET(CPACK_SET_DESTDIR ON)
 to your CMakeLists.txt before INCLUDE(CPack)
 the option is necessary if you use "absolute install path"
 which is not your case but I wonder if it could change something.

3) What is your Linux distro (with version)
 it has been reported RPM trouble with recent Fedora distrib'.
 Give me the rpm commands version too:
 rpm --version
 rpmbuild --version


> Sorry, my locale is French, so some messages are in French, but I bet you're
> French too ?

Yes I am no problem :-)

More investigation tonight...

-- 
Erk
___
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 & RPM problems

2009-05-05 Thread Florent Lagaye
Thanks for the answer. There was really an INCLUDE(CPack) command don't 
know why it didn't get shiped with the mail. I was really using 
UseRPMTools, I changed that.


Here's my new CMakeLists.txt:

cmake_minimum_required(VERSION 2.6)

PROJECT( viewer4d )

SET( VERSION 1.0.0 )

SET( ${PROJECT_NAME}_MAJOR_VERSION 1 )
SET( ${PROJECT_NAME}_MINOR_VERSION 0 )
SET( ${PROJECT_NAME}_PATCH_LEVEL 0 )

SET( PACKAGE_VERSION 
${viewer4d_MAJOR_VERSION}.${viewer4d_MINOR_VERSION}.${viewer4d_PATCH_LEVEL} 
)

SET( CPACK_PACKAGE_VERSION_MAJOR ${viewer4d_MAJOR_VERSION} )
SET( CPACK_PACKAGE_VERSION_MINOR ${viewer4d_MINOR_VERSION} )
SET( CPACK_PACKAGE_VERSION_PATCH ${viewer4d_PATCH_LEVEL} )
SET( CPACK_PACKAGE_VERSION 
${viewer4d_MAJOR_VERSION}.${viewer4d_MINOR_VERSION}.${viewer4d_PATCH_LEVEL} 
)

SET( CPACK_PACKAGE_DESCRIPTION_SUMMARY "A 4D viewer")
SET( CPACK_PACKAGE_VENDOR "INRIA - Florent LAGAYE")
SET( CPACK_GENERATOR "RPM")
SET( CPACK_SOURCE_PACKAGE_FILE_NAME "viewer4d-${VERSION}" CACHE INTERNAL 
"tarball basename" )

SET( CPACK_SOURCE_GENERATOR TGZ )
SET( CPACK_IGNORE_FILES
"~$"
"^.*/.svn/.*$"
)

INCLUDE( CPack )

FIND_PACKAGE( OpenGL REQUIRED )

FIND_PACKAGE( Qt4 REQUIRED )

SET( QT_USE_QTCORE 1 )
SET( QT_USE_QTGUI 1 )
SET( QT_USE_QTXML 1 )
SET( QT_USE_QTOPENGL 1 )

INCLUDE( ${QT_USE_FILE} )

SET( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules )

SET( viewer4d_SRCS
 main.cpp
 Application.h Application.cpp
 Camera.h  Camera.cpp
 DisplayCamera.h   DisplayCamera.cpp
 Debug.h   Debug.cpp
 Exception.h   Exception.cpp
 Frame.h   Frame.cpp
 Matrix.h
 Mesh.hMesh.cpp
 ProgressWindow.h  ProgressWindow.cpp
 Quaternion.h  Quaternion.cpp
 Selectable.h  Selectable.cpp
 Positionable.hPositionable.cpp
 Sequence.hSequence.cpp
 SequenceCollection.h  SequenceCollection.cpp
 Setup.h   Setup.cpp
 StreamDumper.hStreamDumper.cpp
 Streamer.hStreamer.cpp
 StreamFile.h  StreamFile.cpp
 StreamFile_0_2.h  StreamFile_0_2.cpp
 Timer.h   Timer.cpp
 ToolBox.h ToolBox.cpp
 TriState.hTriState.cpp
 Vector.h  Vector.cpp
 Viewer3d.hViewer3d.cpp
 ViewerWindow.hViewerWindow.cpp
 Light.h   Light.cpp
)

SET( viewer4d_UIS
 Viewer4dMainWindow.ui
 ProgressWindow.ui
 CameraDock.ui AnimationDock.ui DisplayDock.ui
 MeshDock.ui SequenceDock.ui TextureDock.ui
 LightDock.ui
)

SET( viewer4d_RCS viewer4d.qrc )

SET( viewer4d_MOCS Application.h ViewerWindow.h ProgressWindow.h Light.h 
Selectable.h Positionable.h Viewer3d.h )


QT4_ADD_RESOURCES( viewer4d_SRCS ${viewer4d_RCS} )

QT4_WRAP_CPP( viewer4d_SRCS ${viewer4d_MOCS} )

QT4_WRAP_UI( viewer4d_SRCS ${viewer4d_UIS} )

INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}
   ${PROJECT_BINARY_DIR}
   ${QT_INCLUDE_DIR}
   ${QT_QTXML_INCLUDE_DIR}
   ${QT_QTGUI_INCLUDE_DIR}
   ${QT_QTCORE_INCLUDE_DIR}
   ${QT_QTOPENGL_INCLUDE_DIR}
   ${OPENGL_INCLUDE_DIR}
)

SET( CMAKE_CXX_FLAGS "-Wall" )
SET( CMAKE_CXX_FLAGS_RELEASE "-O3 -DV4D_DEBUG_LVL=2" )
SET( CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DV4D_DEBUG_LVL=3 -DV4D_PROFILING" )
SET( CMAKE_CXX_FLAGS_PROFILE "-pg -O3" )

ADD_EXECUTABLE( viewer4d ${viewer4d_SRCS} )

TARGET_LINK_LIBRARIES( viewer4d
   ${QT_QTXML_LIBRARY_DEBUG}
   ${QT_QTGUI_LIBRARY_DEBUG}
   ${QT_QTCORE_LIBRARY_DEBUG}
   ${QT_QTOPENGL_LIBRARY_DEBUG}
   ${OPENGL_LIBRARY}
)

INSTALL( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../example DESTINATION 
share/viewer4d )
INSTALL( FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/v4d.svg DESTINATION 
share/viewer4d )

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

My command call for Makefile generation:

my_build_dir$ >rm -rf * ; cmake  -DCMAKE_BUILD_TYPE=Release -G "Unix 
Makefiles" ../src

-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/lib64/ccache/gcc
-- Check for working C compiler: /usr/lib64/ccache/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++
-- Check for working CXX compiler: /usr/lib64/ccache/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
-- Looking for XOpenDisplay in 
/usr/lib64/libX11.so;/usr/lib64/libXext.so - found

-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib64/libX11.so
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_W

Re: [CMake] CMake & RPM problems

2009-05-05 Thread Eric Noulard
2009/5/5 Florent Lagaye :
> Hi everybody,
>
> I'm a big cmake fan, I use to generate kdevelop projects and makefile.
> Now that my application as achieved an "acceptable" completion level, I
> think about deployment.
>
> So, I started using CPack from within CMake (2.6) (via my CMakeLists.txt
> file). But I can't manage to build an rpm package.
>
> Here is my CMakeLists.txt file :
>
> [code]
> cmake_minimum_required(VERSION 2.6)
>
> PROJECT( viewer4d )
>
> SET( VERSION 1.0.0 )
>
> SET( ${PROJECT_NAME}_MAJOR_VERSION 1 )
> SET( ${PROJECT_NAME}_MINOR_VERSION 0 )
> SET( ${PROJECT_NAME}_PATCH_LEVEL 0 )
>
> SET( PACKAGE_VERSION
> ${viewer4d_MAJOR_VERSION}.${viewer4d_MINOR_VERSION}.${viewer4d_PATCH_LEVEL}
> )
> SET( CPACK_PACKAGE_VERSION_MAJOR ${viewer4d_MAJOR_VERSION} )
> SET( CPACK_PACKAGE_VERSION_MINOR ${viewer4d_MINOR_VERSION} )
> SET( CPACK_PACKAGE_VERSION_PATCH ${viewer4d_PATCH_LEVEL} )
> SET( CPACK_PACKAGE_VERSION
> ${viewer4d_MAJOR_VERSION}.${viewer4d_MINOR_VERSION}.${viewer4d_PATCH_LEVEL}
> )
> SET( CPACK_PACKAGE_DESCRIPTION_SUMMARY "A 4D viewer")
> SET( CPACK_PACKAGE_VENDOR "INRIA - Florent LAGAYE")
> SET( CPACK_SOURCE_PACKAGE_FILE_NAME "viewer4d-${VERSION}" CACHE INTERNAL
> "tarball basename" )
> SET(CPACK_SOURCE_IGNORE_FILES
>  "~$"
>  "^${PROJECT_SOURCE_DIR}.*/.svn/"
> )
>
[...]

> )
> [/code]

I didn't see INCLUDE(CPack) in your CMakeLists.txt, I must be there
in order to make CPack work.

You should INCLUDE(CPack) after your have defined you own
CPACK_ vars.

>
> And here is what "make viewer4d_rpm" tells me :
>

You are trying to use UseRPMTools.cmake instead of the builtin
CMake/CPack  2.6 RPM support, see:

http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29

> What am I missing here ?

With CPack 2.6 you should be able to do:

cd /to/build_dir
cpack -G RPM

or you may set
SET(CPACK_GENERATOR "TGZ;ZIP;RPM")

or any list of appropriate CPack generator you want to use when launching

make package.

-- 
Erk
___
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 & RPM problems

2009-05-05 Thread Florent Lagaye

Hi everybody,

I'm a big cmake fan, I use to generate kdevelop projects and makefile.
Now that my application as achieved an "acceptable" completion level, I
think about deployment.

So, I started using CPack from within CMake (2.6) (via my CMakeLists.txt
file). But I can't manage to build an rpm package.

Here is my CMakeLists.txt file :*

[code]
cmake_minimum_required(VERSION 2.6)

PROJECT( viewer4d )

SET( VERSION 1.0.0 )

SET( ${PROJECT_NAME}_MAJOR_VERSION 1 )
SET( ${PROJECT_NAME}_MINOR_VERSION 0 )
SET( ${PROJECT_NAME}_PATCH_LEVEL 0 )

SET( PACKAGE_VERSION
${viewer4d_MAJOR_VERSION}.${viewer4d_MINOR_VERSION}.${viewer4d_PATCH_LEVEL}
)
SET( CPACK_PACKAGE_VERSION_MAJOR ${viewer4d_MAJOR_VERSION} )
SET( CPACK_PACKAGE_VERSION_MINOR ${viewer4d_MINOR_VERSION} )
SET( CPACK_PACKAGE_VERSION_PATCH ${viewer4d_PATCH_LEVEL} )
SET( CPACK_PACKAGE_VERSION
${viewer4d_MAJOR_VERSION}.${viewer4d_MINOR_VERSION}.${viewer4d_PATCH_LEVEL}
)
SET( CPACK_PACKAGE_DESCRIPTION_SUMMARY "A 4D viewer")
SET( CPACK_PACKAGE_VENDOR "INRIA - Florent LAGAYE")
SET( CPACK_SOURCE_PACKAGE_FILE_NAME "viewer4d-${VERSION}" CACHE INTERNAL
"tarball basename" )
SET(CPACK_SOURCE_IGNORE_FILES
"~$"
"^${PROJECT_SOURCE_DIR}.*/.svn/"
)

FIND_PACKAGE( OpenGL REQUIRED )

FIND_PACKAGE( Qt4 REQUIRED )

SET( QT_USE_QTCORE 1 )
SET( QT_USE_QTGUI 1 )
SET( QT_USE_QTXML 1 )
SET( QT_USE_QTOPENGL 1 )

INCLUDE( ${QT_USE_FILE} )

SET( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules )

SET( viewer4d_SRCS
main.cpp
Application.h Application.cpp
Camera.h  Camera.cpp
DisplayCamera.h   DisplayCamera.cpp
Debug.h   Debug.cpp
Exception.h   Exception.cpp
Frame.h   Frame.cpp
Matrix.h
Mesh.hMesh.cpp
ProgressWindow.h  ProgressWindow.cpp
Quaternion.h  Quaternion.cpp
Selectable.h  Selectable.cpp
Positionable.hPositionable.cpp
Sequence.hSequence.cpp
SequenceCollection.h  SequenceCollection.cpp
Setup.h   Setup.cpp
StreamDumper.hStreamDumper.cpp
Streamer.hStreamer.cpp
StreamFile.h  StreamFile.cpp
StreamFile_0_2.h  StreamFile_0_2.cpp
Timer.h   Timer.cpp
ToolBox.h ToolBox.cpp
TriState.hTriState.cpp
Vector.h  Vector.cpp
Viewer3d.hViewer3d.cpp
ViewerWindow.hViewerWindow.cpp
Light.h   Light.cpp
)

SET( viewer4d_UIS
Viewer4dMainWindow.ui
ProgressWindow.ui
CameraDock.ui AnimationDock.ui DisplayDock.ui
MeshDock.ui SequenceDock.ui TextureDock.ui
LightDock.ui
)

SET( viewer4d_RCS viewer4d.qrc )

SET( viewer4d_MOCS Application.h ViewerWindow.h ProgressWindow.h Light.h
Selectable.h Positionable.h Viewer3d.h )

QT4_ADD_RESOURCES( viewer4d_SRCS ${viewer4d_RCS} )

QT4_WRAP_CPP( viewer4d_SRCS ${viewer4d_MOCS} )

QT4_WRAP_UI( viewer4d_SRCS ${viewer4d_UIS} )

INCLUDE_DIRECTORIES(
  ${PROJECT_SOURCE_DIR}
  ${PROJECT_BINARY_DIR}
  ${QT_INCLUDE_DIR}
  ${QT_QTXML_INCLUDE_DIR}
  ${QT_QTGUI_INCLUDE_DIR}
  ${QT_QTCORE_INCLUDE_DIR}
  ${QT_QTOPENGL_INCLUDE_DIR}
  ${OPENGL_INCLUDE_DIR}
)

SET( CMAKE_CXX_FLAGS "-Wall" )
SET( CMAKE_CXX_FLAGS_RELEASE "-O3 -DV4D_DEBUG_LVL=2" )
SET( CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DV4D_DEBUG_LVL=3 -DV4D_PROFILING" )
SET( CMAKE_CXX_FLAGS_PROFILE "-pg -O3" )

ADD_EXECUTABLE( viewer4d ${viewer4d_SRCS} )

TARGET_LINK_LIBRARIES( viewer4d
  ${QT_QTXML_LIBRARY_DEBUG}
  ${QT_QTGUI_LIBRARY_DEBUG}
  ${QT_QTCORE_LIBRARY_DEBUG}
  ${QT_QTOPENGL_LIBRARY_DEBUG}
  ${OPENGL_LIBRARY}
)

INSTALL( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../example DESTINATION
share/viewer4d )
INSTALL( FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/v4d.svg DESTINATION
share/viewer4d )
INSTALL(TARGETS viewer4d
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
[/code]


*And here is what "make viewer4d_rpm" tells me :*

[code]
Scanning dependencies of target viewer4d_rpm
CPack: Create package using TGZ
CPack: Install projects
CPack: - Install directory: /local_scratch/lagaye/viewer4d/src
CPack: Compress package
CPack: Finalize package
CPack: Package
/local_scratch/lagaye/viewer4d/bin.release/viewer4d-1.0.0.tar.gz generated.
Exécution_de(%prep): /bin/sh -e /var/tmp/rpm-tmp.j49nPg
+ umask 022
+ cd /local_scratch/lagaye/viewer4d/bin.release/RPM/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /local_scratch/lagaye/viewer4d/bin.release/RPM/BUILD
+ rm -rf viewer4d-1.0.0-Source
+ /usr/bin/gzip -dc
/local_scratch/lagaye/viewer4d/bin.release/RPM/SOURCES/viewer4d-1.0.0.tar.gz
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd viewer4d-1.0.0-Source
/var/tmp/rpm-tmp.j49nPg: line 34: cd: viewer4d-1.0.0-Source: No such
file or directory
erreur: Mauvais status de sortie pour /var/tmp/rpm-tmp.j49nPg (%prep)


Erreur de construction de RPM:
  Mauvais status de sortie pour /var/tmp/rpm-tmp.j49nPg (%prep)
make[3]: *** [CMakeFiles/viewer4d_rpm] Erreur 1
make[2]: *** [CMakeFiles/viewer4d_rpm.dir/all] Erreur 2
make[1]: *** [CMakeFiles/viewer4d_rpm.dir/rule] Erreur 2
make: *** [viewer4d_rpm] Erreur