Re: [CMake] 1 tricky question, 1 bug report

2009-03-13 Thread Eric Noulard
2009/3/13 Denis Scherbakov denis_scherba...@yahoo.com:


 As I already wrote, my problem is that IF ( NOT MICO_FOUND ) code is 
 executed too early - during compilation by cmake, not when user types gmake 
 puts and it becomes clear that MICO is needed.

That's the expected behavior, because CMake tries to find libXml2/Mico

** at CMake time ** , i.e. when CMake runs not when building (i.e.
when gmake runs in your case).

If you want to authorize a user to compile a sub-project without having
the required libs installed used by other sub-project you should make
** the configuration ** of those sub-project optional and not
** their compilation **

You may use CMake OPTION for that purpose:

OPTION(BUILD_PRINTF  Build the PRINTF Sub-project ON)
OPTION(BUILD_PUTS  Build the PUTS Sub-project ON)

IF (BUILD_PRINTF)
   ADD_SUBDIRECTORY(printf)
ENDIF(BUILD_PRINTF)

IF (BUILD_PUTS)
  ADD_SUBDIRECTORY(puts)
ENDIF (BUILD_PUTS)

When calling CMake your user/developper may decide not to compile
some sub-project:

cmake -DBUILD_PRINTF:BOOL=OFF

in this case the default is to build both.


-- 
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] 1 tricky question, 1 bug report

2009-03-13 Thread Eric Noulard
2009/3/13 Eric Noulard eric.noul...@gmail.com:

My statement was ambiguous:


 cmake -DBUILD_PRINTF:BOOL=OFF

The previous line is meant to avoid building the PRINTF project

while...


 in this case the default is to build both.

The default value of options
BUILD_PRINTF
BUILD_PUTS
is to build both such that if not CMake option is specified
both project will be built.



-- 
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] 1 tricky question, 1 bug report

2009-03-13 Thread Eric Noulard
2009/3/13 Denis Scherbakov denis_scherba...@yahoo.com:

 Eric,

 Your solution requires a developer to know too much about the project, which 
 is not always true and basically to answer a full-scale questionnaire before 
 compilation. What if it is a new developer?

If it is not a developer there is a simpler solution, try to find all
what you can
in the main CMakeLists.txt and throw a STATUS message instead of FATAL
as told by Bill.

As regarding the OPTION solution, you may build your CMakeLists.txt to
automatically (and silently) put to ON all buildable parts (after trying
to find all dependencies).

Note that the drawback of the totally automatic thing is that you may search
for unwanted user things. Which may be a waste of time for him.

  What if it is not a developer, but a user who expects everything to compile 
 automatically?

Then each Not Found message shuold tell him how to install dependencies.


 My question is simple:

 What is the way to get some code executed not during cmake-compilation, but 
 when a user types gmake something and it becomes clear which dependencies 
 are needed.

You ask to run CMake from make somehow. This should be doable with
add_custom_command / add_custom_target,
and a 2 steps make,  but I don't think  CMake  was meant for kind of
re-entrant usage, i.e. the build system (make, Visual Studio etc...)
calling the build generator (cmake). As far as I know this is currently done
only for checking if a CMakeLists.txt changed and it bothers some build system
like Visual Studio when they discover that the file they are using have been
changed during their own build.


Note however,
that here you expect your user to actually know that he wants
something to be build,
thus it is not very different (beside the syntactic sugar)
from requiring him to do:

cmake -DSOMETHING:BOOL=ON

when running cmake, it doesn't require much more knowledge but the name
the sub-projects he wants to build.


-- 
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] 1 tricky question, 1 bug report

2009-03-13 Thread Eric Noulard
2009/3/13 Maik Beckmann beckmann.m...@googlemail.com:
 Brad King schrieb am Freitag 13 März 2009 um 16:51:
 Actually, I cannot tell from a quick glance at the code how it ignores
 'USE' keywords that appear after a ';' separator.  It does not ignore
 'MODULE' after ';'.  Maik?

 If a piece of code is identifed by the _lexer_ as being a comment, it is just
 ignored.  ';' isn't considered at all.

 My impression is, that the code which identifies comment lines for fixed
 format is buggy.

[...]

I have a guess, but it is weird,

 {{{
 !.*\n                   { return EOSTMT; } /* Treat comments like */
 fixed_fmt^[cC*dD].*\n { return EOSTMT; } /* empty lines */
 }}}

I couldn't find any BEGIN(fixed_fmt) for the fixed_fmt start condition
(whereas there is for str_sq or str_dq)

in
http://public.kitware.com/cgi-bin/viewcvs.cgi/Source/cmDependsFortranLexer.in.l?root=CMakeview=markup

which makes me think that ALL fixed_fmt rules in the lexer are
currently ignored
because the start condition never gets activated.
i.e. there should be some code that's tell the lexer that it is lexing
a fixed format file.

Note that this is the same for free_fmt but this start condition is not used
in any rules of the lexer, it is only declared at the same line as the
fixed_fmt ??

I'm no flex/lex expert thus take my guess with care.

-- 
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] automatically re-generating makefiles

2009-03-17 Thread Eric Noulard
2009/3/16 Matthew Woehlke mw_tr...@users.sourceforge.net:
 Eric Noulard wrote:

 2009/2/26 Alex Flint alex.fl...@gmail.com:

 Hi there,

 I've noticed that when I run make blah then the makefile is
 automatically re-generated if I've changed anything in CMakeLists.txt
 since the last time I built blah. However, if I add a new target to
 CMakeLists.txt then I have to run cmake manually or else I just get
 to rule to make foo.

 I think this already works if you call
 make
 and not
 make foo

 Because existing target do depends on cmake_check_build_system
 which should check for CMakeLists.txt changes (not verified just a guess).

 Actually, it's supposed to be possible to make the makefile itself dependent
 on something.

You may be right but currently I do not see anything like a DIRECT
dependency between Makefile and CMakeLists.txt in the CMake
generated Makefile.

The dependency exists  (cmake_check_build_system)
but it is somehow lazy, that is it is checked if
you try to build any **already existing** target and not when trying
to build a new target freshly added to a CMakeLists.txt.

 I think if this isn't working, either a: cmake isn't writing
 optimal dependencies for the makefiles themselves,

Optimal depends in which sense. With the current scheme
I would say that dependency is checked almost always when needed,
with your propose scheme it would have to be checked
always even if not needed, I would bet that unconditionnally checking
dependency for non-existing target may be sub-optimal because
it may cost you many unneeded check for rare case of needed checks.

I may be wrong, may be some CMake developer, expert in Unix Makefiles
generator dependency may shed the light on this?

 or b: 'make' could be doing better.

I would say that make is an almost stupid tool, it does not check
for unspecified dependency :-)

Current CMake generated Makefiles lacks some rule like:

Makefile : cmake_check_build_system

My point of view is, I don't think it would be worth the cost to add it.


-- 
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] Precompiled Headers for Intel on windows

2009-03-17 Thread Eric Noulard
2009/3/17  jessepe...@gmail.com:
 I looked around for precompiled header support and couldn't figure out
 how/if it works for intel compilers.
 The links such as: http://www.mail-archive.com/cmake@cmake.org/msg05456.html
 appear to be pretty MSVC centric and I don't think the stdafx.cpp approach
 will work on intel.
 If there isn't direct support, is there a workaround?

Did you look at the referenced bug discussion?
http://public.kitware.com/Bug/view.php?id=1260


-- 
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] CPack: how to change /usr install location ?

2009-03-18 Thread Eric Noulard
2009/3/18 Stephen Collyer scoll...@netspinner.co.uk:
 I've been trying to use CPack to generate an RPM package with cmake 2.6.2.

 I have the following trivial CMakeLists.txt:

 

 PROJECT(PRINT)
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

 ADD_LIBRARY(print print.cpp)

 SET(PRINTER_SRCS main.cpp)
 ADD_EXECUTABLE(printer ${PRINTER_SRCS})
 TARGET_LINK_LIBRARIES(printer print)

 INSTALL(TARGETS printer print
     ARCHIVE DESTINATION print
     LIBRARY DESTINATION print
     RUNTIME DESTINATION print)

 SET(CPACK_PACKAGE_NAME print)
 SET(CPACK_PACKAGE_INSTALL_DIRECTORY print-package)
 SET(CPACK_GENERATOR RPM)
 INCLUDE(CPack)

 ###

 Regardless of what I put in CPACK_PACKAGE_INSTALL_DIRECTORY, the generated
 rpm installs into /usr/print.

 Can someone tell me what I would have to do to install into, say, /opt ?

Yes,

set CMAKE_INSTALL_PREFIX to /opt (using cmake command line, ccmake
,cmake-gui etc...)

when packaging RPM with CPack you should

SET(CPACK_SET_DESTDIR ON)

in your CMakeLists.txt.

More information on CPack RPM may be found there:
http://www.vtk.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29



-- 
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] How to emulate autotools make check?

2009-03-19 Thread Eric Noulard
2009/3/19 Marcel Loose lo...@astron.nl:
 Hi all,

 I've been searching for a way to implement make check the GNU
 Autotools way. That is: tests are not compiled and linked as part of the
 all target, but as part of the check target.

 I followed section 10.5 Using CTest to Drive Complex Tests of the book
 Mastering CMake and I looked at the Tests directory of the CMake
 distribution. From that I created my little toy project Hello.

 Now the problem is: it doesn't work. For details, see below.


[...]

 $ cat test/CMakeLists.txt
 include_directories(${CMAKE_SOURCE_DIR}/src)
 add_test(t_hello ${CMAKE_CTEST_COMMAND}
  --build-and-test
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_BINARY_SOURCE_DIR}
  --build-generator ${CMAKE_GENERATOR}
  --build-makeprogram ${CMAKE_MAKE_PROGRAM}
  --build-project t_hello
  --test-command t_hello)

Then your test is command is to ... run ctest on the same project?
This looks like a endless recursion that will call ctest for ever?


 $ ctest -V

Step 1: you call ctest...

 UpdateCTestConfiguration
 from :/export/home/loose/work/hello/build/DartConfiguration.tcl
 Parse Config
 file:/export/home/loose/work/hello/build/DartConfiguration.tcl
 Start processing tests
 UpdateCTestConfiguration
 from :/export/home/loose/work/hello/build/DartConfiguration.tcl
 Parse Config
 file:/export/home/loose/work/hello/build/DartConfiguration.tcl
 Test project /export/home/loose/work/hello/build
 Constructing a list of tests
 Done constructing a list of tests
 Changing directory into /export/home/loose/work/hello/build/test
  1/  1 Testing t_hello

then you test is to  call ctest ...

 Test command: /usr/bin/ctest
 --build-and-test /export/home/loose/work/hello/test  --build-generator
 Unix\ Makefiles --build-makeprogram /usr/bin/gmake --build-project
 t_hello --test-command t_hello

Here you call t_hello which would (if ever it suceed)
call ctest

 Test timeout computed to be: 1500
 Could not find executable t_hello

Hopefully there is no t_hello executable its a ctest test name.



-- 
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] How to emulate autotools make check?

2009-03-19 Thread Eric Noulard
2009/3/19 Marcel Loose lo...@astron.nl:
 Hi Eric,

 I used make test first, but that failed the same way ctest fails.
 However, ctest -V at least gave me some more (useful) output.

You are right there is no functional difference,
in one case you'll have
make test -- ctest -- ctest
and in the other
ctest -- ctest


 There's a C++ source file t_hello.cc in the test directory that should
 be compiled to produce an executable t_hello.

Then this executable should be built with add_executable somehow
add_test macro does not compile anything, that's may be were you
have missed something.

add_test(testname Exename arg1 arg2 ...)

Exename should exists: either as an add_executable target or because
it's a sripts etc
CTest won't BUILD Exename even if there is Exename.cpp in the
appropriate directory.

 So yes, maybe I'm using
 the wrong arguments. It's not really clear to me what I should specify
 for --build-project and --test-command. As I said: I must be doing
 something wrong, but I don't know what exactly.

I think (but I may be wrong too) that you supposed may build needed executable
from source of the same name. This is not the case, CTest is **only**
executing some prebuilt executable with given agrument.


 BTW, you broke up the output of ctest -V, which might suggest that you
 think I entered several commands, but that's not the case.

I did know that, I did cut in order to minimize the mail size.
I was trying to show you that your single call to ctest is generating
a recursive call.


-- 
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] Fwd: controlling which instantiations to make for given templates

2009-03-19 Thread Eric Noulard
Re-transfer,
I did dropped the list


-- Forwarded message --
From: Eric Noulard eric.noul...@gmail.com
Date: 2009/3/19
Subject: Re: [CMake] controlling which instantiations to make for
given templates
To: Hicham Mouline hic...@mouline.org


2009/3/19 Hicham Mouline hic...@mouline.org:
 Hello,
 we have a number of projects, in some of them, we have translation units that 
 define member functions of template classes,
 and at the bottom we have explicit template instantiations of those templates:
 template class TemplArgList1;
 template class TemplArgList2;

 it turns out under VS2005/2008 we only need the instantiation with 
 TemplArgList1
 while under gcc3 we need TemplArgList2

 I saw some aux sources command in cmake that considers a Template subdir, 
 but we don't wish to use this method.
 Is there any other feature of cmake to help with this?
 Otherwise, we will use processor defines to test which env and then choose 
 the appropriate instantiation.

I think that in this case compiler specific pre-defined MACRO is the way to go
see: http://predef.sourceforge.net/precomp.html

for gcc
http://predef.sourceforge.net/precomp.html#sec14
and MSVC
http://predef.sourceforge.net/precomp.html#sec34

CMake provides you with
CMAKE_COMPILER_IS_GNUCC
and
MSVC*
see
http://www.cmake.org/Wiki/CMake_Useful_Variables#System_.26_Compiler_Information

But then you'll have to CONFIGURE_FILE and/or ADD_DEFINITION in order
select what you want.


--
Erk



-- 
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] How to emulate autotools make check?

2009-03-20 Thread Eric Noulard
2009/3/20 Marcel Loose lo...@astron.nl:
 Hi Erk,

 On Thu, 2009-03-19 at 15:37 +0100, Eric Noulard wrote:
 2009/3/19 Marcel Loose lo...@astron.nl:
  Hi Eric,
 
  I used make test first, but that failed the same way ctest fails.
  However, ctest -V at least gave me some more (useful) output.

 You are right there is no functional difference,
 in one case you'll have
 make test -- ctest -- ctest
 and in the other
 ctest -- ctest

 I still don't understand why ctest is being called twice, or (as you
 say) recursively.

Because you ask for it :-)
when calling ctest in add_test.


 Then this executable should be built with add_executable somehow
 add_test macro does not compile anything, that's may be were you
 have missed something.

 add_test(testname Exename arg1 arg2 ...)

 Hmm, if I add the test with add_executable() it will become part of
 target all; so it will always be built when typing 'make'. But I want it
 to become part of a target 'check', so that it's only being compiled,
 linked and run when you type 'make check'.

 I've played a bit with EXCLUDE_FROM_ALL. That way I could get the
 sources to compile and link

I think you find the appropriate way, add_executable with EXCLUDE_FROM_ALL.

  but not run against target 'check'. Should I
 also use add_custom_command()? If so, then this command should have the
 same effect as typing 'make test' at the command line. Right? How do I
 accomplish that?

Did you something like:

add_executable(t_hello t_ EXCLUDE_FROM_ALL hello.cpp)

add_test(t_hello t_hello)

add_custom_target(check
 COMMAND ${CMAKE_BUILD_TOOL} test
 DEPENDS t_hello)

then:

the toplevel check target exists but won't be run by make
you have the rule to build your exe (but it is excluded from all)
the check target depends on your exe so that calling make check
should trigger the build of your exe.

in the end the check target should run make test which seems to be what
you want?


 I think (but I may be wrong too) that you supposed may build needed 
 executable
 from source of the same name. This is not the case, CTest is **only**
 executing some prebuilt executable with given agrument.

 If that is the case, and I'm willing to believe you, why does ctest run
 cmake (as can be seen from the output of 'ctest -V')?

Because you asked ctest to --build-and-test  the build part
needs/triggers cmake run :-).

I'll be off the list for a week or so, please do not drop the list address
or you won't have any answers.

-- 
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] How best to capture the current Date/Time

2009-03-20 Thread Eric Noulard
2009/3/20 Philip Lowman phi...@yhbt.com:
 On Thu, Mar 19, 2009 at 11:18 PM, Michael Jackson
 mike.jack...@bluequartz.net wrote:

 I am trying to find a nice portable solution for generating version
 strings based on the date (seems reasonable). I even have my own c++ code
 that can generate the proper string for me. The problem that I can not seem
 to get my head around is that I need to compile and run the program at cmake
 time which probably isn't really going to happen, at least easily.
  So. what is everyone else doing for this?

 My main goal is to automate the generation of cmake code like the
 following:

 set ( ${${Project_Name}_VERSION} 2009.03.10)

 so that I can later use it for OS X bundle building.

 On Unix systems I can easily spawn a date command to get what I need but
 what to do on windows?

I use 'date' on unix and nothing but a nodate string on windows :-(


 Ugly, but apparently possible with batch file scripting!
 http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmdd-format/

 Another option is you could write a small program which uses localtime() and
 other posix functions to get you the format that you want and then use the
 output from the program via a CHECK_C_SOURCE_COMPILES configure test.

may be the same idea, use TRY_RUN with your home made portable source
to get your string at CMake time.

another solution would be to try to find some script language installed
(perl, python, ...) then EXECUTE_PROCESS with appropriate pieces of code
for getting the date you want.

I think it would be worth a feature request for cmake -E date format
the how to get date is popping again and again.

-- 
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] How to emulate autotools make check?

2009-03-20 Thread Eric Noulard
2009/3/20 Marcel Loose lo...@astron.nl:

 Because you ask for it :-)
 when calling ctest in add_test.

 Ok, I see.
 But how then, should I read the example from section 10.5 from the
 Mastering CMake book? Here's a quote from page 167.

 qoute
 For example, consider the following ADD_TEST command taken from the
 CMakeLists.txt file of CMake itself. It shows how CTest can be used both
 to compile and run a test.

  add_test (simple ${CMAKE_TEST_COMMAND}
    --build-and-test ${CMake_SOURCE_DIR}/Tests/Simple
                     ${CMake_BINARY_DIR}/Tests/Simple
    --build-generator ${CMAKE_GENERATOR}
    --build-makeprogram ${CMAKE_MAKE_PROGRAM}
    --build-project Simple
    --test-command simple)

 /quote

 This quote contradicts the statement you made in an earlier reply that
 [... CTest is **only** executing some prebuilt executable with given
 agrument ...]

I did oversimplify and mixed things.

ADD_TEST macro does only specify what command is to be run for the named test
then the ctest command (directly called or through make test) runs the
specified executables.

the ctest command itself may do far more operations (CVS/SVN checkout/update,
configure/build with CMake, run the tests exe, publish to  dashboard etc)

thus the example in the CMake book.
I don't have a copy of this book so I may not check but I would guess
that the enclosing project where you find the add_test with ctest call example
is not the same project as the one that will be generated whithin add_test,
so you do not have the recursion project but just a project A test which role
is to build and run a project B test.

Just a guess, because without the book :-)

-- 
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] How to emulate autotools make check?

2009-03-20 Thread Eric Noulard
2009/3/20 Marcel Loose lo...@astron.nl:
 Hi Erk,

 On Fri, 2009-03-20 at 10:06 +0100, Eric Noulard wrote:
 add_executable(t_hello t_ EXCLUDE_FROM_ALL hello.cpp)

 add_test(t_hello t_hello)

 add_custom_target(check
                              COMMAND ${CMAKE_BUILD_TOOL} test
                              DEPENDS t_hello)

 I stumbled upon a tiny problem with your solution:
 make now complains with the following warning:
 gmake[4]: warning: jobserver unavailable: using -j1.  Add `+' to parent
 make rule.

 I checked the generated file ./test/CMakeFiles/check.dir/build.make and
 found the line that causes this warning:

  cd /export/home/loose/work/hello/build/test  /usr/bin/gmake test

 It is caused by the fact that make is called as /usr/bin/gmake, instead
 of $(MAKE) which is recommended by the GNU Make manual. (See
 http://www.gnu.org/software/automake/manual/make/Error-Messages.html and
 http://www.gnu.org/software/automake/manual/make/MAKE-Variable.html#MAKE-Variable)

 I guess that /usr/bin/gmake has been put there as result of the
 expansion of CMAKE_BUILD_TOOL. Would there be a workaround?

I did never cross that one, are you using parallel build? (make -jN check)

You may try to run ctest command instead make test


-- 
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] RUN_TESTS project dependencies

2009-03-20 Thread Eric Noulard
2009/3/20 Philip Lowman phi...@yhbt.com:
 On Thu, Mar 19, 2009 at 12:35 AM, Robert Dailey rcdai...@gmail.com wrote:

 Hi,

 I'm currently using Visual Studio 2008 and CMake v2.6.3. I noticed that
 when I create unit tests, they are not added as dependencies in the solution
 containing all of the unit test projects + the RUN_TESTS project. For
 example, when I change one of the source files in a particular unit test
 project, running RUN_TESTS will still run the old tests and not force them
 to rebuild. If RUN_TESTS had a dependency on all unit tests in the solution
 this problem would be solved. Is there a way to set this up? If not, why is
 this behavior not supported?

 This would be a nice thing to have.  I had someone complain at work the
 other day that they had to run make before make test as well.  Seems
 like CMake should add the dependency to the test target as add_test() is
 being called.

You may have a look at another thread on the ML
that is pursuing a similar issue;

http://www.cmake.org/pipermail/cmake/2009-March/027929.html


 Have you filed a feature request yet for this?  Is there already one?



-- 
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] How to emulate autotools make check?

2009-03-20 Thread Eric Noulard
2009/3/20 Marcel Loose lo...@astron.nl:
 Perfect!

Ok fine.


 I now use add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) and
 that indeed solves the parallel build issue.
 And yes, I have MAKEFLAGS set to -j4.


Now that you make check is working, may be it's time to describe
the way to go on a wiki page, may be in a new Specific Topic
http://www.cmake.org/Wiki/CMake#Specific_Topics


-- 
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] RUN_TESTS project dependencies

2009-03-20 Thread Eric Noulard
2009/3/20 Robert Dailey rcdai...@gmail.com:
 On Fri, Mar 20, 2009 at 7:02 AM, Philip Lowman phi...@yhbt.com wrote:

 On Thu, Mar 19, 2009 at 12:35 AM, Robert Dailey rcdai...@gmail.com
 wrote:


 This would be a nice thing to have.  I had someone complain at work the
 other day that they had to run make before make test as well.  Seems
 like CMake should add the dependency to the test target as add_test() is
 being called.

 Have you filed a feature request yet for this?  Is there already one?

 I'd love to file a feature request for this. Where would I do this?

You should file a bug report with ype feature request:
http://public.kitware.com/Bug/my_view_page.php


-- 
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] CPack rpm (from cmake 2.6.3) and rpm 4.6.0

2009-03-23 Thread Eric Noulard
2009/3/23 Dmitry Gerasimov dmitry-gerasi...@yandex.ru:
 Hi.

 CPack rpm seem to work not correctly on systems with rpm version =4.6.0
 (like Fedora 10).
 Due to rpm changes in 4.6.0 release (http://www.rpm.org/wiki/Releases/4.6.0)
 
 %{_topdir} defaults to $(HOME)/rpmbuild/ now, instead of former
 usr/src/redhat/.

 Rpm enforces BuildRoot for all packages and ignores the directive in spec.
 

Seems like a RedHat specific RPM bugs.
Do you think it's rpm = 4.6.0 issue or Fedora 10 one?

Whatever the issue would you be able
to file a bug report in order to trace it:
http://public.kitware.com/Bug/my_view_page.php

 Due to this rpmbuild ignores

 %define _rpmdir ${CPACK_RPM_DIRECTORY}
 %define _topdir ${CPACK_RPM_DIRECTORY}

 set in spec file and looking for files in $(HOME)/rpmbuild/

May be the new rpm command accepts command line switch for that?

We may use the enforced topdir if we may get its location from a CMake script
but this will need extra file copy, which CPackRPM tries to avoid.
The CPack RPM generator is essentially a cmake script,
(see Modules/CPackRPM.cmake), thus
if you find a workaround or a fix for this issue by patching this script
please send it to the list and/or attach it to the reported bug.

Thank you for reporting the issue.
-- 
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] Question about error creating CPack RPM installer

2009-03-25 Thread Eric Noulard
2009/3/24 Allen Gooch allen.go...@gmail.com:
 I'm trying to create an RPM installer for my project using CPack. My
 environment is cmake-2.7 prerelease built from CVS on 2009-03-05 on a Fedora
 Core 10 32-bit x86 host.  At the bottom of my top-level CMakeLists.txt file
 I have the following:

It has been reported a bug/issue using CPack RPM generator
 for rpm 4.6.0 on Fedora 10 recently on this list.

[...]


 It seems that the absolute path to my install dir is being appended to the
 _CPack_Packages/Linux/RPM/Server-1.0.1-Linux path components, and the
 expected directory for the copy source does not exist.  Anyone have any
 ideas on why this absolute/relative path name wackiness is happening and how
 to correctly generate the RPM?

Not sure but for the CPack RPM to work you may need to

SET(CPACK_SET_DESTDIR ON)

Moreover you may be able to have more informations on what happen
with CPeck RPM if you call


cd to_builddir
cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM

more info there:
http://www.vtk.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29



-- 
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] How to emulate autotools make check?

2009-03-25 Thread Eric Noulard
2009/3/25 Marcel Loose lo...@astron.nl:
 On Fri, 2009-03-20 at 16:34 +0100, Eric Noulard wrote:
 2009/3/20 Marcel Loose lo...@astron.nl:
  Perfect!

 Ok fine.

 
  I now use add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) and
  that indeed solves the parallel build issue.
  And yes, I have MAKEFLAGS set to -j4.


 Now that you make check is working, may be it's time to describe
 the way to go on a wiki page, may be in a new Specific Topic
 http://www.cmake.org/Wiki/CMake#Specific_Topics

 Hi Erk,

 How do I add a topic on the wiki page? Do I need to register somewhere
 and get a login name?

yes you need that, may be other can help for this
I'm on leave with limited internet access.

-- 
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] CPack ZIP generator: unwanted directory in zip

2009-03-25 Thread Eric Noulard
2009/3/25 Stephen Collyer scoll...@netspinner.co.uk:
 I'm building a Win32 zip package from an out-of-source build in a directory
 c:\mdpqt_HEAD\build.

 When the zip file is created, it has the structure:

 MDP-1.0.0-win32\mdpqt_HEAD\bin  (and others)

 Can someone tell me:

 a) where the -win32 is coming from, and can I remove it ?

Yes you do.
You should be able to set what you want with
SET(CPACK_PACKAGE_FILE_NAME  Whatever)


 b) why the generator is inserting the mdpqt_HEAD directory ?

Could you give us an example of the INSTALL command you use?
What is the value of your CMAKE_INSTALL_PREFIX var?


You should may be read those pages:
http://www.cmake.org/Wiki/CMake:Packaging_With_CPack#Using_CMake_variables_to_configure_CPack
http://www.cmake.org/Wiki/CMake:CPackConfiguration


-- 
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] CPack ZIP generator: unwanted directory in zip

2009-03-26 Thread Eric Noulard
2009/3/26 Stephen Collyer scoll...@netspinner.co.uk:
 2009/3/26 Eric Noulard eric.noul...@gmail.com

Please do nogt forget the mailing list address.

  a) where the -win32 is coming from, and can I remove it ?

 Yes you do.
 You should be able to set what you want with
 SET(CPACK_PACKAGE_FILE_NAME  Whatever)

 OK that's removed the -win32. Thanks.

  b) why the generator is inserting the mdpqt_HEAD directory ?

 Could you give us an example of the INSTALL command you use?
 What is the value of your CMAKE_INSTALL_PREFIX var?

[...]

 http://www.cmake.org/Wiki/CMake:Packaging_With_CPack#Using_CMake_variables_to_configure_CPack
 http://www.cmake.org/Wiki/CMake:CPackConfiguration


 Yes, I've read them. There's too little information there for me to have
 much idea what any of these variables are supposed to do.

You are right the documentation should be enhanced, may be no one
did have time to do it [yet].
You may now enhance the part you know :-)

 This is what I'm using to configure CPack:

 SET(CPACK_SET_DESTDIR ON)    # required to support
 absolute install paths

I would say that shouldn't be used for the zip generator unless you effectively
install absolute path file. RPM generator needs it though.
You may try to only set it to ON in the UNIX case.

In order to better understand what happen I think we need an example
of INSTALL( ) command used in your CMakeLists.txt with the associated
path you find for this example in the zip file.


-- 
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 2.6.1: CPACK_NSIS_MODIFY_PATH has no effect

2009-03-30 Thread Eric Noulard
2009/3/29 Stephen Collyer scoll...@netspinner.co.uk:
 I've created an NSIS based installer by using the Cpack module in a
 CMakeLists.txt file,
 and have tried the CPACK_NSIS_MODIFY_PATH setting to add the installation
 path
 to PATH automagically.

 When I run the installer, I see the appropriate page (with the add to this
 user/all users questions)
 but the path is never added, regardless of which option I select.

Did you manually check the PATH value (echo %PATH% or menu search from
Computer Properties) ?

Do it right after install and then after a reboot.


-- 
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] From one top level project, is there's a way to produce log files on Linux ( Unix Makefiles) in the same fashion a Windows Visual Studio build does?

2009-03-30 Thread Eric Noulard
2009/3/30  david_bjorn...@agilent.com:
 From one top level project, is there’s a way to produce log files on Linux (
 Unix Makefiles) in the same fashion a Windows Visual Studio build does?

 For example, on Windows when you run ALL_BUILD, you will generated the
 following files

     ./projectA/source/target1.dir/Debug/BuildLog.htm
     ./projectB/source/target2.dir/Debug/BuildLog.htm
     ./projectB/source/target3.dir/Debug/BuildLog.htm

 In other words, on Linux with GNU make, is there’s a way to redirect output
 while building only the target for that directory to log files on a per
 target basis e.g.

 projectA/source/CMakeFiles/target1.dir/buildlog
 projectB/source/CMakeFiles/target2.dir/buildlog
 projectB/source/CMakeFiles/target2.dir/buildlog

I would say this is request feature for make and not really for CMake.
I don't know any option of make that may help to do this,
you'll have to redirect output and I don't know how to do it on a
per-target basis.


-- 
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] incrementally adding source file properties

2009-04-02 Thread Eric Noulard
2009/4/2 Bill O'Hara billtoh...@gmail.com:
 Is it possible to incrementally add new properties to source files? In two
 parts of a large build there are cases where it'd be very convenient to be
 able to do this:

 set_source_file_properties(foo.c PROPERTIES COMPILE_FLAGS -m32)

 set_source_file_properties(foo.c PROPERTIES COMPILE_FLAGS -g)

 and have the properties be -m32 -g. Right now it seems to instead just set
 it to -g and there seems not to be a way to read the properties and use
 the existing value as part of a new string?

What about
get_source_file_property(OLD_FLAGS foo.c COMPILE_FLAGS)
set_source_file_properties(foo.c PROPERTIES COMPILE_FLAGS ${OLD_FLAGS} -g) ?

Should be possible to implement a

update_source_file_properties(...)

which does the job.



-- 
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] incrementally adding source file properties

2009-04-02 Thread Eric Noulard
2009/4/2 Eric Noulard eric.noul...@gmail.com:
 2009/4/2 Bill O'Hara billtoh...@gmail.com:
 Is it possible to incrementally add new properties to source files? In two
 parts of a large build there are cases where it'd be very convenient to be
 able to do this:

 set_source_file_properties(foo.c PROPERTIES COMPILE_FLAGS -m32)

 set_source_file_properties(foo.c PROPERTIES COMPILE_FLAGS -g)

 and have the properties be -m32 -g. Right now it seems to instead just set
 it to -g and there seems not to be a way to read the properties and use
 the existing value as part of a new string?

 What about
 get_source_file_property(OLD_FLAGS foo.c COMPILE_FLAGS)

You should check that do not get NOTFOUND because the COMPILE_FLAGS
property is not [yet] defined on the specified file.

 set_source_file_properties(foo.c PROPERTIES COMPILE_FLAGS ${OLD_FLAGS} -g) ?

 Should be possible to implement a

 update_source_file_properties(...)

 which does the job.



 --
 Erk




-- 
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] Disabling RTTI in a portable way

2009-04-03 Thread Eric Noulard
2009/4/2 Robert Dailey rcdai...@gmail.com:
 Is there a portable way of disabling Runtime Type Information (RTTI) through
 CMake? I hope I don't have to strangle CMake too much to get this basic
 functionality...

Disabling rtti is a compiler dependent option:

GCC: -fno-rtti
Visual Studio/VCC: /GR-
Intel C++: -fno-rtti

etc...

I do not currently know if CMake did abtract this away?
-- 
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] Using C++ compilers for C source files?

2009-04-03 Thread Eric Noulard
2009/4/3 Robert Blake rbl...@jhu.edu:
 I'm converting a large mixed C++/C cmake application to C++.  The project
 has many .c files that I would like to compile with the C++ compiler
 instead of the C compiler.  Does anyone know the proper way to do this in
 CMake?

 Things I've tried:
 1.) Changing CMAKE_C_COMPILER myself: Usually CMake doesn't let you change
 CMAKE_C_COMPILER, but there are ways around that.  This way feels like a
 hack.  The output while compiling still says Compiling C.  In addition,
 forcing CMAKE_*_COMPILER to change makes it very difficult to run plane
 cmake on Unix machines where curses is not installed.

 2.) Tell CMake that .c files are in the CXX language:  I've tried
 PROJECT(Blah CXX)
 list(APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS c)

 When I run CMake on my project with these changes, I get errors like:

 CMake Error: Cannot determine link language for target foobar

 ...for all my targets that depend only on .c files.

Did you try to force LANGUAGE property for those files:

set_source_files_properties(file1.c file2.c
   PROPERTIES LANGUAGE C)



-- 
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] Using C++ compilers for C source files?

2009-04-03 Thread Eric Noulard
2009/4/3 Eric Noulard eric.noul...@gmail.com:
 2009/4/3 Robert Blake rbl...@jhu.edu:
 I'm converting a large mixed C++/C cmake application to C++.  The project
 has many .c files that I would like to compile with the C++ compiler
 instead of the C compiler.  Does anyone know the proper way to do this in
 CMake?

 Things I've tried:
 1.) Changing CMAKE_C_COMPILER myself: Usually CMake doesn't let you change
 CMAKE_C_COMPILER, but there are ways around that.  This way feels like a
 hack.  The output while compiling still says Compiling C.  In addition,
 forcing CMAKE_*_COMPILER to change makes it very difficult to run plane
 cmake on Unix machines where curses is not installed.

 2.) Tell CMake that .c files are in the CXX language:  I've tried
 PROJECT(Blah CXX)
 list(APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS c)

 When I run CMake on my project with these changes, I get errors like:

 CMake Error: Cannot determine link language for target foobar

 ...for all my targets that depend only on .c files.

 Did you try to force LANGUAGE property for those files:

 set_source_files_properties(file1.c file2.c
                                       PROPERTIES LANGUAGE C)

off course that was CXX and not C

set_source_files_properties(file1.c file2.c
  PROPERTIES LANGUAGE CXX)

-- 
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-gui question

2009-04-05 Thread Eric Noulard
2009/4/5 Robert Dailey rcdai...@gmail.com:
 I noticed that in the cmake-gui application (Windows),

The behavior is the same on Linux.

 the drop-down box is
 on the binary directory edit field and not the source directory field. This
 seems backwards to me. Was this decision arbitrary or by design?

I don't know the reason, but I may say that:

1) If you choose the binary dir you'll automatically get
 the corresponding source tree, because the build knows it's
 source tree (by design).

2) If you choose a source tree you may have to chose between several
 binary trees because in fact you have a 1 -- n relationship
 between a source tree (the 1) and possibly many binary trees (the n)

 If the latter, why? Would it be possible to move the history listing to the 
 source
 directory edit field?

I think it would be interesting but then cmake-gui may not be able to
automatically chose the corresponding build tree because there may
be more than one.

 The reason why I bring this up is because the binary output directory may
 not always make it very obvious as to which source directory you are
 building.

However once you selected the binary tree you precisely know (with no
possible error)
the corresponding source tree.

 It seems like the user would be more interested in knowing the
 history of source trees they have built instead of where those binaries were
 placed, which does not necessarily have to be a node within the source tree.

If I were about to implement the feature:

   - I would even say that I'll be more interested by a project name
than a pathname
 (I may check the path after the project has been selected)

   - the multiple build tree problem should be solved by some pop-up
and or message box
 telling that there exist more than one build tree corresponding
to the source tree/project.

My 2 cents.

-- 
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-gui question

2009-04-06 Thread Eric Noulard
2009/4/5 Robert Dailey rcdai...@gmail.com:
 All very good points. I really don't care how this gets changed, just as
 long as I can select by project name and not its build directory. If that
 involves first selecting the project and then selecting its build directory
 in a second drop-down box, that's fine too.

If you want that I think you should file a feature request on the tracker:
http://public.kitware.com/Bug/my_view_page.php

I'm not  CMake developer so they will decide on the follow-up for this.

-- 
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] option() behavior

2009-04-19 Thread Eric Noulard
2009/4/19 Philip Lowman phi...@yhbt.com:
 I encountered this the other day.  Is this a bug?

I don't think so.
More comment inside code:

 project(Foo)
 cmake_minimum_required(VERSION 2.6)
 set(WTFO ON)

You define the WTFO which is not cached.

 message(WTFO is ${WTFO})


 option(WTFO wtfo OFF)

Now you define an option with the same name which is a variable but CACHED.

 message(WTFO is ${WTFO})

 Here's the output...

 (first run)
 WTFO is ON
 WTFO is OFF

First run shows you the var value.

Then the option overwrite the uncached var with its default value, i.e. OFF.

 (second run)
 WTFO is ON

You set the cached variable to ON, thus the value is ON but now it
reached the cache.

 WTFO is ON

Your option retrieve it's value from the cache.


I think the bug is that you may define an option which overwrite an
uncached var.

-- 
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] option() behavior

2009-04-19 Thread Eric Noulard
2009/4/19 Philip Lowman phi...@yhbt.com:
 On Sun, Apr 19, 2009 at 1:56 PM, Eric Noulard eric.noul...@gmail.com


 I think the bug is that you may define an option which overwrite an
 uncached var.

 This is exactly what I wanted to do though.  In this case I don't care what
 options are being exposed to the cache, I just want to overwrite what
 someone is doing downstream.  I know of at least 2 fixes to the problem I
 ran into, but I'm just trying to integrate my knowledge of CMake to
 understand things better.

 I guess my question is why is it when you call SET(...CACHE) or OPTION(),
 pre-existing local variables of the same name are removed (or in the case of
 a boolean, redefined)?

Good question, you may only want to make it a CACHE var without
changing the value?
If you want to do so you may using awkward

IF (DEFINED VAR)
OPTION(VAR blah ${VAR})
ELSE (DEFINED VAR)
OPTION(VAR blah OFF)
ENDIF (DEFINED VAR)

The default behaviour is not this one.
However, both behaviour looks fine to me, it's just a matter of design choice.

 See both implementations of
 cmMakefile::AddCacheDefinition().  If you have a pre-existing local variable
 defined it's going to be defined on the next run so you're just delaying the
 inevitable by one configure.  What use case justifies the removal of the
 local variable that I'm not seeing?

I really don't know the use case. I even wonder if there is one.
Or may be you can imagine that you may hand-craft a CMakeCache.txt
without CMake and feeds a genuine CMakeLists.txt which uses non cache var
with it? kind of ugly though.

I think it is a  design choice:

- cached variables are stronger than non cached ones
- INTERNAL are stronger than cached
- cached var inherits their CACHEness from CMakeCache.txt
  or the first encountered SET(...CACHE) or OPTION()

My point of view is that CMake may eventually warns you that you are
overwriting a local
var but not more.

CMake developper certainly have their reason, they seems reasonable (to me :-).

-- 
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] SET_TARGET_PROPERTIES COMPILE_DEFINITIONS

2009-04-22 Thread Eric Noulard
2009/4/22 Micha Renner micha.ren...@t-online.de:
 Hi,

 How can I add more definitions to the target?

 In this example:
 SET_TARGET_PROPERTIES(${_targetname} PROPERTIES
        COMPILE_DEFINITIONS myDefs=\${flag}\ FC_CACHEDIR=\${FC_CACHEDIR}\
 FONTCONFIG_PATH=\${FONTCONFIG_PATH}\)

 only myDefs is added.

Strange? May be a bug?

May be you can try with

set_property(TARGET ${_targetname}
APPEND COMPILE_DEFINITIONS  
myDefs=\${flag}\;FC_CACHEDIR=\${FC_CACHEDIR}\;FONTCONFIG_PATH=\${FONTCONFIG_PATH}\
)


-- 
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] Help cmake to resolve link lines with multiple circular dependencies?

2009-04-23 Thread Eric Noulard
2009/4/23  alexandre.feb...@thomsonreuters.com:
 I have some code with multiple circular dependencies. I rely on the
 transitive dependency mechanism to create the link line. Following is a
 short example of libs which can't be resolved properly.

 è My question is: if there a way to help cmake create a working link line.

[...]

 And here is the call graph of these functions: main - lib1f1 - lib2f1 -
 lib3f1 - lib1f2 - lib3f2 - lib1f3

 Using target_link_libraries(), I set that:

 -  exe depends on lib1
 -  lib1 depends on lib2, lib3
 -  lib2 depends on lib3
 -  lib3 depends on lib2

[...]


 So, is there a way to help cmake resolve this link line without changing the
 lib1,2,3 code (because my project has too many of such circular dependencies
 to make such corrections possible. (I'm still evaluating if we can switch to
 our build system to cmake))

Don't know how to do that but I did face some similar issue which I
didn't manage
to solve using CMake.
I was able to solve it on unix somehow easily but not on Windows because
of the dll_import/export thing.

Thus I'm pretty curious,

Do you currently compile your code on Windows using shared lib?
If yes how do you compile your code with your current build system?


-- 
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 support for MKS toolkit

2009-04-30 Thread Eric Noulard
Could you confirm the MKS you are talking about is this one:
http://www.mkssoftware.com/

i.e. some kind of unix tools for Windows.

If this is the case I would bet that you MAY need to compile your
own CMake version for MKS just as there is cygwin version of CMake
for using from within cygwin.

Since MKS is commercially supported software may be you can
ask to your MKS provider if MKS supports CMake ?

Note that for cross-platform development I usually keep my finger
away from such tools (either cygwin or MKS)  and goes for
selecting native tools for each platform and use CMake to do
the specific configurations for each supported P/F.
For unix-like nafive window tools I do personnally use
http://gnuwin32.sourceforge.net/ and sometimes
http://sourceware.org/pthreads-win32/.

MKS and the like usually offers you a different way to go, such as
1) do your development on Unix then
2) automagically go on Windows using the tool (MKS or other)
 since it offers you the unix compatibility layer (tools and libs).

Thus my question is why do you need both CMake and MKS
in your case?


2009/4/30 ankit jain ankitgu...@gmail.com:
 Hi all,
 I am working on windows. I am currently using MKS to build my code without
 using cmake. but since i dont know whether cmake supports MKS or not iam not
 able to build my code through cmake using mks. If yes, please can anybody
 let me know how i can build my code through mks toolkit on windows using
 cmake. since i dont find as such binaries for mks toolkit specially.
 I need to do this because if i dont use mks and build code directly using
 cmake binaries for windows then all the unix functions are not working on
 windows. i got error of unistd.h not exists and platform not  recognised
 since i define macro for windows as NUTC for mks..
 So please guide how to proceed..
 Any help in this regard really helps me a lot...

 Regards-
 Ankit Jain
 ___
 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




-- 
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] Using CMake/CPack to make RPMs

2009-04-30 Thread Eric Noulard
2009/4/30 David Flitney flit...@fmrib.ox.ac.uk:
 Apologies if this has already been discussed. I recently discovered CPack
 and am overjoyed at the prospect of being able to add simple packaging to my
 projects. MacOS X PackageMaker worked so easily, but so far I haven't been
 able to get it to work for RPMs.
 Icmake/cpack versions are 2.4-patch 8
 downloaded UseRPMTools.cmake from the kitware website..
 My top-level CMakeLists.txt looks like this:
 PROJECT(fslview)
 SET(LIBRARY_OUTPUT_PATH ${fslview_BINARY_DIR}/lib)
 SET(EXECUTABLE_OUTPUT_PATH ${fslview_BINARY_DIR}/bin)
 INCLUDE_DIRECTORIES(${fslview_SOURCE_DIR}/fsl)
 INCLUDE_DIRECTORIES(${fslview_SOURCE_DIR}/fsl/newmat)
 INCLUDE_DIRECTORIES(${fslview_SOURCE_DIR}/src)
 ENABLE_TESTING()
 SUBDIRS(fsl src doc/fslview)
 SET(CPACK_PACKAGE_NAME fslview)
 SET(CPACK_PACKAGE_VENDOR University of Oxford FMRIB Centre)
 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY fslview - The FSL image viewer)
 SET(CPACK_PACKAGE_VERSION 3.1.0)
 SET(CPACK_RPM_PACKAGE_RELEASE 4)
 SET(CPACK_RPM_PACKAGE_LICENSE GPL)
 INCLUDE(CPack)
 INCLUDE(UseRPMTools)
 IF(RPMTools_FOUND)
   RPMTools_ADD_RPM_TARGETS(fslview)
 ENDIF(RPMTools_FOUND)

Looks good, however the
var CPACK_RPM_x are not handled by UseRPMTools.cmake
but by the builtin RPM generator of cmake/cpack 2.6.x

UseRPMTools.cmake uses:
PACKAGE_VERSION (and not CPACK_PACKAGE_VERSION)
CPACK_SOURCE_PACKAGE_FILE_NAME
CPACK_PACKAGE_NAME

and that's all, other vars are not handled :-(
In fact the UseRPMTools.cmake development has stopped
when builtin support for RPM was added to CPack.

 When configuring I get a message saying that CMake is providing a minimal
 fslview.spec file but it doesn't seem to be populating it with any of the
 data I've provided, i.e., Version:  is left blank, etc.

First of all Bill is right if you may switch to CMake 2.6.x you'll
get built-in support for RPM (and DEB) without using UseRPMTools.cmake.

that is once you have

INCLUDE(CPack) in your CMakeLists.txt

you do:
cpack -G RPM
and get the binary RPM.

More detail explained here:
http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29

That said UseRPMTools.cmake is used with both CMake 2.6.x and 2.4.x
for the TSP project (https://savannah.nongnu.org/projects/tsp).
However TSP use its own customed spec file, see example:
SPEC file:
  
http://cvs.savannah.gnu.org/viewvc/tsp/src/scripts/tsp.spec.in?root=tspview=markup

CMakeLists.txt
  http://cvs.savannah.gnu.org/viewvc/tsp/CMakeLists.txt?root=tspview=markup

I may help you to make your case work either with UseRPMTools.cmake
or builtin CPack RPM, however I'd rather push effort on improving the later.

Do you NEED to stick with CMake 2.4.x or can you afford the switch to 2.6.x?
-- 
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] Using CMake/CPack to make RPMs

2009-04-30 Thread Eric Noulard
2009/4/30 David Flitney flit...@fmrib.ox.ac.uk:
 Thanks Bill and Eric,
 I've upgraded to 2.6 and can see the progress :-)

 One further question: how do I express dependencies? I'd like to require qt
= 3.3 for instance. Can I do this in CMakeLists.txt or will I need a custom
 spec.in file?

SET(CPACK_RPM_PACKAGE_REQUIRES qt = 3.3)
see
http://www.rpm.org/max-rpm/s1-rpm-depend-manual-dependencies.html
for more informations on the requirements syntax.

Normally all CPack RPM supported vars are documented there:
http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#CPack_RPM_generators_specific_variables

normally because the
CPACK_RPM_PACKAGE_REQUIRES was missing I've just added it.

If you have any doubt, do not hesitate to open
cmake_install/share/cmake-2.6/Modules/CPackRPM.cmake

this is the CMake script used by CPack RPM for building RPM,
all used variables are in there.

 On 30 Apr 2009, at 14:13, Eric Noulard wrote:

 Do you NEED to stick with CMake 2.4.x or can you afford the switch to 2.6.x?

 My only reason to stick with 2.4 was so as not to raise the bar again for my
 collaborators. They've gone with my recommendation of CentOS 5 which has 2.4
 out-the-box. But if it works then I'm happy to fix that problem myself :-)

What I wanted to say is that you may be able to update UseRPMTools.cmake
in order to fits your needs but it's far better to go to CMake 2.6.x.

Note however that CPack builting RPM does not currently build Source RPM
(whereas UseRPMTools.cmake was able to do it).

-- 
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] Setting variables in CMakeLists.txt

2009-05-02 Thread Eric Noulard
2009/5/2 barcaroller barcarol...@sympatico.ca:

 Philip Lowman phi...@yhbt.com wrote in message
 news:f168bb790904301926p217e9bafn6f58a1a2a9b12...@mail.gmail.com...

 Which version of CMake are you using?


 I was using cmake 2.6.3.  I have installed cmake 2.6.4 but the problem is
 still there.  Looking at the makefiles in the generated build/CMakeFiles
 confirms that only absolute pathnames are being generated.

 However, when I use in-source builds (i.e. when I build inside the 'src'
 directory instead of the 'build' directory), all of this work perfectly as
 long as I use CACHE BOOL 

    SET(CMAKE_VERBOSE_MAKEFILE    ON CACHE BOOL )
    SET(CMAKE_USE_RELATIVE_PATHS  ON CACHE BOOL )

 In other words, relative and absolute paths are generated properly based on
 the CMAKE_USE_RELATIVE_PATHS variable (with CACHE BOOL )

     cd src     (instead of 'cd build')
     cmake .    (instead of 'cmake ../src')
     make       (generated relative pathnames; see below)

    /usr/bin/c++    -I. -I.. -I../.. -I/usr2/include/boost   -g -Wall -ansi
 -o CMakeFiles/myprogram.dir/myprogram.cpp.o  -c myprogram.cpp


 So, to recap:

   If I use in-source builds, with CACHE BOOL , it works
   If I use out-of-source builds, it does not work (with or without CACHE
 BOOL )

Did you check that your source tree has been properly clean from
any files after your [may be first] in-source try?

You should delete,
   CMakeCache.txt
any CMakeFiles/ directories
and any other possibly generated file.

May be you can try to build a small example project which exhibits
the issue and mail it on the list, thus other may try to reproduce the issue?

-- 
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] eclipse generator and sibling folders

2009-05-04 Thread Eric Noulard
2009/5/4 Antoine DUCHAMPS antoine.ducha...@gmail.com:
 hi Miguel,

 thanks for responding!

 I'm sorry, I had misunderstood the wiki page. I've followed the steps
 and I can navigate the source code now.

 However, the code completion does not work. My application is linked to
 an external library (ITK) and I would like to have code completion for
 the ITK classes. In kdevelop you have to import the folders containing
 the .h files. Do you know how it works in eclipse?

You have to add the folder containing the .h files in the list of
includes for the project.
Use

Properties on the Project
   -- C/C++ General
 -- Path and Symbols
  -- C++

works for me, most of the time, I say most of the time since I do have
some C++ header bloated with macros for which completion does not work at all.

-- 
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] eclipse generator and sibling folders

2009-05-04 Thread Eric Noulard
2009/5/4 Miguel A. Figueroa-Villanueva migu...@ieee.org:
 On Mon, May 4, 2009 at 4:36 AM, Eric Noulard wrote:
 2009/5/4 Antoine DUCHAMPS:
 [...]
 However, the code completion does not work. My application is linked to
 an external library (ITK) and I would like to have code completion for
 the ITK classes. In kdevelop you have to import the folders containing
 the .h files. Do you know how it works in eclipse?

 You have to add the folder containing the .h files in the list of
 includes for the project.
 Use

 Properties on the Project
   -- C/C++ General
         -- Path and Symbols
              -- C++

 works for me, most of the time, I say most of the time since I do have
 some C++ header bloated with macros for which completion does not work at 
 all.

 Eric,

 Why do you need to do this. There was a problem with standard system
 includes (which should be fixed in the latest cmake version), but
 includes that you add with the cmake include_directories command
 should be picked up by the generator. The generator produces a set of
 pathentry lines such as:

 pathentry include=path kind=inc path= system=true /

 Is this not working for you?

Sorry about that,  in fact it works for me. I'm just not using CMake
Eclipse generator for
project that use CVS because the link ressource trick does not
enable me to user Team operation
on the source.

Eclipse CDT generator is working just fine for me regarding
include_directories command
including code completion.

I did just gave a generic Eclipse CDT advice
 which does not fits the Eclipse CDT generator case
(but my hand-made Eclipse project with CMake which enables to use CVS)
again sorry about the confusion.


-- 
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] eclipse generator and code completion

2009-05-04 Thread Eric Noulard
2009/5/4 Miguel A. Figueroa-Villanueva migu...@ieee.org:
 On Mon, May 4, 2009 at 6:01 AM, Eric Noulard wrote:


 Project - Properties - C++ include paths and symbols - Add External
 Include Path ...

 I have no C++ include paths and symbols .
 Here comes a screenshot.
 Note however I'll suggest we drop CMake ML on the next e-mail since the 
 problem
 is not really related to CMake.

 Eric, maybe I'm missing something in your use case, but if you think
 that the eclipse generator should automatically handle this, then it
 is relevant here.

My answer was using the wrong test case for which I used Makefile generator
with an hadn-made Eclipse CDT project.
Sorry about that.


-- 
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 Eric Noulard
2009/5/5 Florent Lagaye florent.lag...@inrialpes.fr:
 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


Re: [CMake] CMake RPM problems

2009-05-07 Thread Eric Noulard
2009/5/7 Florent Lagaye florent.lag...@inrialpes.fr:

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 data_dir/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 data_dir/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] eclipse generator and sibling folders

2009-05-08 Thread Eric Noulard
2009/5/4 Miguel A. Figueroa-Villanueva migu...@ieee.org:

 I did just gave a generic Eclipse CDT advice
  which does not fits the Eclipse CDT generator case
 (but my hand-made Eclipse project with CMake which enables to use CVS)
 again sorry about the confusion.

 --
 Erk

 Ah, no problem. I was just thinking that there might be a bug. BTW,
 did you try the ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT option?

Yes it wokrs just fine.

 It is no the nicest solution, but it works around the problem of the
 out-of-source builds with CVS sources. It is described here:

 http://www.cmake.org/Wiki/Eclipse_CDT4_Generator

Yes that's right, that's just you have 2 project instead of one, but
I know it's currently the best you can do.

 Hope that helps,

I'll try to use it for a while and may be I will get used to the 2
projects things :-)

-- 
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] CPack RPM and rpm 4.6.x

2009-05-08 Thread Eric Noulard
Hi All CPack RPM users,

Problems have been reported when using CPack RPM generator with
rpm/rpmbuild version greater or equal than 4.6.0.
(Fedora Core 10 or greater,  Mandriva 2009 and greater, etc...)

I've submitted a simple patch borrowing solution from Dmitry Gerasimov:
http://public.kitware.com/Bug/view.php?id=8967

The patch should work just fine with previous rpm/rpmbuild version too.
I have made some non-regression testing myself, I'd be glad if other
may test the patch on their own system and add a comment to
the tracker (or on the ML if do not have tracker account)  if they have
problem with it.

If you want to test the patch just pick the CPackRPM.cmake file attached
to the tracker and either replace your current CPackRPM.cmake file
or put CPackRPM.cmake in your CMake module path.

Then
cd /your/buildir
cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM

will build the RPM with extra output from CPackRPM which will show
soimething like:
CPackRPM:Debug: rpmbuild version is 4.4.2.3
telling you the RPM version.

You may report any failure or success
(the tracker is the preferred place in order to avoid spaming the list)

-- 
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] CPack RPM : support for custom user spec file and post/pre install scripts

2009-05-08 Thread Eric Noulard
Hi CPack RPM user,

I did implement a new feature in CPack RPM generator which:

1) gives control of post/pre (un)install script of the RPM spec files
2) supports user provided spec file.

Any interested people should have a look at the tracker which contains
both a patch against CMake-2-6 branch or a drop-in replacement of
CPackRPM.cmake.

http://public.kitware.com/Bug/view.php?id=8988

( the other previous patch:
  http://public.kitware.com/Bug/view.php?id=8967
  may be applied too, they are non-overlapping)

-- 
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 Eric Noulard
2009/5/9 Alexander Neundorf a.neundorf-w...@gmx.net:
 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] CPack RPM and rpm 4.6.x

2009-05-10 Thread Eric Noulard
2009/5/9 Alexander Neundorf a.neundorf-w...@gmx.net:
 On Friday 08 May 2009, Eric Noulard wrote:
 Hi All CPack RPM users,

 Problems have been reported when using CPack RPM generator with
 rpm/rpmbuild version greater or equal than 4.6.0.
 (Fedora Core 10 or greater,  Mandriva 2009 and greater, etc...)

 I've submitted a simple patch borrowing solution from Dmitry Gerasimov:
 http://public.kitware.com/Bug/view.php?id=8967
 The patch basically adds this command line argument, right ?
 --buildroot ${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}

 If you are confident enough that this is a good solution then I can commit
 this.

I'm confident it's safe however...

 Can you try to find out whether this option is relatively new or whether it
 exists since ages ?

I'll check this and gives you follow-up soon.

-- 
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] CPack RPM and rpm 4.6.x

2009-05-10 Thread Eric Noulard
2009/5/10 Eric Noulard eric.noul...@gmail.com:
 2009/5/9 Alexander Neundorf a.neundorf-w...@gmx.net:
 On Friday 08 May 2009, Eric Noulard wrote:
 Hi All CPack RPM users,

 Problems have been reported when using CPack RPM generator with
 rpm/rpmbuild version greater or equal than 4.6.0.
 (Fedora Core 10 or greater,  Mandriva 2009 and greater, etc...)

 I've submitted a simple patch borrowing solution from Dmitry Gerasimov:
 http://public.kitware.com/Bug/view.php?id=8967
 The patch basically adds this command line argument, right ?
 --buildroot ${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}

 If you are confident enough that this is a good solution then I can commit
 this.

 I'm confident it's safe however...

 Can you try to find out whether this option is relatively new or whether it
 exists since ages ?

 I'll check this and gives you follow-up soon.

I've just checked.
The option is there since at least (rpm 2.5.6 ~ year 1998).

Should be safe to apply the patch.
More detailed comment on the tracker:
http://public.kitware.com/Bug/view.php?id=8967


-- 
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] eclipse generator and sibling folders

2009-05-10 Thread Eric Noulard
2009/5/9 Alexander Neundorf a.neundorf-w...@gmx.net:
 On Friday 08 May 2009, Eric Noulard wrote:
 2009/5/4 Miguel A. Figueroa-Villanueva migu...@ieee.org:
 ...
  It is no the nicest solution, but it works around the problem of the
  out-of-source builds with CVS sources. It is described here:
 
  http://www.cmake.org/Wiki/Eclipse_CDT4_Generator

 Yes that's right, that's just you have 2 project instead of one, but
 I know it's currently the best you can do.

  Hope that helps,

 I'll try to use it for a while and may be I will get used to the 2
 projects things :-)

 Since the issues we have with Eclipse and out-of-source builds are not caused
 by CMake, but by Eclipse CDT having trouble with out-of-source builds...

 Maybe somebody could try to get active in the Eclipse community and try to get
 the things fixed in Eclipse CDT so it can do proper out-of-source builds ?

As far as I remember the discussion on Eclipse ML, it is NOT a CDT limitation
but an Eclipse Platform one. Eclipse Platform Team abstraction which
is common to any eclipse project (including CDT ones) assumes that
there is a one-to-one mapping between a project and a repository provider

i.e. the Generated Eclipse  project file should be IN the source
controlled directory.

http://dev.eclipse.org/mhonarc/lists/platform-cvs-dev/msg00462.html

However, Yes you are right that should be the way to go.
I did thought about it but I personnally thought the time to spent for
achieving this to be relatively high.

The metrics were mine though :-)
  - Not too much knowledge of Eclipse internals
  - Seem to be an Eclipse-Team design re-work
which  seems very constrained:
 http://dev.eclipse.org/mhonarc/lists/platform-cvs-dev/msg00463.html


-- 
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] eclipse generator and sibling folders

2009-05-10 Thread Eric Noulard
2009/5/8 Eric Noulard eric.noul...@gmail.com:
 Ah, no problem. I was just thinking that there might be a bug. BTW,
 did you try the ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT option?

 Yes it wokrs just fine.

 It is no the nicest solution, but it works around the problem of the
 out-of-source builds with CVS sources. It is described here:

 http://www.cmake.org/Wiki/Eclipse_CDT4_Generator

 Yes that's right, that's just you have 2 project instead of one, but
 I know it's currently the best you can do.

Miguel,

After some thought about 2 projects things with Eclipse CDT generator
I would have a suggestion.

When using ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT
why do you generate 3 projects files.

I.e. two in the build dir (.project a



-- 
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] eclipse generator and sibling folders

2009-05-10 Thread Eric Noulard
2009/5/10 Eric Noulard eric.noul...@gmail.com:
 2009/5/8 Eric Noulard eric.noul...@gmail.com:
 Ah, no problem. I was just thinking that there might be a bug. BTW,
 did you try the ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT option?

 Yes it wokrs just fine.

 It is no the nicest solution, but it works around the problem of the
 out-of-source builds with CVS sources. It is described here:

 http://www.cmake.org/Wiki/Eclipse_CDT4_Generator

 Yes that's right, that's just you have 2 project instead of one, but
 I know it's currently the best you can do.

 Miguel,

 After some thought about 2 projects things with Eclipse CDT generator
 I would have a suggestion.

 When using ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT
 why do you generate 3 projects files.

 I.e. two in the build dir (.project a

continued...

two in the build dir: (for building debugging etc...)
.project   -- with link ressource to source
.cproject


one in the source dir: (for source control).
.project


Why don't you generate the .project and .cproject directly
in the source tree?
 I know that's bad but in the short term this is fine (at least for me).

You may generate the same file content but update:

source_dir/.project:
 with the same content as the current build_dir/.project
however the BuildLocation should refer to the build_dir

source_dir/.cproject
 is the same a before but you update the BuildTargets
 with appropriate change dir (-C) option to make:

buildArguments-C build_dir /buildArguments

I did it by hand and it seems to work fine.
It has the same drawback as the current
ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT option
i.e. putting files in the source dir, however you now have
only one project to import with intuitive source control
with Eclipse Team.

Do I miss something?

This should not change the behaviour of Eclipse CDT generator
when ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT is not set.

-- 
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] Problems with execute_process under Windows

2009-05-10 Thread Eric Noulard
2009/5/10 Tanguy Krotoff tkrot...@gmail.com:
 Hello

 I'm pulling my hair out on what should be straightforward.

        file(TO_NATIVE_PATH ${file} file_native)
        execute_process(
                COMMAND type \${file_native}\
                RESULT_VARIABLE result
                OUTPUT_VARIABLE output
                ERROR_VARIABLE error
        )
        message(result=${result})
        message(output=${output})
        message(error=${error})

 I'm running this under Windows and it gave me this output:

 result=0
 output=
 error=C:\Documents and
 Settings\tanguy_k\Desktop\phonon-vlc-mplayer\trunk\AUTHORS not found

 Of course the file exist and if i enter
        type C:\Documents and
 Settings\tanguy_k\Desktop\phonon-vlc-mplayer\trunk\AUTHORS
 inside a DOS command prompt everything works fine.

 It's like CMake does something to the filename that I don't understand

I do have weird behavior on Unix too,
with filename with embbeded space in them.

It looks like I must NOT TO_NATIVE_PATH for make it work?

My unix example is attached.
try:
cmake -P buggy_execute.cmake

 Any idea why?

Nope.
Looks like there is trouble with escaped character.

Does your file variable content comes from CMake file command
of some sort?


 Is there any way to show the real command that CMake tries to run?

Normally
 cmake --trace --debug-output

should help but its seems that those commands do not exhibit enough
cmake verbosity.

-- 
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] Problems with execute_process under Windows

2009-05-10 Thread Eric Noulard
2009/5/10 Eric Noulard eric.noul...@gmail.com:
 2009/5/10 Tanguy Krotoff tkrot...@gmail.com:
 Hello

 I'm pulling my hair out on what should be straightforward.

        file(TO_NATIVE_PATH ${file} file_native)
        execute_process(
                COMMAND type \${file_native}\
                RESULT_VARIABLE result
                OUTPUT_VARIABLE output
                ERROR_VARIABLE error
        )
        message(result=${result})
        message(output=${output})
        message(error=${error})

 I'm running this under Windows and it gave me this output:

 result=0
 output=
 error=C:\Documents and
 Settings\tanguy_k\Desktop\phonon-vlc-mplayer\trunk\AUTHORS not found

 Of course the file exist and if i enter
        type C:\Documents and
 Settings\tanguy_k\Desktop\phonon-vlc-mplayer\trunk\AUTHORS
 inside a DOS command prompt everything works fine.

 It's like CMake does something to the filename that I don't understand

 I do have weird behavior on Unix too,
 with filename with embbeded space in them.

 It looks like I must NOT TO_NATIVE_PATH for make it work?

 My unix example is attached.
 try:
 cmake -P buggy_execute.cmake

 Any idea why?

 Nope.
 Looks like there is trouble with escaped character.

On linux with CMake 2.6.4, execute_process seems to automatically escape
character... (at least space or '\')

strace-ing my previous example gives:

execve(/usr/local/bin/dir, [dir, /home/eric/with\\ space\\ in\\
it.txt )



-- 
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] Problems with execute_process under Windows

2009-05-10 Thread Eric Noulard
2009/5/10 Tanguy Krotoff tkrot...@gmail.com:
 btw you forgot to attach your unix example :p

I'm so used to the non-attached joined file :-)

-- 
Erk
file(GLOB filep /home/eric/with*)
message(--${filep}--)
# switch next 2 lines comment to make it work.
file(TO_NATIVE_PATH ${filep} file_native)
#set(file_native ${filep})
message(--${file_native}--)
execute_process(
  COMMAND dir ${file_native}
  RESULT_VARIABLE result
  OUTPUT_VARIABLE output
  ERROR_VARIABLE error
  )
message(result=${result})
message(output=${output})
message(error=${error})
___
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] CPack RPM : support for custom user spec file and post/pre install scripts

2009-05-11 Thread Eric Noulard
2009/5/11 Florent Lagaye florent.lag...@inrialpes.fr:
 Eric Noulard a écrit :

 Hi CPack RPM user,

 I did implement a new feature in CPack RPM generator which:

 1) gives control of post/pre (un)install script of the RPM spec files
 2) supports user provided spec file.

 Any interested people should have a look at the tracker which contains
 both a patch against CMake-2-6 branch or a drop-in replacement of
 CPackRPM.cmake.

 http://public.kitware.com/Bug/view.php?id=8988

 ( the other previous patch:
  http://public.kitware.com/Bug/view.php?id=8967
  may be applied too, they are non-overlapping)



 Thanks Erk,

 This patch indeed saved my day !

Nice to ear that.

What part of the patch did you use?

a) The custom spec file
or
b ) CPACK_RPM_XXX added var?



-- 
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-12 Thread Eric Noulard
2009/5/10 Alexander Neundorf a.neundorf-w...@gmx.net:
 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] CPack - Beta or Alpha version?

2009-05-13 Thread Eric Noulard
2009/5/13 Brandon Olivares programmer2...@gmail.com:
 Hi,

 I was looking at the list of CPack variables. There are variables to set the
 major, minor, and patch version numbers. But isn't there anything to set a
 beta or alpha number?

 For instance, what if I wanted a 1.0B1 version?

SET(CPACK_PACKAGE_VERSION_MAJOR 1)
SET(CPACK_PACKAGE_VERSION_MINOR 0B1)
SET(CPACK_PACKAGE_VERSION_PATCH )

Those 3 are used to build the CPACK_PACKAGE_VERSION
thus you may overwrite the CPACK_PACKAGE_VERSION alltogether with
SET(CPACK_PACKAGE_VERSION 1.0B1).

The CPACK_PACKAGE_VERSION is defined by CPack iff it is not already defined:

from CPack.cmake:
cpack_set_if_not_set(CPACK_PACKAGE_VERSION
${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})




-- 
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] External package version number

2009-05-18 Thread Eric Noulard
2009/5/18  laur...@marzu.org:
 Hello,

 I would like to retrieve the version number of an external package (=
 libxml2 or xerces-c++ or any other XML parser available).

 And, to format the version number in a standard way (at least for my
 package using either libxml2, xerces-c++ etc).

 So my first thought was to use CheckCSourceRuns to compile a test program
 and execute_process which will print on standard output the version number
 in order

 to get it in a cmake variable. But it seems that CheckCSourceRuns does not
 provide an executable to me in order to give it to execute_process.

Right I think, CheckCSourceRuns, only want to do what it does,
telling you whether the source code you gave it was able to run.

 And I would not like to build a target just for this ..

OK.

 Is there a way to do such thing with cmake or should I add another target to
 my cmake in order to compile an executable doing the extraction
 of the version number ?

I would say you'd better try with

try_run  CMake builtin macro

which should precisely do what you want:

 Try compiling a srcfile.  Return TRUE or FALSE for success or failure
   in COMPILE_RESULT_VAR.  Then if the compile succeeded, run the
   executable and return its exit code in RUN_RESULT_VAR.  If the
   executable was built, but failed to run, then RUN_RESULT_VAR will be
   set to FAILED_TO_RUN.  COMPILE_OUTPUT_VARIABLE specifies the variable
   where the output from the compile step goes.  RUN_OUTPUT_VARIABLE
   specifies the variable where the output from the running executable
   goes.

note that CheckCSourceRuns uses try_run , but the former
does not gives you full control over the run just like try_run does.

Another way to go would be to propose a patch to CheckCSourceRuns,
with some (optional) interface enrichment
which may be uses to obtain the output of the run.

Note that another to go if you are targeting Linux platform may be to use
FindPkgConfig.cmake which makes use of pkg-config in order to retrieve
information about package.

I've said if your are targeting Linux because there has been several
discussion
here on the list regarding the usage of pkg-config on other platforms.
Obviously there are pros and cons.

I'm neither because I currently do not use pkg-config,
however you may search the list for that: site: http://tinyurl.com/peyjtg

-- 
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] [cpack] name of the top level directory

2009-05-20 Thread Eric Noulard
2009/5/20 Jaroslav Gresula jgresula.leave-this-...@gmail.com:

 Hi,

 can CPack generate a package (zip, bz2) whose file name differs from the
 package top level directory name?

 For instance, when I set CPACK_PACKAGE_FILE_NAME to project-1.0.0.src,
 then the name of the package is project-1.0.0.src.tar.bz2 and the top
 level directory is project-1.0.0.src/. However, I want it to be
 project-1.0.0/.

Currently I don't know if you may rename it but at least you can suppress it:

SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)

 I couldn't find any CPack variable that would allow to specify the top
 level directory name. Any help would be appreciated.

Neither do I but you have a look to the source in order to have a
sharper idea :-)

CMake/Source/CPack/cmCPackGenerator.[h|cxx]   -- the root generator class
CMake/Source/CPack/cmCPackZIPGenerator.[h|cxx] -- the ZIP specialized class.


-- 
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] post-install script

2009-05-23 Thread Eric Noulard
2009/5/23 Michael Wild them...@gmail.com:
 Thanks David

 yes, I already did try that (it's the obvious thing to try...).
 Unfortunately the script runs before any of the files get installed.


Hi All,

I think that currently some PRE-INSTALL / POST-INSTALL rules are currently
missing from CMake.
I did evoke the problem with some proposed extension of the CPack RPM generator:

http://www.cmake.org/pipermail/cmake/2009-May/029348.html

As explained in the refered message, the problem is that you
cannot say when INSTALL(CODE/SCRIPT are run).

Most package format at least (RPM, DEB, NSIS) do support pre- and post-
install rules as script.

I may file a feature request with proposed ideas, however do you find it useful?

 On 23. May, 2009, at 13:22, David Cole wrote:

 Put your install( CODE ... ) at the very bottom of the top level
 CMakeLists.txt file. Then it should run last after all other install
 steps.
 Did you already try that and there was a problem with it?

A hack may be to create your own post_install target
with add_custom_target.
Then you'll have to

make install  make post_install

in order to make it work.

Would be even easier if we could make custom target depend
on builtin target like:

ADD_DEPENDENCIES(post_install install)

and may be (my usage)

ADD_DEPENDENCIES(install pre_install)

-- 
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] adding files with Eclipse CDT4 Generator

2009-05-25 Thread Eric Noulard
2009/5/25 Roland Waltersson rolles.d...@gmail.com:
 Hi I have a small sample project in Eclipse. cmake generates it fine
 and it builds fine, but i can't see any source code files in the
 project browser. This is my CMakeLists.txt file:

 cmake_minimum_required(VERSION 2.6)
 project(WINCABase)
 add_library(WINCABase constants.hpp exception.hpp version.hpp headersonly.cpp)

 And all the source codes are in the same directory as the
 CMakeLists.txt file. I must be missing something trivial here?

You should have linked ressource to the source folder
(unless you are building in-source).

Did you read the Wiki about the Eclipse CDT generator?
http://www.vtk.org/Wiki/Eclipse_CDT4_Generator

By the way Are you building in-source or out-of-source?
http://www.cmake.org/Wiki/CMake_FAQ#Out-of-source_build_trees

 By the
 way I use Eclipse CDT 5 (Ganymede), but it should be backwards
 comaptible right? Thanks!

I'm using CDT5/Ganymede with CMake 2.6.3 CDT generator without trouble.

-- 
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] Problem with CTest and adding subdirectory

2009-05-26 Thread Eric Noulard
2009/5/26 Robert Matusewicz mat...@gmail.com:
 Hi all!
 We are using Cmake and CTest in our project: OpenImageIO and have a liitle
 problem.
 We have project tree that looks like belowe:
 * project
  testsuit
  src
 ** test1
 ** test2
 And then, in CmakeList.txt we have something like that:
 include (CTest)
 add_subdirectory (test1)
 add_subdirectory (test2)
 add_subdirectory (testsuite)
 Because we add directory testusite - we have error add_subdirectory source
 testsuite wchich is not an existing directory.

I guess your CmakeList.txt is in project/src and not in project/ ?

 Is there any way to add testsuite? We could bypass this problem by making
 symlink, but we don't want to do that. Any idea?

I think that if you have CMakeLists.txt in project/

 include (CTest)
add_subdirectory (src/test1)
add_subdirectory (src/test2)
add_subdirectory (testsuite)

should work.

or you may split your CMakeLists.txt and have:

project/CMakeLists.txt

include (CTest)
add_subdirectory (src)
add_subdirectory (testsuite)

project/src/CMakeLists.txt
add_subdirectory(test1)
add_subdirectory(test2)


-- 
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] file(WRITE) versus configure_file

2009-06-04 Thread Eric Noulard
2009/6/4 James Bigler jamesbig...@gmail.com:
 Back in the day before file(WRITE) there was write_file().  write_file() had
 the problem that you couldn't use the file as input to CMake, so you had to
 use configure_file.

What do you mean as input, you mean a source file in
add_library or add_executable?

 Does file(WRITE) have this same restriction?

Don't know but I guess that now you can:

set_property(SOURCE blah.h PROPERTY GENERATED TRUE)
or
set_source_files_properties(blah.h PROPERTIES GENERATED TRUE)

I guess it should work even if blah.h is generated at CMake time.

 I currently use a blank template file for configure_file for one of my
 projects, and it would be nice to do away with this and just write a blank
 file when I need to.

Could you explain what do you mean by blank file?

-- 
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] file(WRITE) versus configure_file

2009-06-05 Thread Eric Noulard
2009/6/5 James Bigler jamesbig...@gmail.com:
   if(NOT EXISTS ${dependency_file})
     #message(configuring dependency_file = ${dependency_file})
     configure_file(
   ${empty_file}
   ${dependency_file} IMMEDIATE)
   endif()

The IMMEDIATE thing doesn't seem to be document, is it obsolete
or undocumented?

   # Always include this file to force CMake to run again next
   # invocation and rebuild the dependencies.
   #message(including dependency_file = ${dependency_file})
   include(${dependency_file})

 I need to include the dependency file in my CMakeLists.txt file, so that if
 the dependency file changes, CMake needs to rerun.  If the file doesn't
 exist, I need to create an empty file and include it, so that after the
 first build (when the dependency file is finally generated) cmake runs again
 to generate new build rules to incorporate the dependencies.

CMake won't rerun itself on the first run right? You'll have to
1) cmake
2) first build will eventually rerun CMake ?


 When I originally wrote this script several years ago, I had to use
 configure_file, because write_file() wouldn't work.  Since I'm updating the
 script, I would like to remove the dependency on calling configure_file with
 a blank file (empty file).

Would
file(WRITE ) ...
+
include(${dependency_file} OPTIONAL)

be working for you ? See the extra OPTIONAL to include.


I'm afraid I cannot answer to your question theoretically
CMake developer may.

From my point of view you'll have to try.


-- 
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] Running python nose tests

2009-06-05 Thread Eric Noulard
2009/6/5 Tyler Roscoe ty...@cryptio.net:
 On Thu, Jun 04, 2009 at 04:02:54PM -0400, Eric Jonas wrote:
 I've written a server that serves up an interface using a cross-language
 RPC mechanism (dbus) and currently build and unit test with cmake. But
 testing cross-language (and more functional) aspects of the server is
 easier to do from python, where I can rapidly test the RPC API. I've
 written a collection of tests that I can run using the nose unit test
 framework, but now I'm curious about how to include these in my
 CMake-based test infrastructure. Has anyone had success running what are
 basically python unit tests (or a framework like nose) from within
 cmake?

 I don't know anything about nose but CTest is highly configurable. When
 you do add_test(), you can specify any executable. For example, we wrap
 our unit tests with a python script to insure that the environment is
 configured in a known way. You can also configure CTest to understand
 what nose reports as a successful or failed unit test run if the
 defaults don't work.

Same for me we used python script runned through CTest for testing
distributed application.

The python scripts are located within a C++ CMake build source tree.
The C++ programs are built using CMake and the python scripts are
launched with CTest. (add_test).

Each python scripts are running several programs previously built
(and installed) with CMake. CTest only checks whether if those scripts
return non NULL values as OK/NOK test results.

In my particular case the executables and libs needs to be installed
because each process launched by the python scripts are controlled
through an SSH terminal/pty (using paramiko [ssh in python]).

But I guess  you could perfectly run any python scripts
which uses/runs executable previously built with CMake locally.

The project using the python scripts is there:
http://cvs.savannah.gnu.org/viewvc/applications/HLA_TestsSuite/?root=certi
the python scripts launched by CTest are those called dtest_.py.

The CMake machinery is done by the file:
http://cvs.savannah.gnu.org/viewvc/applications/HLA_TestsSuite/HLATestsSuiteTools.cmake?root=certiview=markup

look at HLATestsSuite_ADD_TEST CMake macro
which essentialy copy (CONFIGURE_FILE(... COPYLONY) the python scripts from
source tree to build tree and add the test (ADD_TEST).

[The python scripts are using dtest
 http://mirrors.linhub.com/savannah/tsp/dtest/what_is_dtest.pdf
 http://cvs.savannah.gnu.org/viewvc/dtest/?root=tsp
 but this may not be useful for you]

-- 
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] Hello World Program

2009-06-08 Thread Eric Noulard
2009/6/8 Sascha 'saigkill' Manns samann...@directbox.com:
 Hello Guys,

 atm i'm learning QT/KDE Programming. I'm created an KDE4Gui Program with
 the Templatemaker.
 Then i has gone to the directory, and typed: cmake CMakeList.txt.
 But i get:
 WARNING: Target test has EXCLUDE_FROM_ALL set and will not be built by
 default but an install rule has been provided for it.  CMake does not
 define behavior for this case.
 Whats happend?

Usually you should give us an exercpt of your CMakeLists.txt in order
to makes it possible to understand the problem.

Did you by any chance call your test program test.

If this is the case try to change its name to something
else like testK4.

test is a builtin CMake target used when doing testing with CTest.

-- 
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] Problem embedding Python in C

2009-06-09 Thread Eric Noulard
2009/6/10 Ángel Alonso fe...@archlinux.us:
 Hi,

 I'm using cmake for a project that embed Python in  C.

 For include the Python libs i use: include(FindPythonLibs)

One usually do:

find_package(PythonLibs)
instead of:
include(FindPythonLibs)


 But compiling, I get this errors:

 /usr/lib/python2.6/config/libpython2.6.a(posixmodule.o): In function
 `posix_tmpnam':
 (.text+0x8f4): warning: the use of `tmpnam_r' is dangerous, better use
[...]


include(FindPythonLibs) may not be enough:
you seem to be missing something like:

target_link_library(your_target ${PYTHON_LIBRARIES})

[...]


 I also try include(FindThreads) but the problem persist.

Same for FindThreads.

find_package(Threads)

however I dont' know that one works because the FindThreads.cmake
module does not seem to define THREADS_LIBRARIES
in order for you to
target_link_library(your_target ${THREADS_LIBRARIES})

May be the author of FindThreads may help us with the usage of this module?

 I think that is a problem of cmake, because in other tests that I made (with
 a simple Makefile, not cmake) it works.

compare the link command used by CMake and te one you use in your makefile.

make VERBOSE=1

with CMake generated makefile should show you the full link line.


-- 
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] Fwd: Installation package

2009-06-10 Thread Eric Noulard
Forgot the list...sorry


-- Forwarded message --
From: Eric Noulard eric.noul...@gmail.com
Date: 2009/6/10
Subject: Re: [CMake] Installation package
To: Pascale B chos...@hotmail.com


2009/6/10 Pascale B chos...@hotmail.com:
 Hi,

    I work on a software that I am porting onto Linux. I used CMake with
 success and now want to use CPack. I successfully created a package file
 with a bin and lib path, both containing the exec file and the .so libraries
 needed.

    Now  here is my problem: when I send this package to a user, after he
 unzips the package, he needs to move the shared libraries to the /usr/lib
 directory and proceed with the ldconfig command, otherwise when launching
 the exec file the shared libraries aren't found.

    Is there a way to automatically do this? I can't find it in the doc or in
 mailing lists either. Should a makefile be included with the package that
 would proceed with the installation or does it need to be done manually each
 time?

I understand that you use the ZIP CPack Generator which is somehow a
relatively stupid one which is a passive archive.

If you want something more like an installer which may launch appropriate
action when installing the software you should look at:

DEB, RPM or may NSIS CPack generator.

See:
http://www.cmake.org/Wiki/CMake:CPackPackageGenerators

DEB is for debian-based linux distribution (Debian, Ubuntu, and the like)
RPM is for rpm-based distros (RedHat, Fedora, Mandriva etc...)


You may chose the CPack generator on either
 in your CMakeLists.txt
SET(CPACK_GENERATOR ZIP;RPM)

or on the command line with CPack:

cd /path/to/builddir
cpack -G GENNAME
i.e.

cpack -G DEB
or
cpack -G RPM


--
Erk



-- 
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] Installation package

2009-06-10 Thread Eric Noulard
2009/6/10 Mathieu Malaterre mathieu.malate...@gmail.com:
 On Wed, Jun 10, 2009 at 10:17 AM, Pascale Bchos...@hotmail.com wrote:
 Hi,

    I work on a software that I am porting onto Linux. I used CMake with
 success and now want to use CPack. I successfully created a package file
 with a bin and lib path, both containing the exec file and the .so libraries
 needed.

    Now  here is my problem: when I send this package to a user, after he
 unzips the package, he needs to move the shared libraries to the /usr/lib
 directory and proceed with the ldconfig command, otherwise when launching
 the exec file the shared libraries aren't found.

    Is there a way to automatically do this? I can't find it in the doc or in
 mailing lists either. Should a makefile be included with the package that
 would proceed with the installation or does it need to be done manually each
 time?

 No this is standard UNIX mechanism. On Win32 system, executables will
 look for dll within the same directory and simple packaging works out
 of the box.
 The closest thing to reproduce this mechanism on *nix system is
 implemented within kwsys (see SharedForward.h.in). Please note that
 this is an invasive solution.

 A user can simply extent the LD_LIBRARY_PATH to accommodate for your
 particular package, else you have to install you lib in system path
 (/usr/lib for example).

I did not see this as Mathieu did, in fact this is another solution,
pursuing the same idea
May be you can use Full RPATH:

http://www.cmake.org/Wiki/CMake_RPATH_handling#Always_full_RPATH

Another easy solution would be to ship with your executable(s) a simple
(shell) script wrapper, let's call it runme.sh, which may run any of
your executable by doing automatically updating the LD_LIBRARY_PATH.

assume your software is always installed like this

varbase/bin/runme.sh
varbase/bin/me
varbase/lib/lib4me.so

if you do

runme.sh me

then you will obtain something like:
$ runme.sh me.sh
I am /home/eric/Test/bin/runme.sh and my full path is /home/eric/Test/bin
Setting LD_LIBRARY_PATH to :/home/eric/Test/lib
Executing me.sh...
Hi that's me.

I join the runme.sh and me.sh example, in my case I have no executable
and lib4me.so
but it should work in this case too, whereever you put  /lib and /bin
dirs as soon
as you /bin is in the path.

Note that letting user playing with LD_LIBRARY_PATH with your
application is generally
a security breach but security may not be your primary objective.

-- 
Erk


runme.sh
Description: Bourne shell script


me.sh
Description: Bourne shell script
___
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] Installation package

2009-06-10 Thread Eric Noulard
2009/6/10 Pascale B chos...@hotmail.com:
 Hi,

    The RPATH solution works locally only, on my computer only when used with
 the make install command.

That's the expected behavior.

 But now, I seem to have problem to use Cmake to
 create RPMs and I think it has to do with the root directory of rpmbuild. As
 I wrote previously, I use CPack to create a tar.Z file successfully. In my
 CMakeLists.txt, I added as suggested:

 ...
 SET(CPACK_GENERATOR TZ;RPM)
 SET(CPACK_RPM_PACKAGE_DEBUG 1)

 INCLUDE(CPack)
 ...

 Following this, _CPack_Packages is created in the location Where to build
 the binaries specified in cmake Gui (what is the command to fetch this
 variable from CMakeLists.txt?). Under _CPack_Packages is created a directory
 structure LinuxRPM and LinuxTZ.

 When typing : make package

 I get the following error:

 CPack: Finalize package
 CPack Error: Problem copying the package:
 /media/disk/MyApp/MyApp_sources/lnx/_CPack_Packages/Linux/RPM/MyApp_sources-0.1.1-Linux.rpm
 to /media/disk/MyApp/MyApp_sources/lnx/MyApp_sources-0.1.1-Linux.rpm
 CPack Error: Error when generating package: drop_sources
 make: *** [package] Error 1

 and the following in the rpmbuild.err file:

 error: File not found by glob:
 /home/pascale/rpmbuild/BUILDROOT/MyApp_sources-0.1.1-1.x86_64/*
     File not found by glob:
 /home/pascale/rpmbuild/BUILDROOT/MyApp_sources-0.1.1-1.x86_64/*

 How can the desired folder be created automatically? Or should I specify
 another folder? I notice that the folder created by CPack has the name
 ..Linux wheras packaging seems to be looking for ...x86_64?

Which version of CMake/CPack are you using?

Could you show us some if not all your
install(... ) command?
and/or tell us if you use absolute path as destination?

What is your linux distribution ?

Can you tell me which version of rpmbuild is installed on your system
using: rpmbuild --version

There is know issue with rpmbuild version 4.6.x and up.
see:
http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#CPack_RPM_currently_pending_bugs.2Ffeatures

The rpm 4.6.x issue in in CVS HEAD but does not [yet] reached 2.6.x.

-- 
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] Fwd: Installation package

2009-06-10 Thread Eric Noulard
Forgot the list again

-- Forwarded message --
From: Eric Noulard eric.noul...@gmail.com
Date: 2009/6/10
Subject: Re: [CMake] Installation package
To: Pascale B chos...@hotmail.com


2009/6/10 Pascale B chos...@hotmail.com:
 Hi Eric,


  I use CMake 2.6, patch 4.
 Fedora 10
 rpmbuild version 4.6.1. What is the fix for the bug you mentioned?

You should take the CPackRPM.cmake from CVS HEAD:
http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Modules/CPackRPM.cmake?root=CMake

and then either

A) Replace the CPackRPM.cmake installed on your system with the one
you have just downloaded

B) Put the downloaded CPackRPM.cmake in your project source tree
    and add the following line to your CMakeLists.txt

    LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})


The A solution will make the update for the whole machine (aka
available to every user)
but this may need root privilege for installing the file.

The B solution will tell CMake to use the CPackRPM found in your
project instead of the
 one it found in usual location.




 Could you show us some if not all your
 install(... ) command?

 This is in the CMakeLists.txt in the directory where my binaries are
 located:

 #Install execs_
 INSTALL(TARGETS App3D
     RUNTIME
     DESTINATION MyApp/bin
     COMPONENT EXEC3D)

[...]

Looks oK.


 This is in the CMakeLists.txt in the directory where my libraries are
 located:

 #Install library_
 set(LIBRARY_OUTPUT_PATH ./../../../libs/libraryOne/lnx/lib)
 INSTALL(TARGETS libraryOne
        LIBRARY DESTINATION MyApp/lib
        COMPONENT libraryOne)

[...]

Those one are OK too
even if the set(LIBRARY_OUTPUT_PATH ./../../../libs.  is really ugly
but should work (in fact that should not concern CPack).


--
Erk



-- 
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] Installation package

2009-06-10 Thread Eric Noulard
2009/6/10 Pascale B chos...@hotmail.com:
 ok, I followed the instructions as you posted and changed the file
 CPackRPM.cmake:
 http://www.cmake.org/pipermail/cmake/2009-March/028301.html

 and the rpm file is generated under my Linux/RPM folder! :)
 As it is getting late I'll have to test the installation on another computer
 tomorrow. Thanks so much for the help and references!

You should be aware that you can usually install a binary RPM
only on the very same distro on which you built the RPM.

That is if you build the RPM  on Fedora Core 10 x86
you may not be able to install it on Mandriva 2009.1 x86
even if the 2 distros are RPM based.



-- 
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] ATL support

2009-06-11 Thread Eric Noulard
2009/6/11 elizabeta petreska elizabeta.petre...@gmail.com:
 Hello
 How to add ATL support to my project?

May be you can tell us what ATL is ?

A library?
Is it platform specific (MacOS, Windows, Unix...)?

The simplest way to do this is to give us a small intro to ATL
and/or providing us with a url pointing to ATL.

 I saw the question in the mailling list, but with no answer.

Then recall us the thread in the ML archive.


-- 
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] ATL support

2009-06-11 Thread Eric Noulard
2009/6/11 elizabeta petreska elizabeta.petre...@gmail.com:


 On Thu, Jun 11, 2009 at 8:43 AM, elizabeta petreska
 elizabeta.petre...@gmail.com wrote:

 The ATL (Active Template Library) is project template in Visual Studio
 that simplifies creation of COM objects.
 http://en.wikipedia.org/wiki/Active_Template_Library

 I was hoping that in Cmake exsist some variable for ATL like for MFC i.e
 CMAKE_MFC_FLAG


 the thread that I mentioned
 http://www.mail-archive.com/cmake@cmake.org/msg09945.html

Ok Thank you for those informations,
however I would personnally be out of this question loop because I'm
not a day-to-day Windows user :-(

May be that's why I didn't understand the question in the first place :-)

Good luck for help with others.

-- 
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] Put svn revision into file on every make install

2009-06-15 Thread Eric Noulard
2009/6/15 Jean-Pierre Bergamin ja...@ractive.ch:
 Hello cmake users

 I want to put the current subversion revision into a script every time I run
 make install.
 Currently, I use configure_file() to replace a variable in the script, but
 this only updates the script when either the script or something in
 CMakeLists.txt changes.

 Is there a way to update the script every time I run make install?

Did you try with
install([[SCRIPT file] [CODE code]] [...])

using this you may execute a CMake script at install time.



-- 
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] Put svn revision into file on every make install

2009-06-15 Thread Eric Noulard
2009/6/15 Jean-Pierre Bergamin ja...@ractive.ch:
 Hello Eric

 2009/6/15 Jean-Pierre Bergamin ja...@ractive.ch:
  Hello cmake users
 
  I want to put the current subversion revision into a script every time I
 run
  make install.
  Currently, I use configure_file() to replace a variable in the script,
 but
  this only updates the script when either the script or something in
  CMakeLists.txt changes.
 
  Is there a way to update the script every time I run make install?

 Did you try with
 install([[SCRIPT file] [CODE code]] [...])

 using this you may execute a CMake script at install time.

 Good idea. This may lead to what I'm looking for. My svn_revision.cmake
 script now looks like this:

 find_package(Subversion)
 if(Subversion_FOUND)
        Subversion_WC_INFO(${ER_SOURCE_DIR} ER)
        set(REVISION ${ER_WC_REVISION})
        configure_file(${ER_SOURCE_DIR}/scripts/version.sh.in
 ${ER_SOURCE_DIR}/scripts/version.sh @ONLY)
 endif(Subversion_FOUND)

 It is invoked in CMakeLists.txt with install(SCRIPT svn_revision.cmake).
 The only problem I have now is that ${ER_SOURCE_DIR} is not defined in the
 external script. Is there a way to pass arguments to this svn_revision.cmake
 script?

I don't know if you can pass arguments. But I personnally do it in another way
using configure_file + install(script like this:

CONFIGURE_FILE(svn_revision.cmake.in svn_revision.cmake @ONLY)
INSTALL(SCRIPT ${CMAKE_BINARY_DIR}/svn_revision.cmake)

Now the content of svn_revision.cmake.in should be something like:

find_package(Subversion)
if(Subversion_FOUND)
Subversion_WC_INFO(@ER_SOURCE_DIR@ ER)
set(REVISION @ER_WC_REVISION@)
configure_file(@ER_SOURCE_DIR@/scripts/version.sh.in
 @ER_SOURCE_DIR@/scripts/version.sh @ONLY)
endif(Subversion_FOUND)

-- 
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] Linux In-the-source Build multiple modes without swithing

2009-06-19 Thread Eric Noulard
2009/6/19 Dmytro Ovdiienko dmitriy.ovdie...@gmail.com:

 BTW, how about to add to CMake posibility to create symbolic/hard links?

You may already use  -E create_symlink old new- create a symbolic
link new - old
(at least with CMake 2.6.4)

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] Eclipse CDT 4 generator problems

2009-06-22 Thread Eric Noulard
2009/6/22 Robert Bielik robert.bie...@xponaut.se:
 I'm using cmake 2.6-patch 3 on Ubuntu (64bit 8.04) to generate an Eclipse
 project, that part works fine... I think.

 Problem is that when I try to import the project into Eclipse workspace, it
 takes *forever*. It has run now for
 20 minutes+ with a 100% CPU load.
 When can I expect it to finish ?? ;) Or more importantly, is this a known
 bug and are there fixes/workarounds?

Never crossed that one.
I did use cmake 2.6.[1234] with debian etch/sid amd64 + eclipse
ganymede without trouble.

Do you have a stripped down CMake project that exhibits the problem?
I may try it here.

Which version of eclipse do you have?
Which version java do you use?

Personnally I have:
java -version
java version 1.5.0_17
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_17-b04, mixed mode)

Eclipse 3.4.2 (Ganymede)  build id: M20090211-1700

Did you successfully used Eclipse on hand-made project?

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] Eclipse CDT 4 generator problems

2009-06-23 Thread Eric Noulard
2009/6/23 Robert Bielik robert.bie...@xponaut.se:
 Hi Eric,

 Eric Noulard skrev:

 Never crossed that one.
 I did use cmake 2.6.[1234] with debian etch/sid amd64 + eclipse
 ganymede without trouble.

 Do you have a stripped down CMake project that exhibits the problem?
 I may try it here.

 I tried making a simple HelloWorld appl, and that imports just fine...

 Which version of eclipse do you have?

 Version: 3.2.2
 Build id: M20070212-1330 (Ubuntu version: 3.2.2-5ubuntu2)

 Which version java do you use?

 java version 1.5.0
 gij (GNU libgcj) version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)

May be you should try again with a genuine jdk (sun jdk or open jdk)
I did experienced trouble with gij and Eclipse.


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] CPack, error generating rpm file, error File must begin with /:

2009-06-25 Thread Eric Noulard
2009/6/25 Pascale B chos...@hotmail.com:
 Hi All,

    I am using CMake, CPack to generate packages. I successfully generated
 .tar.Z, .rpm and .deb files on my local computer. I am now trying to make
 tests on a computer that I access with SSH and I am getting an error only
 for the rpm file.

 The error presents as:
 CPack Error: Problem copying the package:
 .../lnx/_CPack_Packages/Linux/RPM/drop_sources-1.04.0-Linux.rpm to
 .../lnx/MyApp.rpm

 and when looking at file rpmbuild.err, the content is:

 error: File must begin with /:
     File must begin with /:
  I'm not able to locate where this error comes from. Do you have any idea?

You may be facing the buildroot problem with rpmbuild version greater
than 4.6.0.
See:
http://www.vtk.org/Wiki/CMake:CPackPackageGenerators#CPack_RPM_currently_pending_bugs.2Ffeatures

Which version of CMake are you using?
Could you check the rpmbuild version?
   If it is greater than 4.6.x please upgrade to CMake CVS or
   replace your CPackRPM.cmake file with the one from CMake CVS HEAD.

You may search the list archive for similar issues:

http://www.cmake.org/Wiki/CMake_FAQ#Where_can_I_find_searchable_CMake_Mailing_Archives.3F
-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] CPack, error generating rpm file, error File must begin with /:

2009-06-25 Thread Eric Noulard
2009/6/25 Pascale B chos...@hotmail.com:
 Hi Eric,

    I already had this buildroot problem and fixed it, I copied the file
 locally and can create packages (rpm, deb) on my local computer without any
 problems.

Ok sorry about that I didn't remember that yuo already faced this.

    The problem I have now is on another computer, accessed through SSH, and
 I already replaced the CPackRPM.cmake file.

Ok you did replace the CPackRPM.cmake on the remote computer.

  Where could the File must begin
 with /: come from? I tried to grep this error string in the cmake folder
 and didn't find it?

I don't know, what is the content of rpmbuild.out file?

Would you be able to

0) ssh to the machine
1) cd /to/the/buildir
2) cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM

and copy the output here.
And send me the buggy generated specs file
should be in .../lnx/_CPack_Packages/Linux/RPM/SPECS.

What kind of linux is the remote system?
   Fedora 9,10,11? Mandriva, Debian etc...

How are you launching your RPM build on the remote SSH.
Do you use the same CMAKE_INSTALL_PREFIX locally and

Would you be able to run your RPM building on a remotely launched terminal:
i.e.

0) ssh -X lo...@remote
1) gnome-terminal

work on the locally displayed remote terminal.


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] CPack, error generating rpm file, error File must begin with /:

2009-06-25 Thread Eric Noulard
2009/6/25 Pascale B chos...@hotmail.com:
 Hi Eric,


    Thanks for your help. I use a remote computer in order to test many
 operating systems. The content of rpmbuild.out is enigmatic, it seems empty:

 Processing files: sources-1.04.0-1
 RPM build errors:


Strange that's right.

Are you able to manually build an RPM on this machine?
Would you try to

cd /home/lnx/_CPack_Packages/Linux/RPM/SPECS

then launch

rpmbuild -bb 
--buildroot=/home/lnx/_CPack_Packages/Linux/RPM/sources-1.04.0-Linux
sources.spec

This is the command launched by CPackRPM.cmake, may be you'll see more
when running it by hand

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] [CPACK:rpm] Add library?

2009-06-29 Thread Eric Noulard
2009/6/29  romain.jacquet@free.fr:
 Hello everybody,

    I'm using cmake 2.6.4.
    I want to add externals libraries to aa rpm build with cmake/cpack.

May be you can INSTALL(FILES ...) those externals?
And/or file a feature request for CPackRPM explaining how you want it to work
and may be how it is currently working for other CPack generator you use.

    I have several questions:
    - Is there any library equivalent for CPACK_PACKAGE_EXECUTABLES? I expect
 that CPACK_PACKAGE_LIBRARY work, but it does not.

I thought CPACK_PACKAGE_EXECUTABLES was for NSIS installer for adding
start menu entry:
http://www.vtk.org/Wiki/CMake:CPackConfiguration

Is it used for something else?

    - CPACK_INSTALL_DIRECTORIES seems not to do nothing with the rpm generator.
 Is there any workaround?

This is a bug/missing feature, could you please file a bug report for CPackRPM?
You may off course provide a patch too :-)

Could you tell me which other CPack generator honors the
CPACK_INSTALL_DIRECTORIES ?

    - Why we could not change the prefix in the spec files? The line %define
 prefix ${CMAKE_INSTALL_PREFIX} is commented in the file CPackRPM.cmake.

Because it's not necessary, if you set CMAKE_INSTALL_PREFIX
you will get the corresponding prefix in your RPM.

CPack [generic part] is already installing into
_CPack/CPackGeneratorPrefix/${CMAKE_INSTALL_PREFIX}/
and the RPM generator takes the ${CMAKE_INSTALL_PREFIX}/ part.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] CPACK_SOURCE_IGNORE_FILES

2009-06-30 Thread Eric Noulard
2009/6/30 Knox, Kent kent.k...@amd.com:
 I'm integrating CPack into my build system, and can't quite get
 CPACK_SOURCE_IGNORE_FILES to work right.

 I want to cull individual files from the source package, like .ncb files
 and .pdb files and such.  It seems as though CPACK_SOURCE_IGNORE_FILES
 honors the directories that I want to exclude, but not individual files.
 For instance:

 set( CPACK_SOURCE_IGNORE_FILES
 /Build/;/.hg/;/.svn/;/.ncb$/ )
 will ignore the Build directory, as well as the .svn directory, but
 happily includes the .ncb files, even though I don't want them.

Why do you put a / in front of .ncb$
Could you try:
set(CPACK_SOURCE_IGNORE_FILES /Build/;/.hg/;/.svn/;.ncb$ )

however I agree with other comment that say that you should build
out of source:
http://www.vtk.org/Wiki/CMake_FAQ#Out-of-source_build_trees

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] Problem with generated source and header files

2009-06-30 Thread Eric Noulard
2009/6/30 Jörg Förstner joerg.foerst...@ubidyne.com:
 Hi Tyler,

 I don't know if linking multiple shared libraries together
 like that is
 going to work. You might need to compile libxyz.generated as a static
 lib.

 You're right. Either I'll have to use a static library for libxyz.generated 
 or I manage to add the generated objects to libxyz (the non-generated one) 
 directly, in one step.

  The following attempt does not work, because the
 subdirectory generated is still empty, when FILE is called:

 Right, because file() is run at CMake time but you need to work with
 files generated at make time.

    FILE( GLOB SRCS ${CMAKE_CURRENT_SOURCE_DIR}/generated/*.cpp )
    ADD_LIBRARY( xyz.generated SHARED ${SRCS} )
    ADD_DEPENDENCIES( xyz.generated generate_files )

 I can't think of a good way to do this (it seems to me you'd have to
 generate the list at make time and then somehow interpolate the list
 into the already-written Makefile -- sounds ugly).

 How about generating a CMakeLists.txt file at maketime, containing the file 
 list and somehow calling make or even cmake again?

Did you try this:

1) Call your generator at CMake time using ADD_CUSTOM_COMMAND
(using OUTPUT and DEPENDS argument in order to avoid systematic generation)
Your generator should generate a generated.cmake file containing
 whatever CMake code is needed, may be something like:

 SET(GENERATED_SRC
 generated/
 generated/
)
 ADD_LIBRARY( xyz.generated SHARED ${GENERATED_SRCS} )

(I  let you figure out the SHARED vs STATIC issue)


2)  Then optionnally include the generated cmake script using

 INCLUDE(generated.cmake OPTIONAL RESULT_VARIABLE GENOK)

 IF(NOT GENOK)
  MESSAGE(STATUS Please rerun CMake again)
 ENDIF(NOT GENOK)


Now you should be able to

a) run cmake (the first time you run it Please rerun CMake again
will be printed out.
b) run make which should (to be verified) rerun CMake automatically because
generated.cmake has changed (or appeared)

if b) does not trigger the second CMake run then you'll have to run it manually.

Each time your
-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] if(string MATCHES regex) question

2009-07-01 Thread Eric Noulard
2009/7/1 Marcel Loose lo...@astron.nl:
 Hi all,

 In a number of standard CMake modules I encountered the following line:

  IF(${VARIABLE} MATCHES ^${VARIABLE}$)

 Can anyone explain the rationale of this conditional to me.

The rational no but 

 To my cluttered mind this seems to be an always-true condition.

this is definitely not always true.
The variable your are testing may contain un-evaluated var
or some special regex character( *, ?, ...)

See attached example, you may test it with
$ cmake -P matches.cmake
MATCHES -- MYVAR = A good var
Look that one = double-dollar = blah / single-dollar = MYVAR2
NO MATCHES ** MYVAR = MYVAR2
$

However I have no such usage currently :-)

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


matches.cmake
Description: Binary data
___
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] multiple cvs updates for continuous build

2009-07-02 Thread Eric Noulard
2009/7/2 Bram de Greve br...@users.sourceforge.net:
 Hi,

 I have a large project that combines the sources of different CVS
 repositories/projects in one build.

 I would like to perform a continuous build on this, but AFAIK it's
 possible to do only one cvs update on this.  So the continuous build would
 listen to only one of the CVS projects.

 Is there a way I would be able to extend this listener mechanism to the
 different CVS projects?

May be you can write a CVS command wrapper script and then use it with CTest.
The wrapper script will eventually update from several CVS repo.

see: http://www.vtk.org/Wiki/CMake_Scripting_Of_CTest

and in particular:

SET (CTEST_CVS_COMMAND you-own-script)
SET (CTEST_CVS_CHECKOUT  ${CTEST_CVS_COMMAND}   )

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] if(string MATCHES regex) question

2009-07-03 Thread Eric Noulard
2009/7/2 Marcel Loose lo...@astron.nl:
 Hi Eric,

 The variable your are testing may contain un-evaluated var
 or some special regex character( *, ?, ...)

 See attached example, you may test it with
 $ cmake -P matches.cmake
 MATCHES -- MYVAR = A good var
 Look that one = double-dollar = blah / single-dollar = MYVAR2
 NO MATCHES ** MYVAR = MYVAR2
 $

 However I have no such usage currently :-)

 If I understand your script correctly, then the trick of this construct is to
 check whether the variable MYVAR is defined in terms of one (or more) other
 variables. Correct?

This is not the only NO MATCHES case, if the variable value contains
special regex character you get NO MATCHES too.

 If so, I still don't quite get the usage pattern in, e.g.,
 CheckIncludeFile.cmake. What are they trying to check?

Better ask the author of this file :-)

CVS commit on the file were done by
king -- Brad King
martink -- ??
hoffman -- Bill Hoffman
andy -- ??

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] TEST_BIG_ENDIAN fails for a CXX project

2009-07-08 Thread Eric Noulard
2009/7/8  gr...@akoostix.com:
 Hi! I have a project specified as CXX explicitly, and it requires knowing
 the endian of the machine. I can't seem to use the TEST_BIG_ENDIAN module,
 because it's a .c compilation and I get a

 ... /CheckIncludeFile.c.  TRY_COMPILE only works for enabled languages.
 Currently enabled languages are: CXX
 See PROJECT command for help enabling other languages.

 Error.

 Am I doing something wrong, or is that by design somehow? I can always
 just let CMake determine the project type itself, but it seems like there
 should be a way to do an endian check for a CXX project.

I did face the same issue and did manually add

ENABLE_LANGUAGE(C)

in my main CMakeLists.txt

may be the module assuming C has been enabled should
test CMAKE_C_COMPILER_WORKS before going on.

Whether they should automatically ENABLE_LANGUAGE(C) is questionable?
Now since most C programs can be compiled with a C++ compiler
may be the module should directly use C++ compiler if C is not enabled?

What's your opinion?

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] Complete Path of source files being displayed in obj Files

2009-07-08 Thread Eric Noulard
2009/7/8 Malhotra, Anupam anupam.malho...@safenet-inc.com:
 Hi David



 Thanks for the reply. I am not concerned about the names of object files. I
 was talking about the contents of the object files. If you analyze the
 object files, they contain the complete paths of corresponding source files.
 This complete path is not desirable for us. We want the object files to
 contain only the relative paths. Is that possible?

May be you are using __FILE__ macro in order to print debug/log message
in your source code right?

I did use basename/dirname functions
http://www.linuxmanpages.com/man3/basename.3.php
in order to avoid to display full path in such case.

What's your test case?

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] conflicting types for built-in function 'snprintf'

2009-07-08 Thread Eric Noulard
2009/7/8 Steven Van Ingelgem ste...@vaningelgem.be:
 Hi,


 I tried this call:
 CHECK_FUNCTION_EXISTS(snprintf  HAS_snprintf)


 Which results in this error being generated:
 C:\MinGW\bin\gcc.exe   -g -ggdb -O0 -Wall -Werror
 -DCHECK_FUNCTION_EXISTS=snprintf   -o
 CMakeFiles\cmTryCompileExec.dir\CheckFunctionExists.c.obj   -c C:\Program
 Files\CMake 2.7\share\cmake-2.7\Modules\CheckFunctionExists.c
 cc1.exe: warnings being treated as errors
 C:\Program Files\CMake 2.7\share\cmake-2.7\Modules\CheckFunctionExists.c:3:
 error: conflicting types for built-in function 'snprintf'


 What I understand is that the snprintf type exists, but conflicts with the
 built-in version... So this should return 'true' in fact...

 What can I do about it?

Disable builtin support with
SET(CMAKE_REQUIRED_FLAGS -fno-builtin)
see: 
http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/C-Dialect-Options.html#C-Dialect-Options

or

update CheckFunctionExists.cmake in order to make it try builtin first?

or

update CheckFunctionExists.cmake in order to make it catch the
conflicting types for built-in function
and return true in this case?


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] conflicting types for built-in function 'snprintf'

2009-07-08 Thread Eric Noulard
2009/7/8 Steven Van Ingelgem ste...@vaningelgem.be:
 Hi Eric,


 1) Your first option wouldn't work because CMAKE_REQUIRED_FLAGS isn't
 known by neither try_compile, neither the macro.

Did you try it?

The documentation says:
 CheckFunctionExists
   macro which checks if the function exists

   CHECK_FUNCTION_EXISTS(FUNCTION VARIABLE)

 FUNCTION - the name of the function
 VARIABLE - variable to store the result

   The following variables may be set before calling this macro to modify
   the way the check is run:

 CMAKE_REQUIRED_FLAGS = string of compile command line flags
 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
 CMAKE_REQUIRED_INCLUDES = list of include directories
 CMAKE_REQUIRED_LIBRARIES = list of libraries to link

and the CheckFunctionExists.cmake makes use of those macros.


 2) Wouldn't work either because try_compile doesn't take command line
 parameters (at least not in this form  unless you will construct the
 makefile from hand inside this script).

try_compile(RESULT_VAR bindir srcfile
 [CMAKE_FLAGS Flags]
 [COMPILE_DEFINITIONS flags ...]
 [OUTPUT_VARIABLE var]
 [COPY_FILE filename )

thus you should be able to add -f-no-builtin to COMPILE_DEFINITIONS?
or may be I miss something?

The trouble I see with the -f-no-builtin is that the flag is GCC specific so
you must check that your compiler is GCC before adding it.


 3) I think this is the only feasible way in fact... Although I find this the
 least nicest way, and as such I didn't try that one.

Agreed that's ugly. I was just trying to be as exhaustive as possible :-)



-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] conflicting types for built-in function 'snprintf'

2009-07-08 Thread Eric Noulard
2009/7/8 Hendrik Sattler p...@hendrik-sattler.de:
 Zitat von Eric Noulard eric.noul...@gmail.com:

 It works for me and the CMakeFiles/CMakeOutput.log reads:

 Building C object CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o
 /usr/bin/gcc  -DWHAT=ever -DCHECK_FUNCTION_EXISTS=snprintf
 -fno-builtin   -o
 CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o   -c
 /home/eric/CMake/cmake-V2_6/share/cmake-2.6/Modules/CheckFunctionExists.c

 which is the expect command line.

 It's not. The OP use additional -W parameters like -Werror.
 Actually, the test should be made work with -Wall -Wextra -Werror.

Ok right that's because I forget to add those flags in my too-simple
test case,
the fact is if you add:

SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wall -Wextra -Werror)

 before

SET(CMAKE_REQUIRED_FLAGS -fno-builtin)


Then you get in the log:

Building C object CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o
/usr/bin/gcc   -Wall -Wextra -Werror  -DCHECK_FUNCTION_EXISTS=snprintf
-fno-builtin   -o
CMakeFiles/cmTryCompileExec.dir/CheckFunctionExists.c.o   -c
/home/eric/CMake/cmake-V2_6/share/cmake-2.6/Modules/CheckFunctionExists.c

which **should** be the expected command line :-)

not to mentionned that the snprintf is FOUND with the extra
SET(CMAKE_REQUIRED_FLAGS -fno-builtin)

and is not found without it.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] conflicting types for built-in function 'snprintf'

2009-07-09 Thread Eric Noulard
2009/7/9 Mathieu Malaterre mathieu.malate...@gmail.com:
 On Wed, Jul 8, 2009 at 11:22 PM, Alexander
 Neundorfa.neundorf-w...@gmx.net wrote:


 Did you try using check_symbol_exists() ?

 Indeed.

 Ref:
 http://public.kitware.com/Bug/view.php?id=8246

 Solution:
 INCLUDE(CheckSymbolExists)
 CHECK_SYMBOL_EXISTS(strcasecmp strings.h HAVE_STRCASECMP)
 CHECK_SYMBOL_EXISTS(strncasecmp strings.h HAVE_STRNCASECMP)
 CHECK_SYMBOL_EXISTS(snprintf stdio.h    HAVE_SNPRINTF)

Didn't use CHECK_SYMBOL_EXISTS before, definitely the better solution
thanks Alex+Mathieu


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] post and pre processing for the Cpack target (package/package_source)

2009-07-09 Thread Eric Noulard
2009/7/9 t m cm...@majchrowski.co.uk:
 Hello CMake Experts,

 Is there any way to define post or pre-processing actions for built-in
 targets like package/package_source.

 Those two are not visible in CMakeLists.txt scope, so the
 add_dependencies(package_source pre_package_source)
 can not be used. What I found is the solution described here:
 http://dingyichen.livejournal.com/8104.html. It based on
 fact that you can wrapp a package target call by adding own target:

 ADD_CUSTOM_TARGET(pack_src
    COMMAND make package_source
    COMMENT Packaging Source files
    DEPENDS other_dependency
    VERBATIM
    )

 I check it and is fine as far as you do not use -j option together
 with make. Is there any other alternative ?, Thanks in advance.

Unfortunately I think that all built-in targets suffers from this issue:
it may be worth adding a comment there:
http://www.cmake.org/Bug/view.php?id=8438

It may be worth a special comment on this one
because package/package are even trickier target
than all/install etc... because package/package source are not always
present :-)

They are generated by the generic generator if CPack[Source]Config.cmake
is found in the build tree,
see: CMake/Source/cmGlobalGenerator.cxx.


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] Downloading something with CMake

2009-07-10 Thread Eric Noulard
Hi all,

Is there any builtin downloading function in CMake or CTest?
As far as I know CTest has buit-in curl capability
so may be there is (or would be) a

GET_FILE(filename url) macro that could be implemented?

I want to automate (with CMake) the retrieval of third party file
using http/https/ftp?

Or should I use FindWget.cmake etc...

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] Downloading something with CMake

2009-07-10 Thread Eric Noulard
2009/7/10 Will Dicharry wdicha...@stellarscience.com:
 Eric Noulard wrote:

 Is there any builtin downloading function in CMake or CTest?
[...]

 I want to automate (with CMake) the retrieval of third party file
 using http/https/ftp?

 Take a look at the file( DOWNLOAD ... ) command.  I think that should do
 what you want.

Yes that's it.
I knew did read that in the past but could remember the [sub]-command.

Thank you Will.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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] How to pass -D options when compiling assembly files using gcc?

2009-07-11 Thread Eric Noulard
2009/7/11 Marcel Loose lo...@astron.nl:
 Hi Bill,

 The problem is not in the invocation of gcc. That works fine. The
 problem is that I lose the preprocessor definitions that were added with
 add_definitions() when compiling assembly files. These assembly files
 must be preprocessed by gcc. I have the feeling that CMake purposely
 drops these. So the question is how I can persuade CMake to keep the -D
 options on the command line.

I don't know if you can persuade CMake to keep those for compiling
ASM instead of C but you may be you get the
currently added definitions using properties:
(on directory, target or source
 see cmake --help-properties)

e.g.:

get_directory_property(ASM_DEF DEFINITION)

then use the value of ASM_DEF in your *ASM*.cmake.

Take my opinion as pure guess because I does not know
much on how CMake*Compiler.cmake works so I don't know
if you may share some variables values between
the standard C  and your custom ASM.


 Note that I have defined an assembler for BG/P that uses gcc as
 frontend, using the *ASM*.cmake macros mentioned in my previous mail.


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
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


<    3   4   5   6   7   8   9   10   11   12   >