Re: [CMake] cpack and paths too long

2012-04-23 Thread Andrea Crotti

On 04/23/2012 01:32 PM, David Cole wrote:

You should just get used to using shorter paths on the embarrassing OS.

This is an early warning sign for you that your end users will also 
encounter these problems as they install your program on their systems 
in "non-short" root paths...


You can ignore it if you wish, but the fact remains that Windows STILL 
has many components in it that rely on full path names of ALL files 
being less than 260 characters.


They do support longer file names, but there are still many legacy 
tools where the limit exists.



HTH,
David



I agree with you, unfortunately I'm not the person that has to use 
smaller paths, just writing the build system..
And good point about the installed application, I think I can assume 
however that if the CPack works also
the installed application should work, because it doesn't have the ~20 
chars needed for CPacking (but of course

depends on where it will be installed).

So well the only way is to make really sure there are no long paths 
around then :(

--

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 and paths too long

2012-04-23 Thread Andrea Crotti

On 04/20/2012 12:36 PM, Eric Noulard wrote:

Nope, it would break backward compatibility, you can dig the ML
for discussion about that "issue".

My opinion is that building in-source is a bad habit that ought to be
discouraged but the fact is,
this is not currently easy to enforce out-of-source:
http://www.cmake.org/Bug/view.php?id=6672




Ok the make problem was my mistake sorry..

we haven't really solved the long path problem yet unfortunately, even 
building out of source we get some very long paths...


Is there a way to shorten this generated path by CPack?

   C:/Temp/cmake_gen/_CPack_Packages/win32/NSIS*
*
Anyway the only solution I see for now is to check with a script the 
length of the paths, and abort before trying to

build anything.

Or the other possible solution is to run cpack from an OS which is not 
embarrassing, but not sure what version of CMake

we have available and if the NSIS is working fine on that version..
--

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 and paths too long

2012-04-20 Thread Andrea Crotti

On 04/19/2012 07:00 PM, Eric Noulard wrote:

Compiler, Visual Studio something?
You run cpack from the command line or from within IDE/Makefile etc



No compilers used for this project (it's python) and I run from command 
line.


Anyway it might be a good idea also in general so I tried to do it and 
it doesn't find a path,
but the error is not quite clear, what path is it talking about (because 
all I see there exists)?



c:/temp $ cmake -G "MSYS Makefiles" 
e:/git_projs/Minimum_Drag/xyz.application.minimum_drag

-- PSI found in e:/git_projs/PSI_Hamburg
-- workspace set to 
e:/git_projs/Minimum_Drag/xyz.application.minimum_drag/../..

-- copying the runner file with the right substitutions
-- running: c:/python25/python.exe  
-p;e:/git_projs/Minimum_Drag/xyz.application.minimum_drag;-w;e:/git_projs/Minimum_Drag/xyz.application.minimum_drag/../..

-- writing the list of dependencies to egg_list.txt
-- Configuring done
-- Generating done
-- Build files have been written to: C:/temp
c:/temp $ make xyz.application.minimum_drag_install
The system cannot find the path specified.
epd-make: *** [cmake_check_build_system] Error 1
c:/temp $ make xyz.application.minimum_drag_install VERBOSE=1
"/c/buildprograms/programs/CMake 2.8/bin/cmake.exe" 
-H/e/git_projs/Minimum_Drag/xyz.application.minimum_drag -B/C/temp 
--check-build-system CMakeFiles/Makefile.cmake 0

The system cannot find the path specified.
epd-make: *** [cmake_check_build_system] Error 1

PS. And in general I think it's a bit confusing the fact that I need to 
remove manually the CMakeCache

from the source directory when I run out of tree..
Couldn't CMake just discard that path when building out of tree?

Thanks,
Andrea
--

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 and paths too long

2012-04-19 Thread Andrea Crotti

On 04/19/2012 04:13 PM, Eric Noulard wrote:

Could you build out-of-source in a small path?
like

small/path/build
when your source would be in
long/path/source

cpack should only work with file in the build tree.

this is a workaround but it may work.

By the way:
   Which version of CMake/CPack are you using?
   With which platforms/compiler combination(s) are your working?



I suppose I could yes, I could copy the things I need to c:\tmp maybe 
and use it like this,

not a great solution but if it's the only way to go...
Running:
cmake 2.8.7
cpack 2.8.7
on windows 7

--

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 and paths too long

2012-04-19 Thread Andrea Crotti
We are trying to make cmake work with our projects, and all the targets 
work fine.


The problem is that on some projects cpack -G NSIS fails because when it 
tries to copy

files around it generates paths too long.

I found that CMake is able to handle these situations in theory with a 
checksum of the path,

but it seems that it's not doing it in this case.

The structure is the following, where long/path/cmakelist.txt includes
the other/long/cmakelist.txt file, and all it's needed for the
installer is in long/path/result_to_install.

- long/path/cmakelist.txt
- long/path/result_to_install/
- other/long/path/cmakelist.txt

Any suggestions?
Thanks,
Andrea
--

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] failing target

2012-03-06 Thread Andrea Crotti

On 03/06/2012 03:29 PM, David Cole wrote:

On Tue, Mar 6, 2012 at 10:24 AM, Andrea Crotti


The explanation is simple: if you have two targets and they run in
*random* order, then it will be "correct" 50% of the time... Or
perhaps 100% on one platform and 0% on another. That's likely what you
were seeing when you thought that it worked sometimes.

With the dependencies specified correctly with add_dependencies, you
should now see it work 100% of the time.


Very good thanks, now I'm satisfied ;)
the problem was appearing in fact when I was trying to run in parallel, 
which explains everything..

--

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] failing target

2012-03-06 Thread Andrea Crotti

On 03/06/2012 02:07 PM, Andrea Crotti wrote:



I opened a thread some time ago about this, and I actually thought it
was a bug in the documentation, because then why everything works 
otherwise?


This simple example which I produced

add_custom_target(a
  ${CMAKE_COMMAND} -E echo "a"
  )

add_custom_target(b
  ${CMAKE_COMMAND} -E echo "b"
  DEPENDS a
  )


does exactly what would be expected, even if there files a or b don't 
exist.
So I might suppose that this intra-target dependencies work but not 
always,

is that correct?


I tried to substitute the wrong DEPENDS with the add_dependencies and it 
seems to work now.
That doesn't explain why it works on Windows and my other Linux box, but 
well if that's the correct

way to do it I'll stick with that..
--

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] failing target

2012-03-06 Thread Andrea Crotti

On 03/06/2012 02:01 PM, Michael Hertling wrote:

Yes, the DEPENDS clause of ADD_CUSTOM_TARGET() is only for *file*
dependencies, but you use it for *target* dependencies. According
to the documentation of ADD_CUSTOM_TARGET():

"Dependencies listed with the DEPENDS argument may reference files
and outputs of custom commands created with add_custom_command()
in the same directory (CMakeLists.txt file)."

"Use ADD_DEPENDENCIES to add dependencies to or from other targets."

Regards,

Michael
--




I opened a thread some time ago about this, and I actually thought it
was a bug in the documentation, because then why everything works otherwise?

This simple example which I produced

add_custom_target(a
  ${CMAKE_COMMAND} -E echo "a"
  )

add_custom_target(b
  ${CMAKE_COMMAND} -E echo "b"
  DEPENDS a
  )


does exactly what would be expected, even if there files a or b don't exist.
So I might suppose that this intra-target dependencies work but not always,
is that correct?
--

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] failing target

2012-03-06 Thread Andrea Crotti

On 03/06/2012 01:45 PM, Michael Hertling wrote:


Could you post the lines which define those targets psi.utility_install
and install_all_eggs, or is this quite tricky, too? Do these lines stem
from the same CMakeLists.txt? IIRC, the "no rule to make... needed by"
error occurs when there's something wrong with the DEPENDS clause of
ADD_CUSTOM_COMMAND/TARGET().

Regards,

Michael


Well I think it's something related to the platform, because both on my 
Linux

box and windows it works perfectly.

This is the interesting part anyway:

foreach(egg ${egg_list})
  #TODO: now I need to replace the name with only the last part of the path
  get_filename_component(egg_name ${egg} NAME)
  set(egg_install ${egg_name}_install)
  # generate the list of targets to create more easily dependencies
  list(APPEND egg_install_list ${egg_install})

  add_custom_target(${egg_install}
COMMAND ${PYTHON_EXECUTABLE} setup.py -q bdist_egg -d 
${EGG_BUILD_DIRECTORY}

WORKING_DIRECTORY ${egg}
  )

endforeach()

add_custom_target(install_all_eggs
  DEPENDS ${egg_install_list}
)

#TODO: add this target to the dependencies of run and packing if it works
add_custom_target(unzip_all_eggs
  # unzip the eggs and clean up the zips
  COMMAND ${PYTHON_EXECUTABLE} ${UNZIP_SCRIPT} ${EGG_BUILD_DIRECTORY} 
${EGG_UNZIPPED_DIRECTORY}

  # copy the two run files in the final destination
  COMMAND ${CMAKE_COMMAND} -E copy ${EGG_BUILD_DIRECTORY}/${RUNNER} 
${EGG_UNZIPPED_DIRECTORY}/${RUNNER}
  COMMAND ${CMAKE_COMMAND} -E copy ${EGG_BUILD_DIRECTORY}/${C_RUNNER} 
${EGG_UNZIPPED_DIRECTORY}/${C_RUNNER}


  DEPENDS install_all_eggs
)


sdo the targets are generated at cmake-time reading from a file and then 
there are few more targets that depend on

all of them.

Is there anything wrong in this part?
--

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] failing target

2012-03-06 Thread Andrea Crotti

On 03/06/2012 07:23 AM, Michael Hertling wrote:

On 03/05/2012 05:59 PM, Andrea Crotti wrote:

I'm having the following behaviour, and I can't quite understand the
error message:

..
Built target psi.utility_install
..
make[3]: *** No rule to make target `psi.utility_install', needed by
`CMakeFiles/install_all_eggs'.  Stop.
make[2]: *** [CMakeFiles/install_all_eggs.dir/all] Error 2
make[1]: *** [CMakeFiles/unzip_all_eggs.dir/rule] Error 2
make: *** [unzip_all_eggs] Error 2


So first it builds successfully psi.utility_install and then it
complains that there are no rules to make it.
Who is right then and what could cause such a problem?

This is happening on a strange Linux machine, on Windows with MinGW it's
working (strangely)..

Could you boil down your project to a minimal and self-sufficient
example which exhibits this behavior for further investigations?

Regards,

Michael
--



That's quite tricky unfortunately, I hoped that someone saw something 
similar already and

could give me a hint..
Anyway that machine is not a priority at the moment I'll just see later 
when it's more stable.

--

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] failing target

2012-03-05 Thread Andrea Crotti
I'm having the following behaviour, and I can't quite understand the 
error message:


..
Built target psi.utility_install
..
make[3]: *** No rule to make target `psi.utility_install', needed by 
`CMakeFiles/install_all_eggs'.  Stop.

make[2]: *** [CMakeFiles/install_all_eggs.dir/all] Error 2
make[1]: *** [CMakeFiles/unzip_all_eggs.dir/rule] Error 2
make: *** [unzip_all_eggs] Error 2


So first it builds successfully psi.utility_install and then it 
complains that there are no rules to make it.

Who is right then and what could cause such a problem?

This is happening on a strange Linux machine, on Windows with MinGW it's 
working (strangely)..

--

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] NSIS template

2012-03-02 Thread Andrea Crotti
I'm working on the NSIS template and changing it to my needs, so 
unfortunately I also

have to really understand some more NSIS..

One thing that I found from the doc is that the LogicLib.nsh makes life 
a lot simpler.

All these strcmp would be simpler for example
  StrCmp $1 1 AddToPath_NT
; Not on NT
StrCpy $1 $WINDIR 2
FileOpen $1 "$1\autoexec.bat" a
FileSeek $1 -1 END
FileReadByte $1 $2


Are you in general interested in cleaning up / refactoring the NSIS 
template file anyway keeping

the same features?
--

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 snippets

2012-02-29 Thread Andrea Crotti

On 02/29/2012 06:27 PM, Eric Noulard wrote:

2012/2/29 Andrea Crotti:

If anyone is interested, I'm collecting cmake-mode yasnippet snippets for
Emacs:

https://github.com/AndreaCrotti/yasnippet-snippets/tree/master/cmake-mode

Is anyone else using it and has some nice snippets to share?

I'm not using it (yasnippet) but this seems interesting.
Can you complete then expand the snippets?




Yes sure, if you also use auto-complete 
(http://www.emacswiki.org/emacs/AutoComplete)
I just start typing and then auto-complete comes in and proposes me some 
snippets or

just some strings from the buffer or the sources that I configure.

Have a look here (my emacs conf)
https://github.com/AndreaCrotti/Emacs-configuration/tree/master/modules
in ca-auto-complete and ca-yas there are my settings..

--

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] smarter shortcuts with NSIS

2012-02-29 Thread Andrea Crotti

On 02/28/2012 05:53 PM, Eric Noulard wrote:

2012/2/28 Andrea Crotti:

On 02/28/2012 03:42 PM, Eric Noulard wrote:



Yes more or less beside the fact is CPack is doing more work than that:
   1) CPack handles CPack-private install location for you
   (including the installation of the component selected to be put
in the installer
taken from CPACK_COMPONENTS_ALL)

   2) It prepares componentization of the installer.
  (including possible COMPONENT dependencies, display name etc...

   3) Finally if you use configure_file + add_custom_command you won't get
  all the CPACK_xxx vars CPack has :-( Because some of them my be computed
  dynamically by CPack which then does the configure_file in this context.

I forgot to mention that "NSIS.template.in" is including an auxiliary file:
"NSIS.InstallOptions.ini.in" which is configured as well.

All this is doable by hand but may not be as easy as it seems in the
general case.



Thanks for the great explanation, now it's clear..
Just one thing, how do I make sure that it's actually using my own template
(apart from running the produced installer)?
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] cmake snippets

2012-02-29 Thread Andrea Crotti
If anyone is interested, I'm collecting cmake-mode yasnippet snippets 
for Emacs:


https://github.com/AndreaCrotti/yasnippet-snippets/tree/master/cmake-mode

Is anyone else using it and has some nice snippets to share?
--

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] smarter shortcuts with NSIS

2012-02-28 Thread Andrea Crotti

On 02/28/2012 03:42 PM, Eric Noulard wrote:



At worst is there a way to just create my own .nsi file and use it directly?
I need to create a page which simply asks for a directory to the user, and
then use that to create a shortcut..

Any idea (also other solutions might be fine).

1) Copy the current NSIS.template.in in your project.
 and update it the way you like.

2) update CMAKE_MODULE_PATH
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/packaging)

 in order to make your NSIS.template.in in the CMAKE_MODULE_PATH
 (you can even use CPACK_MODULE_PATH)

3) run-rerun packaging an dmake sure that cpack is using your projevtc specific
 NSIS.template.in





Ok thanks that's probably the best solution.
So if I understand correctly this is more or less the same as writing my 
own nsi file,
run configure_file on it and then add a create_custom_target for 
packaging, is that right?


I will then probably write the file from scratch, trying to understand 
what it does, because

the template is quite mysterious at the moment..
--

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] smarter shortcuts with NSIS

2012-02-28 Thread Andrea Crotti
Alright moving the include after did the trick, I get my code in the 
final nsi file, as below:


set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
PageEx directory
  DirVar PythonDir
PageExEnd

CreateShortCut \\\"$DESKTOP${PROJECT_NAME}.lnk\\\" 
\\\"$INSTDIRbuilt_eggrun.exe\\\" \"$PythonDirpythonw.exe\" 
\"\" \"\" \".$INSTDIR\" \"Run project ${PROJECT_NAME}\"

")


The problem is that it fails for this reason:
Error: command PageEx not valid in Section

which makes sense, but is there a way to avoid that PageEx to end up in 
a section at all?

Is that the only way to inject NSIS code?

At worst is there a way to just create my own .nsi file and use it directly?
I need to create a page which simply asks for a directory to the user, 
and then use that to create

a shortcut..

Any idea (also other solutions might be fine).
--

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] smarter shortcuts with NSIS

2012-02-27 Thread Andrea Crotti

On 02/27/2012 05:51 PM, Eric Noulard wrote:

2012/2/27 John Drescher:

Ah yes you're right, last time I checked I didn't see them..
Anyway my extra_commands don't appear anywhere in the nsi file, is that
normal?

No i'ts not.
Did you set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS ...)

BEFORE


Actually I didn't.. Some time ago it was failing when including after, 
so I moved all the includes on top.

I'll change it again tomorrow then..


include(CPack) ?

The process is relatively simple.

0) Your CPACK_xxx vars are set and processed by the inclusion
 of CPack.cmake (the include(CPack) of your CMakeLists.txt)

1) CPack NSIS generator "configures" the  NSIS.template.in
 file by replacing occurences of CPACK_NSIS_... specific vars in there.

2) makensis is launched using the generated project.nsi

CPack private installation of your project in a _CPackPackage subdir
is done somewhere between 0) and 1).

You need awkward extra escape in CPACK_NSIS_xxx because of the double
CMake script processing 0) and 1).

Is it clearer?


Ok now is clear thanks

--

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] smarter shortcuts with NSIS

2012-02-27 Thread Andrea Crotti

On 02/27/2012 04:52 PM, John Drescher wrote:

By the way, how do I see the actual paths NSI configuration that generates
the final exe?
It seems that if NSIS works the file used get all removed..


It does not get removed for me using Visual Studio 2010. All of the
NSIS stuff exists in a _CPack_Packages folder inside of the build
tree.

John


Ah yes you're right, last time I checked I didn't see them..
Anyway my extra_commands don't appear anywhere in the nsi file, is that 
normal?

--

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] smarter shortcuts with NSIS

2012-02-27 Thread Andrea Crotti

On 02/27/2012 03:34 PM, Andrea Crotti wrote:
My brain is almost going to explode, so before it does maybe someone 
can help..


I have a cpack with NSIS working installer, which just copies a 
directory.
In that directory there is a file run.exe, which needs to take an 
argument to run correctly.
Now that argument is a path which is only known at install-time, via 
asking to the user.


So what I would like to do is to:
1. get that path into a variable
2. stick it into the arguments of a shortcut file on the windows machine

I found something like this on stackoverflow:

set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
CreateShortCut \\\"$DESKTOP${PROJECT_NAME}.lnk\\\" 
\\\"$INSTDIRbuilt_eggrun.exe\\\" \"c:\python25\pythonw.exe\"

")

But I have some trouble understand in general, how is this command 
processed?

First the cmake variables are substituted and then it's simply run?

And any advice on how to get the variable with the path?
Thanks,
Andrea


This is the first attempt:

set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
PageEx directory
  DirVar PythonDir
PageExEnd

CreateShortCut \\\"$DESKTOP${PROJECT_NAME}.lnk\\\" 
\\\"$INSTDIRbuilt_eggrun.exe\\\" \"$PythonDir\\pythonw.exe\" 
\"\" \"\" \".$INSTDIR\" \"Run project ${PROJECT_NAME}\"

")

but I don't get any page asking me for the destination directory, and no 
shortcut is created..
By the way, how do I see the actual paths NSI configuration that 
generates the final exe?

It seems that if NSIS works the file used get all removed..
--

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] smarter shortcuts with NSIS

2012-02-27 Thread Andrea Crotti
My brain is almost going to explode, so before it does maybe someone can 
help..


I have a cpack with NSIS working installer, which just copies a directory.
In that directory there is a file run.exe, which needs to take an 
argument to run correctly.
Now that argument is a path which is only known at install-time, via 
asking to the user.


So what I would like to do is to:
1. get that path into a variable
2. stick it into the arguments of a shortcut file on the windows machine

I found something like this on stackoverflow:

set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
CreateShortCut \\\"$DESKTOP${PROJECT_NAME}.lnk\\\" 
\\\"$INSTDIRbuilt_eggrun.exe\\\" \"c:\python25\pythonw.exe\"

")

But I have some trouble understand in general, how is this command 
processed?

First the cmake variables are substituted and then it's simply run?

And any advice on how to get the variable with the path?
Thanks,
Andrea
--

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] mingw vs MSYS makefiles

2012-02-24 Thread Andrea Crotti

On 02/23/2012 10:55 PM, Bill Hoffman wrote:

On 2/23/2012 6:20 AM, Andrea Crotti wrote:




I don't think anyone really addressed your question.  Your question 
seems to have taken on a whole new life


The problem seems to be that your cmake file is creating makefiles 
that use a python program in them.  For some reason python is not 
working from an msys shell for you.  You should debug that, and try to 
figure out how to get a python that does work, or figure out why this 
python is failing under msys.


Moral of the story, don't depend on python in your build, use cmake 
scripts if possible, or c programs that you build  :)




Ideally yes, unfortunately it's not really possible to avoid the python 
call, without rewriting a lot of code in CMake/C (which is not a good idea).


I will check what is the requirement, if the MinGW make is fine then 
I'll just use that otherwise I'll debug the problem with the MSYS..

--

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] upper/lower case

2012-02-23 Thread Andrea Crotti

On 02/23/2012 04:52 PM, Michael Wild wrote:

On 02/23/2012 04:08 PM, Andrea Crotti wrote:

I really physically suffer using case-insensitive languages,

Seriously? You must be an annoyingly happy person if that's your biggest
problem in life! ;-)


It's a quite minor problem, but I think it's not by mistake that the 
only programming language

that I know (quite spread) that is case insensitive is Visual Basic.
It's just wrong imho, because case can really help to spot different 
things, when you leave
the user choose what it wants than everyone that reads the code waste an 
extra amount

of time trying to figure out what the hell that is.

CMake is a small language and it's not a big deal, and probably it can't 
be changed, so it's fine..

The only occasion where you can hide a CMake-defined variable is inside
a function(). Otherwise you *overwrite* it's value. And you often want
to actually do that (e.g. to set the output directories for executables,
libraries, archives etc.).

HTH

Michael



Well I just meant overwriting something that you're not supposed to, and 
that is used by cmake

internally for some other important things.
But I guess it's not so easy because the names are starting with 
CPACK/CMAKE..

--

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] simplest possible NSIS package

2012-02-23 Thread Andrea Crotti

On 02/23/2012 04:48 PM, John Drescher wrote:

Just to make you laugh I found the source of the problem.
Apparently if you try to run an installer from a directory which is on a
shared directory (with the virtualbox
sharing) it just won't run :D

Copying it somewhere else works perfectly, quite amazing issue.


Thanks for reporting back. That was very puzzling to me since my NSIS
builds have worked for a long time.

John


My pleasure, I would have never thought of something so stupid actually :/
But is it true that NSIS is quite a dead project?
The last version is from 2009 as far as I can see..
Are there plans to support other package managers for windows?
--

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] simplest possible NSIS package

2012-02-23 Thread Andrea Crotti

On 02/23/2012 03:56 PM, Andrea Crotti wrote:


It appears it's really a problem of NSIS, even trying the a small 
example (directly with makensis) from the website produces an

installer that doesn't work, I'll investigate in that direction then.



Just to make you laugh I found the source of the problem.
Apparently if you try to run an installer from a directory which is on a 
shared directory (with the virtualbox

sharing) it just won't run :D

Copying it somewhere else works perfectly, quite amazing issue.
--

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] simplest possible NSIS package

2012-02-23 Thread Andrea Crotti

On 02/23/2012 02:32 PM, Andrea Crotti wrote:

So I'm still struggling to get an actual installer.
I copied almost the same example from the book:

cmake_minimum_required(VERSION 2.6)
project (Prova)

add_executable(prova a.c)
install(
  TARGETS prova RUNTIME DESTINATION bin
  )

include(CPack)


cmake does all its job, the package is created without errors with
cpack -G NSIS
or make package

but then windows complain that the file doesn't exist, even if it 
actually does and it's not empty.


Now I wonder, are there any compulsory variables for NSIS to get this 
working?


And if yes I even tried to run it with --warn-unitialized and it 
doesn't say anything, shouldn't it warn
me if I'm trying to use NSIS and I didn't initialize any of the useful 
variables?


Thanks,
Andrea


It appears it's really a problem of NSIS, even trying the a small 
example (directly with makensis) from the website produces an

installer that doesn't work, I'll investigate in that direction then.
--

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] upper/lower case

2012-02-23 Thread Andrea Crotti
I really physically suffer using case-insensitive languages, but is 
there any convention to decide

at least when to use upper and when to use a lower case?

For example user defined variables should be upper or lower case?

Or what happens if I hide by mistake a CMake-defined variable? (are they 
all upper case?)

--

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] intra-targets dependencies

2012-02-23 Thread Andrea Crotti

Reading the documentation in add_custom_target I see this:

Dependencies listed with the DEPENDS
   argument may reference files and outputs of custom commands created
   with add_custom_command() in the same directory (CMakeLists.txt 
file).



But this actually works just fine

add_custom_target(a
  ${CMAKE_COMMAND} -E echo "a"
  )

add_custom_target(b
  ${CMAKE_COMMAND} -E echo "b"
  DEPENDS a
  )

and now b depends on a.
So is the documentation wrong?
Because from what I gathered from it intra-dependencies relationships 
have to be defined only with

add_dependencies, but that doesn't explain why the above example works..

Thanks,
Andrea
--

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] descriptive make help

2012-02-23 Thread Andrea Crotti

Is there a way to get some more information from "make help"?
I can already add a COMMENT to a custom target which will appear when I 
build that target,

but it does not appear if I do make help..

Cheers,
Andrea
--

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] simplest possible NSIS package

2012-02-23 Thread Andrea Crotti

So I'm still struggling to get an actual installer.
I copied almost the same example from the book:

cmake_minimum_required(VERSION 2.6)
project (Prova)

add_executable(prova a.c)
install(
  TARGETS prova RUNTIME DESTINATION bin
  )

include(CPack)


cmake does all its job, the package is created without errors with
cpack -G NSIS
or make package

but then windows complain that the file doesn't exist, even if it 
actually does and it's not empty.


Now I wonder, are there any compulsory variables for NSIS to get this 
working?


And if yes I even tried to run it with --warn-unitialized and it doesn't 
say anything, shouldn't it warn
me if I'm trying to use NSIS and I didn't initialize any of the useful 
variables?


Thanks,
Andrea
--

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] mingw vs MSYS makefiles

2012-02-23 Thread Andrea Crotti
I have MinGW installed in my system and today I added the bin directory 
to the path, so I was able to

run all the commands also from a standard shell.

But now CMake complains:

 CMake Error at c:/Program Files/CMake 
2.8/share/cmake-2.8/Modules/CMakeMinGWFindMake.cmake:20 (MESSAGE):

  sh.exe was found in your PATH, here:

  C:/MinGW/msys/1.0/bin/sh.exe

  For MinGW make to work correctly sh.exe must NOT be in your path.

  Run cmake from a shell that does not have sh.exe in your PATH.

  If you want to use a UNIX shell, then use MSYS Makefiles.


So well I thought I could just use the MSYS Makefiles instead, but 
reconfiguring and with the same target that doesn't work:


Scanning dependencies of target cleanup_system
process_begin: CreateProcess(NULL, /c/python25/python.exe 
h:/git_projs/PSI_Hamburg/utils/utils/bin/clean_global.py, ...) failed.

make (e=2): The system cannot find the file specified.
epd-make[3]: *** [CMakeFiles/cleanup_system] Error 2
epd-make[2]: *** [CMakeFiles/cleanup_system.dir/all] Error 2
epd-make[1]: *** [CMakeFiles/run_as_user.dir/rule] Error 2
epd-make: *** [run_as_user] Error 2


Does it mean that I have something which is not portable in my CMakeLists?

The solution might be remove the MinGW bin from the path of course, but 
I would lose the nice commands from each shell

and I would also like to understand what is going on..

Thanks,
Andrea
--

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] delayed target

2012-02-23 Thread Andrea Crotti

On 02/23/2012 05:18 AM, Michael Hertling wrote:


There is a possibility to dynamically reconfigure/rebuild the project
without an intermediate manual step and in a way that you'll have one
target per egg, but that approach is disadvantageous in other regards
and possibly won't work with generators other than the Makefiles ones.

IMO, if you really need one target per egg, you should gather them at
configure time and accept the need to reconfigure the project by hand
when necessary. If one target per egg isn't a must-do, gather them at
build time and use a script - CMake, shell, whatever - to unzip them;
this can be done well in parallel also.

Regards,




What I could do to make it *really* idiot-proof also in my situation, is
to force a reconfiguration for every call.

I could for example add a target

add_target(reconfigure
  ${CMAKE_COMMAND} .
)

and make all the other targets depend on it.
So I'm sure that I never have to rerun cmake myself, how does that sound?
--

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] passing arguments to the final make

2012-02-23 Thread Andrea Crotti

On 02/23/2012 06:20 AM, Michael Hertling wrote:


The point is that ${SCRIPT} is substituted in the Makefile by

(1) a macro specified on the command line
(2) a macro specified in the Makefile
(3) an environment variable

in that order, or with (2) and (3) reversed if Make is invoked with the
"-e" switch. When the Makefile's command lines are passed to the shell,
the substitution has already taken place, so it should also work with
the Windows command prompt. However, one needs a Make program, i.e. a
parameterization of this kind probably doesn't work with non-Makefile
generators. Even with Makefiles, there are subtle pitfalls: If a line
"SCRIPT = ..." happens to appear somewhere in the Makefiles, invoking
Make as "make SCRIPT=..." will overwrite it, most certainly resulting
in surprising and undesired behaviour. Personally, I'd advise against
using this method without explicit support by the Makefile generator.

Regards,

Michael


Yes well the problem is that it should work on Windows, and at least
with MinGW and with Gnu Makefiles.
I tried and I failed with this approach so I'll just drop the idea...

Also because typing

make do_this
./test.py

is not much different than "SCRIPT=test.py make do_this"

--

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] delayed target

2012-02-22 Thread Andrea Crotti

On 02/22/2012 09:37 PM, Michael Hertling wrote:


In order to define one target per egg, you'd need to know the eggs at
configuration time since you cannot define targets at build time. So,
gathering the eggs with a custom target/command will not work. As an
alternative, you might gather the eggs at configuration time with a
FILE(GLOB ...) command, loop over the resulting list and define one
target per item. However, your Makefiles would not be aware of any
changes among the eggs - additions, removals, renamings - and you
would need to remember to reconfigure your project by hand if you
don't want to miss any changes. That's somewhat error-prone and
means relinquishing one of CMake's benefits.

Regards,

Michael
-

Yes sure when there are changes in that sense we need to reconfigure,
but it's really not a big deal in our case because it won't almost never 
happen,
and anyway I don't really have any other choice if I want to use the 
parallelization

provided by make -j.
--

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] passing arguments to the final make

2012-02-22 Thread Andrea Crotti

On 02/22/2012 09:18 PM, Michael Hertling wrote:

On 02/22/2012 06:56 PM, Andrea Crotti wrote:

On 02/22/2012 05:32 PM, Andrea Crotti wrote:

Ah that's nice thanks, I'm not sure though that I can rely on being>=
2.8 always,
and that's probably a requirement, right?


I tried what you suggested and with this:
add_custom_target(dev_no_run
COMMAND ${PYTHON_EXECUTABLE} ${DEV_MAIN} -w ${WORKSPACE}
${APPLICATION} --develop_only -l info
COMMAND ${PYTHON_EXECUTABLE} \${SCRIPT}
)

I get this in the Makefile:

CMakeFiles/dev_no_run:
  /usr/bin/python
/home/andrea/git_projs/PSI_Hamburg/utils/utils/bin/dev_main.py -w
/home/andrea/git_projs
/home/andrea/git_projs/Minimum_Drag/airbus.application.minimum_drag
--develop_only -l info
  /usr/bin/python ${SCRIPT}

which is probably not what I want, because for a Makefile it should be
$(SCRIPT), right?

In Makefiles, $(SCRIPT) and ${SCRIPT} are equivalent, see [1]. However,
parentheses can have a special meaning w.r.t. a library's object files,
and $() is primarily associated with the shell's command substitution.
Thus, I personally prefer ${} for dereferencing macros in Makefiles
since it's quite unambiguous.

Regards,

Michael




Ah good thanks, I have to check what happened then tomorrow because it 
didn't

work properly anyway...
And another thing, is it actually \${SCRIPT} a portable solution that 
works on all the generators?

--

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] make a python script executable

2012-02-22 Thread Andrea Crotti

So now suppose I have a working installer (which is not the case yet),
and that the entry point of the whole program is a python script.

Is there a way to make the whole project launchable via double click on 
more platforms?


At the moment there is a run.bat in every project for this to run on 
Windows, and I guess

it's not so easy otherwise http://www.pyinstaller.org/ would not exist.

But since cmake can run the python script in a multi-platform way, maybe 
there is a way

to create an actual executable that does the job, right?
--

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] delayed target

2012-02-22 Thread Andrea Crotti

On 02/22/2012 05:14 PM, Michael Hertling wrote:

On 02/22/2012 05:02 PM, Andrea Crotti wrote:

Again I'm having some troubles with the different building stages:

I would like to have a target that simply unzips all the files contained
in a directory,
which can be found with a simple globbing.

   add_custom_target(unzip_all_eggs
 file(GLOB eggs RELATIVE ${EGG_BUILD_DIRECTORY}/*egg)
 COMMAND ${PYTHON_EXECUTABLE} ${UNZIP_SCRIPT} ${egg}
 )


The problem is that [...]

...FILE(GLOB ...) is a CMake command executed by CMake, whereas the
custom target's COMMANDs are executed by the build tool at build
time, so this approach fails from the first.


A possible solution is to make my UNZIP_SCRIPT smarter and just do the
globbing
itself, is there any other more CMake-like solution?

ADD_CUSTOM_TARGET(unzip_all_eggs
 ${CMAKE_COMMAND}
 -DEGGDIR=${EGG_BUILD_DIRECTORY}
 -P ${CMAKE_SOURCE_DIR}/unzip_all_eggs.cmake)

# ${CMAKE_SOURCE_DIR}/unzip_all_eggs.cmake:
SET(PYTHON_EXECUTABLE ...)
SET(UNZIP_SCRIPT ...)
FILE(GLOB eggs RELATIVE ${EGGDIR}/*egg)
EXECUTE_PROCESS(
 COMMAND ${PYTHON_EXECUTABLE} ${UNZIP_SCRIPT} ${eggs}
 WORKING_DIRECTORY ...
)

You might want to provide an unzip_all_eggs.cmake.in template including

SET(PYTHON_EXECUTABLE @PYTHON_EXECUTABLE@)
SET(UNZIP_SCRIPT @UNZIP_SCRIPT@)

use CONFIGURE_FILE(unzip_all_eggs.cmake.in unzip_all_eggs.cmake @ONLY)
to generate the actual unzip_all_eggs.cmake after searching Python and
your script, and specify -P ${CMAKE_BINARY_DIR}/unzip_all_eggs.cmake.



Thanks, this is really nice in general and I might use it in the future.
The problem is that in this specific case it doesn't buy me much and 
adds complexity, because

I would still have only one target unzipping all the eggs.

It would be nice to be able to generate N target 1 for each egg.

Anyway I think that just modifying the python unzip script to do the 
globbing is the

easier way to go in this case..
--

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] passing arguments to the final make

2012-02-22 Thread Andrea Crotti

On 02/22/2012 05:32 PM, Andrea Crotti wrote:


Ah that's nice thanks, I'm not sure though that I can rely on being >= 
2.8 always,

and that's probably a requirement, right?



I tried what you suggested and with this:
add_custom_target(dev_no_run
  COMMAND ${PYTHON_EXECUTABLE} ${DEV_MAIN} -w ${WORKSPACE} 
${APPLICATION} --develop_only -l info

  COMMAND ${PYTHON_EXECUTABLE} \${SCRIPT}
  )

I get this in the Makefile:

CMakeFiles/dev_no_run:
/usr/bin/python 
/home/andrea/git_projs/PSI_Hamburg/utils/utils/bin/dev_main.py -w 
/home/andrea/git_projs 
/home/andrea/git_projs/Minimum_Drag/airbus.application.minimum_drag 
--develop_only -l info

/usr/bin/python ${SCRIPT}

which is probably not what I want, because for a Makefile it should be 
$(SCRIPT), right?

--

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] passing arguments to the final make

2012-02-22 Thread Andrea Crotti

On 02/22/2012 05:25 PM, Michael Hertling wrote:

On 02/22/2012 04:43 PM, Andrea Crotti wrote:

I would like to be able to pass arguments to my generated Makefile.

Suppose I use an environment variable like this:

add_custom_target(run_dev_script
COMMAND ${PYTHON_EXECUTABLE} ${PREREQUISITE}
COMMAND ${PYTHON_EXECUTABLE} ${SCRIPT}
)

Would that actually work?
In theory ${SCRIPT} is substituted at cmake time, so I have the
impression that it wouldn't work..
I don't find anything useful in cmake -E however, that would allow me to
do something at make time.
Any suggestions?

CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
PROJECT(P NONE)
ADD_CUSTOM_TARGET(echo ${CMAKE_COMMAND} -E echo \${ECHO})

After initial configuration:

% make echo ECHO="Hello World"
Scanning dependencies of target echo
Hello World
Built target echo
% make echo ECHO="Goodbye World"
Goodbye World
Built target echo

% make echo ECHO="Regards, Michael"
Regards, Michael
Built target echo


Ah that's nice thanks, I'm not sure though that I can rely on being >= 
2.8 always,

and that's probably a requirement, right?

--

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] delayed target

2012-02-22 Thread Andrea Crotti

Again I'm having some troubles with the different building stages:

I would like to have a target that simply unzips all the files contained 
in a directory,

which can be found with a simple globbing.

 add_custom_target(unzip_all_eggs
   file(GLOB eggs RELATIVE ${EGG_BUILD_DIRECTORY}/*egg)
   COMMAND ${PYTHON_EXECUTABLE} ${UNZIP_SCRIPT} ${egg}
   )


The problem is that when I actually run cmake these files don't exist yet,
so this command could not really work...

A possible solution is to make my UNZIP_SCRIPT smarter and just do the 
globbing

itself, is there any other more CMake-like solution?
--

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] passing arguments to the final make

2012-02-22 Thread Andrea Crotti

I would like to be able to pass arguments to my generated Makefile.

Suppose I use an environment variable like this:

add_custom_target(run_dev_script
  COMMAND ${PYTHON_EXECUTABLE} ${PREREQUISITE}
  COMMAND ${PYTHON_EXECUTABLE} ${SCRIPT}
  )

Would that actually work?
In theory ${SCRIPT} is substituted at cmake time, so I have the 
impression that it wouldn't work..
I don't find anything useful in cmake -E however, that would allow me to 
do something at make time.

Any suggestions?
--

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] checking arguments

2012-02-22 Thread Andrea Crotti
I find not so nice that CMake doesn't complain at all if some variables 
are not defined.

Is there a way to make it complain if a variable used is actually blank?

In the meanwhile I ended up with this:

set(COMPULSORY_ARGUMENTS PSI)
set(OPTIONAL_ARGUMENTS WORKSPACE CONTAINER_PATHS)

macro (check_compulsory_variable var)
  if (NOT DEFINED ${var})
message(FATAL_ERROR "variable ${var} is not defined")
  endif ()
endmacro ()

macro (check_optional_variable var)
  if (NOT DEFINED ${var})
message(WARNING "variable ${var} is not defined")
  endif ()
endmacro ()

foreach (arg ${COMPULSORY_ARGUMENTS})
  check_compulsory_variable(${arg})
endforeach ()

foreach (arg ${OPTIONAL_ARGUMENTS})
  check_optional_variable(${arg})
endforeach ()


which is not great but it does the job.
Any better solutions?
--

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 issues

2012-02-22 Thread Andrea Crotti
Alright then I now actually get an installer which I can click on, and 
cpack doesn't give any more errors.


However, when I try to run the executable I get a
"executable..exe The specified path does not exist.."

which is quite a weird error, because it's the same path that I'm 
clicking, and it does exists :S


Has anyone seen this?
I just changed the destination to the ${PROJECT_NAME}:
install(
  DIRECTORY ${EGG_BUILD_DIRECTORY}
  DESTINATION ${PROJECT_NAME}
  )

but in general, how would I make sure that the final installer will try 
to install the software

in $ENV{USERPROFILE} for example?

Writing it in the destination is clearly wrong, but is there another way 
then?


Thanks,
Andrea
--

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 issues

2012-02-21 Thread Andrea Crotti

On 02/21/2012 06:25 PM, Eric Noulard wrote:

2012/2/21 Andrea Crotti:

I'm trying to finally create an installer for my project, with CPack and
NSIS.

The project is really really simple, I just need to copy over a directory
somewhere.
And I did something like:

get_filename_component(userprofile $ENV{USERPROFILE} REALPATH)

install(
  DIRECTORY ${EGG_BUILD_DIRECTORY}
  DESTINATION ${userprofile}/${PROJECT_NAME}
  )

Is "userprofile" an absolute path? (sorry I'm not working on Windows very often)
if this is the case this will not work.

DO NEVER install with absolute install path on Windows:
1) the installed pieces won't be put in the installer
2) the files/dirs/whatever MAY (if you have enough privilege) be
installed on the machine
on which you are trying to build the package!!

I think we should forcibly forbid absolute install path on
windows...but that's another story.


I see, well I just wanted to get something running quickly to see if the 
packaging actually works.
Anyway my assumption was that $ENV{USERPROFILE} would be the userprofile 
directory on the machine
where I will run the installer, but I understand now why this is a very 
stupid assumption.


With the relative path I got an actual installer in the end, but I get 
another error when I try to run it

that I will investigate further tomorrow..
Thanks a lot for now.
--

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 issues

2012-02-21 Thread Andrea Crotti
I'm trying to finally create an installer for my project, with CPack and 
NSIS.


The project is really really simple, I just need to copy over a 
directory somewhere.

And I did something like:

get_filename_component(userprofile $ENV{USERPROFILE} REALPATH)

install(
  DIRECTORY ${EGG_BUILD_DIRECTORY}
  DESTINATION ${userprofile}/${PROJECT_NAME}
  )


The first line is because CPack was exploding using the USERPROFILE, because
it was getting non quoted backslash.

So is it the way to handle windows path variables?

The packing, however, doesn't work and I get something like (from the 
NSIS generated log file):


!insertmacro: end of MUI_RESERVEFILE_INSTALLOPTIONS
Section: "-Core installation"
SetOutPath: "$INSTDIR"
File: Returning to: "H:/long_path/_CPack_Packages/win32/NSIS/Minimum 
Drag-0.1.1-win32"
File: "H:/long_path/_CPack_Packages/win32/NSIS/Minimum 
Drag-0.1.1-win32\*.*" -> no files found.

Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] |
   /oname=outfile one_file_only)
Error in script 
"H:/git_projs/Minimum_Drag/airbus.application.minimum_drag/_CPack_Packages/win32/NSIS/project.nsi" 
on line 640 -- aborting creation process


These are the variables that I defined
set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_ICON "Company")
set(CPACK_NSIS_PACKAGE_NAME ${PROJECT_NAME})

set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYRIGHT.txt")
set(CPACK_PACKAGE_VERSION_MAJOR 0)
set(CPACK_PACKAGE_VERSION_MINOR 1)
set(CPACK_CREATE_DESKTOP_LINKS "${PROJECT_NAME}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}") # add the version 
numbers

set(CPACK_PACKAGE_DESCRIPTION "Package ${PROJECT_NAME}")


is there anything missing?
Any idea what that could be?
--

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] multi platform path

2012-02-21 Thread Andrea Crotti

On 02/21/2012 01:39 PM, Rolf Eike Beer wrote:

get_filename_component()

Eike
--

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


Thank you both that 's what I was looking for :)
--

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] more targets to run in parallel

2012-02-21 Thread Andrea Crotti

Anyway just to answer myself, I managed to solve all my problems.
Now I first generate at cmake file a file with some paths, and from
these paths I generate all the targets that I need.

I also create a list with all the targets to make it easy from other 
targets to depend on them.


Here below the simplified code (if there are better ways I'm all hears)


foreach (egg ${egg_list})
  get_filename(${egg})
  set(egg_install ${RESULT_VAR}_install)
  add_custom_target(${egg_install})
  # generate the list of targets to create more easily dependencies
  list(APPEND target_install_list ${egg_install})

  add_custom_command(
TARGET ${egg_install}
COMMAND ${PYTHON_EXECUTABLE} setup.py bdist_egg -d 
${EGG_BUILD_DIRECTORY}

WORKING_DIRECTORY ${egg}
)

endforeach ()

add_custom_target(install_all_eggs ALL
  DEPENDS ${target_install_list}
  )

--

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] multi platform path

2012-02-21 Thread Andrea Crotti

I want to be able to have this simple translation between full path and
filename.

For example = /very/long/path/file.py ->  file.py

So I did this quite ugly function:

function (get_filename FULLPATH)
   string(REPLACE "/" ";" p2list "${FULLPATH}")
   list(REVERSE p2list)
   list(GET p2list 0 last)
   set(RESULT_VAR ${last} PARENT_SCOPE)
endfunction()

but the problem is that it doesn't work on windows unfortunately.
Is there some library/code to do multi-platform path manipulations in
CMake maybe?

--

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] more targets to run in parallel

2012-02-20 Thread Andrea Crotti
Going back to the original question, I realised that my approach could 
not work.


In short the list of targets and commands that I need to generate depend 
on a file,

which is generated from a python script.

So I thought I could use execute_process before the foreach:

execute_process(
  OUTPUT_FILE ${INSTALLED_EGGS_LIST}
  COMMAND "${PYTHON_EXECUTABLE} ${GEN_DEPENDENCY_SCRIPT} 
${BUILD_APP_OPTIONS}"

  )

foreach (egg ${INSTALLED_EGGS_LIST})
  set(egg_install ${egg}_install)
  set(egg_unzip ${egg}_unzip)
  add_custom_target(${egg_install})
  add_custom_target(${egg_unzip})

  add_custom_command(
TARGET ${egg_install}
COMMAND ${PYTHON_EXECUTABLE} ${egg} setup.py bdist_egg -d 
${DESTINATION}

WORKING_DIRECTORY ${egg}
)

  add_custom_target(
TARGET ${egg_unzip}
COMMAND ${PYTHON_EXECUTABLE}
)
endforeach ()


But now *why* the process is actually not executed every time I run 
"cmake", as I was expecting?

--

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] more targets to run in parallel

2012-02-20 Thread Andrea Crotti

On 02/20/2012 03:50 PM, David Cole wrote:
On Mon, Feb 20, 2012 at 10:42 AM, Eric Noulard <mailto:eric.noul...@gmail.com>> wrote:


2012/2/20 Andrea Crotti mailto:andrea.crott...@gmail.com>>:
> On 02/20/2012 03:15 PM, David Cole wrote:
>
>
> Use:
>
>   COMMAND ls -l
>
> Not:
>
>   COMMAND "ls -l"
>
>
> Yes thanks, I started using the "" because I noticed that
sometimes they are
> needed.
> So suppose I want to split the options and the command, this:
>
> set(myoptions one two three)
> set(mycmd ls -l)
>
> message(${mycmd} ${myoptions})
>
> will produce
> ls-lonetwothree
>
> Which is not what I want, but with " I get even a more strange
result:
> message("${mycmd} ${myoptions}")
>
> ls;-l one;two;three
>
> and in the list command I don't see any way to simply
concatenate two lists,
> so how should I merge two different lists to produce a command?

You may avoid to create a list in the first place:
set(myoptions "one two three")
instead of
set(myoptions one two three)

see
cmake --help-command list

or you can
string(REPLACE ";" " " stringopts "${myoptions}")
message(STATUS "${stringopts}")


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



If you have:

  set(myoptions one two three)
  set(mycmd ls -l)

Then:

  COMMAND ${mycmd} ${myoptions}

should give you what you expect. (Regardless of what the "message" 
command's output is.)





Ah yes you're probably right, I tried it and it works.
It would still be nice to understand how to pass generated lists to 
COMMAND, but that's a plus for

the moment, and apparently too hard to get right..
--

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] more targets to run in parallel

2012-02-20 Thread Andrea Crotti

On 02/20/2012 03:42 PM, Eric Noulard wrote:
You may avoid to create a list in the first place: set(myoptions "one 
two three") instead of set(myoptions one two three) see cmake 
--help-command list or you can string(REPLACE ";" " " stringopts 
"${myoptions}") message(STATUS "${stringopts}") 


So now I ended up with this, where the final command is the list 
concatenation of two other lists,
and then use the replace trick and create a custom_command which should 
run it.


set(GEN_DEPENDENCY_SCRIPT $ENV{PSI_PATH}/devsonly/devsonly/bin/build_app.py)
set(INSTALLED_EGGS_LIST installed_eggs.txt)
set(BUILD_APP_OPTIONS -o ${INSTALLED_EGGS_LIST} -w ${WORKSPACE} 
${APPLICATION})


list(APPEND GEN_DEPENDENCY_CMD ${PYTHON_EXECUTABLE} 
${GEN_DEPENDENCY_SCRIPT} ${BUILD_APP_OPTIONS})


string(REPLACE ";" " " GEN_DEPENDENCY_CMD ${GEN_DEPENDENCY_CMD})

add_custom_command(
  OUTPUT ${INSTALLED_EGGS_LIST}
  COMMAND ${GEN_DEPENDENCY_CMD}
)


But it doesn't work yet, even if the list is actually correct the 
command executed gives this:
/bin/sh: 
/usr/bin/python~/git_projs/PSI_Hamburg/devsonly/devsonly/bin/build_app.py-oinstalled_eggs.txt-w/home/andrea/git_projs/home/andrea/git_projs/Minimum_Drag/airbus.application.minimum_drag: 
No such file or directory


The thing which is not quite clear is what COMMAND takes as option, 
probably not a list but a list

is converted automatically to the arguments that it takes?
--

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] more targets to run in parallel

2012-02-20 Thread Andrea Crotti

On 02/20/2012 03:15 PM, David Cole wrote:


Use:

  COMMAND ls -l

Not:

  COMMAND "ls -l"



Yes thanks, I started using the "" because I noticed that sometimes they 
are needed.

So suppose I want to split the options and the command, this:

set(myoptions one two three)
set(mycmd ls -l)

message(${mycmd} ${myoptions})

will produce
ls-lonetwothree

Which is not what I want, but with " I get even a more strange result:
message("${mycmd} ${myoptions}")

ls;-l one;two;three

and in the list command I don't see any way to simply concatenate two lists,
so how should I merge two different lists to produce a command?
--

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] more targets to run in parallel

2012-02-20 Thread Andrea Crotti

On 02/20/2012 11:51 AM, Eric Noulard wrote:

2012/2/20 Andrea Crotti:

On 02/17/2012 03:35 PM, Andrea Crotti wrote:
..

I can make the question much simpler, is it possible to generate targets
dynamically with CMake?

As far as I know you can "generate" targets at CMake-time but not at build-time.
So from my point of view this "computed target" but not really "dynamic target".
if you want your target to trigger the command you may
add the OUTPUT of the command as a dependency of the target.

add_custom_target(${t}
 DEPENDS ${t_cmd}
 )




Ah thanks now I got it, I thought that the name of the custom_command 
was given

from the OUTPUT, for some strange reason.

Doing this however:
foreach (t ${target_list})
  set(t_cmd ${t}.out)
  add_custom_command(OUTPUT ${t_cmd}
COMMAND "ls ${t}"
)
endforeach ()

foreach (t ${target_list})
  message("analyzing target ${t}")
  set(t_cmd ${t}.out)
  add_custom_target(${t}
DEPENDS ${t_cmd}
)
endforeach ()

is still problematic:
~/psi_diet/test_cmake $ make uno
[100%] Generating uno.out
/bin/sh: ls uno: command not found
make[3]: *** [uno.out] Error 127



So I tried an even simpler example:
add_custom_command(OUTPUT simple
  COMMAND "ls -l"
  )

add_custom_target(simple
  DEPENDS simple
  )


and everything works apparently, but it doesn't generate the "simple" file..
How do I generate an output file which is used as dependency of the "simple"
target then?
--

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] more targets to run in parallel

2012-02-20 Thread Andrea Crotti

On 02/17/2012 03:35 PM, Andrea Crotti wrote:
..

I can make the question much simpler, is it possible to generate targets 
dynamically with CMake?


I was trying the following (nonsense), a simple loop over a list
that first generates a custom command and another loop
that generates a target for every command.

set(target_list uno due tre)

foreach (t ${target_list})
  set(t_cmd ${t}.out)
  add_custom_command(OUTPUT ${t_cmd}
COMMAND "ls ${t} > ${t_cmd}"
)
endforeach ()

foreach (t ${target_list})
  message("analyzing target ${t}")
  set(t_cmd ${t}.out)
  add_custom_target(${t}
COMMAND ${t_cmd}
)
endforeach ()


I would suppose that this should work but it doesn't:

make[3]: uno.out: Command not found
make[3]: *** [CMakeFiles/uno] Error 127
make[2]: *** [CMakeFiles/uno.dir/all] Error 2
make[1]: *** [CMakeFiles/uno.dir/rule] Error 2
make: *** [uno] Error 2

Any idea why?
--

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] more targets to run in parallel

2012-02-17 Thread Andrea Crotti

So suppose I have a list of Python eggs, in the form.

- egg1
- egg2
- ..

What I would like to do is to have be able to do.
cmake .
make build_eggs

which would go over the list of the eggs and run in each of them

python setup.py bdist_egg -d 

The list of eggs is actually computed at run-time, so I created a custom
command and a custom target:

add_custom_command(OUTPUT ${INSTALLED_EGGS_LIST}
  COMMAND "${PYTHON_EXECUTABLE} ${GEN_DEPENDENCY_SCRIPT} 
${BUILD_APP_OPTIONS}"

)

add_custom_target(generate_dependency_file
  DEPENDS ${INSTALLED_EGGS_LIST}

)

So now, is there a way to create one target for *each* egg in the list?
And then I also need also a way to have another target that actually
depends on all these other targets, is that possible?

I could have just one target to build them all, but then it would not be
able to actually run in parallel (with make -j), is that correct?
--

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 + NSIS on windows

2012-01-25 Thread Andrea Crotti

On 01/25/2012 02:48 PM, Andrea Crotti wrote:

Now however CMake complains that it can't fin nmake, which from my
search it's something it's this:
http://superuser.com/questions/146577/where-do-i-find-nmake-for-windows-7

so cmake . generated by default the nmake files, but why cpack would
need nmake for in the first place if I'm just using NSIS?

Is this really a dependency which should be also installed?


From reading here
http://www.cmake.org/Wiki/CMake:Packaging_With_CPack
I think is exactly what I would like to do, using cpack directly without
cmake and nmake.

But it also doesn't work, in the sense that it still needs NMake.
After I downloaded everything (SDK and visual studio express) it finally
worked, but I really don't see why cpack should need to make anything..
Is that really necessary / unavoidable?

Because that would mean that it's probably not a good idea, since
NSIS would do the same as NSIS + CMake + SDK + visual studio expres..
--

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 + NSIS on windows

2012-01-25 Thread Andrea Crotti

On 01/25/2012 02:49 PM, Bill Hoffman wrote:

On 1/25/2012 9:28 AM, Andrea Crotti wrote:

Since I still don't get CMake + NSIS running on Linux, I was trying to
build my software
on Windows...


CMake and NSIS has never been ported to work on Linux, so no surprise 
there.


Wait, this contradicts the long thread "cpack -G NSIS", where Eric says 
that my
examples work perfectly for him on Linux, while they still don't work 
for me..


Thanks

--

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 + NSIS on windows

2012-01-25 Thread Andrea Crotti

Now however CMake complains that it can't fin nmake, which from my
search it's something it's this:
http://superuser.com/questions/146577/where-do-i-find-nmake-for-windows-7

so cmake . generated by default the nmake files, but why cpack would
need nmake for in the first place if I'm just using NSIS?

Is this really a dependency which should be also installed?
--

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 + NSIS on windows

2012-01-25 Thread Andrea Crotti

On 01/25/2012 02:28 PM, Andrea Crotti wrote:
Since I still don't get CMake + NSIS running on Linux, I was trying to 
build my software

on Windows...

I installed CMake and NSIS and all my CMake actually does is to create 
an installer:


cmake_minimum_required(VERSION 2.6)
project(try_out)
install(
  # is this automatically the source dir??
  DIRECTORY one two
  DESTINATION test_ddest
  COMPONENT dirs
  )
include(CPack)


Ok I think I understood by myself, I just need to set
project(try_out NONE) to avoid checks of any language and it
doesn't complain anymore..
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] CMake + NSIS on windows

2012-01-25 Thread Andrea Crotti
Since I still don't get CMake + NSIS running on Linux, I was trying to 
build my software

on Windows...

I installed CMake and NSIS and all my CMake actually does is to create 
an installer:


cmake_minimum_required(VERSION 2.6)
project(try_out)
install(
  # is this automatically the source dir??
  DIRECTORY one two
  DESTINATION test_ddest
  COMPONENT dirs
  )
include(CPack)


From my understanding I first need to run CMake which actually creates all
the files which can be also read from cpack.
Now the problem is that it complains the my C compiler is not set correctly.

But why does it care in the first place?
I mean there are no instructions there which might imply that it needs 
to compile

something, so why should it be set?

Thanks,
Andrea
--

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 -G NSIS

2012-01-23 Thread Andrea Crotti

It's a bit tricky to follow the code, but from my first attempt with the
debug symbols activated I get the following backtrace:
(running cpack -G NSIS)

--8<---cut here---start->8---
(gdb) bt
#0  0x76e28935 in raise () from /lib/libc.so.6
#1  0x76e29dab in abort () from /lib/libc.so.6
#2  0x7775d1ed in __gnu_cxx::__verbose_terminate_handler() () 
from /usr/lib/libstdc++.so.6

#3  0x7775b396 in ?? () from /usr/lib/libstdc++.so.6
#4  0x7775b3c3 in std::terminate() () from /usr/lib/libstdc++.so.6
#5  0x7775b4be in __cxa_throw () from /usr/lib/libstdc++.so.6
#6  0x777081f7 in std::__throw_logic_error(char const*) () from 
/usr/lib/libstdc++.so.6
#7  0x77746039 in char* std::string::_S_constructconst*>(char const*, char const*, std::allocator const&, 
std::forward_iterator_tag) () from /usr/lib/libstdc++.so.6
#8  0x77746113 in std::basic_stringstd::char_traits, std::allocator >::basic_string(char 
const*, std::allocator const&) () from /usr/lib/libstdc++.so.6
#9  0x0066e5f8 in cmCPackNSISGenerator::InitializeInternal 
(this=0xd20b20) at 
/home/andrea/cmake/Source/CPack/cmCPackNSISGenerator.cxx:410
#10 0x0065c444 in cmCPackGenerator::Initialize (this=0xd20b20, 
name=0xd1c248 "NSIS", mf=0x7fffcfe0) at 
/home/andrea/cmake/Source/CPack/cmCPackGenerator.cxx:1104
#11 0x0064d553 in main (argc=3, argv=0x7fffe568) at 
/home/andrea/cmake/Source/CPack/cpack.cxx:400

--8<---cut here---end--->8---


In particular it seems that the problem is trying to get this option:

file:~/cmake/Source/CPack/cmCPackNSISGenerator.cxx::std::string 
nsisFileName = this->GetOption("CPACK_TOPLEVEL_DIRECTORY")


Which fails here:
file:~/cmake/Source/CPack/cmCPackGenerator.cxx::const char* 
cmCPackGenerator::GetOption(const char* op) const


that thing returs 0x0 and the std::string explodes because it was not
what it was expecting..
That's all I could understand for now..

--

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 -G NSIS

2012-01-22 Thread Andrea Crotti
So yes this was with your try-out example, actually I can try to dig a 
little bit myself, the problem
is that with gdb I need to have the debug symbols, thus recompiling in 
debug mode.


But nowhere in the Readme or around the code I found a way to do it (it 
would be very nice

to add maybe somewhere)..

I found only this in the Makefile which might be useful, but I'm sure 
there is a smarter way

to just install with the debug symbols..

-DCMAKE_INSTALL_DO_STRIP=1

Thanks a lot,
Andrea
--

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 -G NSIS

2012-01-22 Thread Andrea Crotti

On 01/19/2012 07:52 PM, Eric Noulard wrote:

Installing empty dir may fail.

Try the attached zip and tell me if it fails for you.
It works for me on Debian Wheezy 64.



They were not empty dirs, and trying from another machine (arch 64 bits),
with NSIS 2.46-3, and cmake 2.8.7-2 and kernel now 3.2.1-1
but I saw the same problem already on kernel 3.1 and also on the git
version of CMake...

This is the bactrace from running it within GDB: (not knowing much o f 
the internals I can't do much more unfortunately..)


#0  0x76c4b935 in raise () from /lib/libc.so.6
#1  0x76c4cdab in abort () from /lib/libc.so.6
#2  0x7728c1ed in __gnu_cxx::__verbose_terminate_handler() () 
from /usr/lib/libstdc++.so.6

#3  0x7728a396 in ?? () from /usr/lib/libstdc++.so.6
#4  0x7728a3c3 in std::terminate() () from /usr/lib/libstdc++.so.6
#5  0x7728a4be in __cxa_throw () from /usr/lib/libstdc++.so.6
#6  0x772371f7 in std::__throw_logic_error(char const*) () from 
/usr/lib/libstdc++.so.6
#7  0x77275039 in char* std::string::_S_constructconst*>(char const*, char const*, std::allocator const&, 
std::forward_iterator_tag) ()

   from /usr/lib/libstdc++.so.6
#8  0x77275113 in std::basic_stringstd::char_traits, std::allocator >::basic_string(char 
const*, std::allocator const&) ()

   from /usr/lib/libstdc++.so.6
#9  0x0048a9fe in cmCPackNSISGenerator::InitializeInternal() ()
#10 0x0047b7d4 in cmCPackGenerator::Initialize(char const*, 
cmMakefile*) ()

#11 0x004745b2 in main ()

--

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] show cpack variables

2012-01-18 Thread Andrea Crotti
cmake --help-variable-list shows me all the global variables defined, 
but how do I
see for example all the possible variables that are defined only when I 
include cpack?


And how do I get the documentation for a function like 
cpack_add_component for example?


Thanks,
Andrea
--

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 -G NSIS

2012-01-18 Thread Andrea Crotti

Thanks for the feedback,
however I tried again with another cmake file, which should actually do 
something.

What I would like to do is to:
- get the project name and a list of packages (just directories) to install
- install them somewhere (now the destination is not set correctly).

Should this work in general?

cmake_minimum_required(VERSION 2.6)
#TODO: should take from the python environment

# setting variables from some known build generated files
# probably we can also pass options directly to CMake
file(STRINGS project_name.txt project_name)
file(STRINGS package_list.txt packages)

project(${project_name})

# include can be used to add more configurations??

# # install all the given automatically
install(
  DIRECTORY ${packages}
  DESTINATION test_ddest
  )

#TODO: how do I get the correct destination for windows?

# now the packages variable should contain something

# this include all the necessary
include(CPack)

But I still get the same error using NSIS (works with TGZ):

CPack: /build/src/cmake-2.8.7/Source/CPack/cpack.cxx:211 Enable Debug
/build/src/cmake-2.8.7/Source/CPack/cmCPackGenerator.cxx:1162 Looking 
for CMAKE_ROOT: /usr/share/cmake-2.8
/build/src/cmake-2.8.7/Source/CPack/cmCPackGenerator.cxx:941 
cmCPackNSISGenerator::SetOption(CMAKE_ROOT, /usr/share/cmake-2.8)
/build/src/cmake-2.8.7/Source/CPack/cmCPackGenerator.cxx:941 
cmCPackNSISGenerator::SetOption(CPACK_GENERATOR, NSIS)
/build/src/cmake-2.8.7/Source/CPack/cmCPackGenerator.cxx:1145 Warning, 
GetOption return NULL for: CPACK_PROJECT_CONFIG_FILE
/build/src/cmake-2.8.7/Source/CPack/cmCPackGenerator.cxx:1145 Warning, 
GetOption return NULL for: CPACK_INCLUDE_TOPLEVEL_DIRECTORY
/build/src/cmake-2.8.7/Source/CPack/cmCPackNSISGenerator.cxx:355 
cmCPackNSISGenerator::Initialize()
/build/src/cmake-2.8.7/Source/CPack/cmCPackGenerator.cxx:1145 Warning, 
GetOption return NULL for: CPACK_TOPLEVEL_DIRECTORY

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid
aborted
--

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 -G NSIS

2012-01-11 Thread Andrea Crotti

On 01/11/2012 12:37 PM, Eric Noulard wrote:

2012/1/11 Andrea Crotti:

Andrea,

Could you please not drop the ML address?
I know the reply-to-sender mode of the list may be annoying but it is
the current setup
so tha tyou need to re-add ML address when answering.



Sorry my mistake, actually I don't need to add manually, just remember 
to press

the right key in Thunderbird..

I just wanted to try the packaging with NSIS, and since it builds exe on 
Linux
it should probably cross compile, but I didn't set anything for that 
myself so I

it might just try to compile for Linux and package in an NSIS package.

Attached the tar.gz with all the files, hopefully



hello.tar.gz
Description: GNU Zip compressed 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

[CMake] cpack -G NSIS

2012-01-10 Thread Andrea Crotti
Trying to run cpack on Linux (archlinux 64 bit) with a working makensis 
environment,

I get the following error (and following stacktrace):

[andrea@precision test_cmake]$ gdb cpack
GNU gdb (GDB) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 


This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /usr/bin/cpack...(no debugging symbols found)...done.
(gdb) run -G NSIS
Starting program: /usr/bin/cpack -G NSIS
[Thread debugging using libthread_db enabled]
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid

Program received signal SIGABRT, Aborted.
0x76c90935 in raise () from /lib/libc.so.6
(gdb) bt
#0  0x76c90935 in raise () from /lib/libc.so.6
#1  0x76c91dab in abort () from /lib/libc.so.6
#2  0x772d11ed in __gnu_cxx::__verbose_terminate_handler() () 
from /usr/lib/libstdc++.so.6

#3  0x772cf396 in ?? () from /usr/lib/libstdc++.so.6
#4  0x772cf3c3 in std::terminate() () from /usr/lib/libstdc++.so.6
#5  0x772cf4be in __cxa_throw () from /usr/lib/libstdc++.so.6
#6  0x7727c1f7 in std::__throw_logic_error(char const*) () from 
/usr/lib/libstdc++.so.6
#7  0x772ba039 in char* std::string::_S_constructconst*>(char const*, char const*, std::allocator const&, 
std::forward_iterator_tag) () from /usr/lib/libstdc++.so.6
#8  0x772ba113 in std::basic_stringstd::char_traits, std::allocator >::basic_string(char 
const*, std::allocator const&) () from /usr/lib/libstdc++.so.6

#9  0x0048a9f6 in cmCPackNSISGenerator::InitializeInternal() ()
#10 0x0047b784 in cmCPackGenerator::Initialize(char const*, 
cmMakefile*) ()

#11 0x00474562 in main ()


Any idea about what it could be?
Thanks,
Andrea
--

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] bash-script-like project

2011-10-30 Thread Andrea Crotti

I rephrase a bit the question which was probably too long :)
So suppose that I just need to do the following things (but in a 
portable way with CMake).


cd org-mode && make
cd tramp && autoreconf -fi && ./configure && make
cd doxymacs && autoreconf -fi && ./configure && make
...

where some of the commands are repeating... what could be a way
to do this with CMake?
--

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] bash-script-like project

2011-10-28 Thread Andrea Crotti
I'm experiment a bit with CMake and now I would like to automate the 
configuration of my Emacs configuration.


In my configuration I have many git submodules and some of them need to 
be actually compiled.


So I just need to do a foreach loop and run for each of them the right 
command, very simple.


So first I did a very fancy thing with functions and macro

macro (execute_in_subdir subdir command)
  execute_process(
COMMAND ${command}
WORKING_DIRECTORY ${subdir}
)
endmacro ()

function (to_master_branch subdir)
  # do I ever need execute_process?
  execute_in_subdir(${subdir} "git checkout master")
endfunction()

set(simple_make make)
#TODO: add the setting for the Emacs output
set(autoconf "autoreconf -fi && ./configure && make")

function (org_compile)
  execute_in_subdir(org_mode ${simple_make})
endfunction()

#TODO: we need to have all these tools
function (doxymacs)
  execute_in_subdir(doxymacs ${autoconf})
endfunction()

function (tramp)
  execute_in_subdir(tramp ${autoconf})
endfunction()

But then I actually wanted a target, and I can't find a way to call 
functions

from the "custom_target".
Then I found out that something like this also works and is much simpler:

add_custom_target(
  org-mode ALL
  cd org-mode && make
)

But what's the best way to do something like this?
--

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] getting all the function names

2011-10-20 Thread Andrea Crotti

Thanks a lot the completion works quite nicely...

Anyway something brutal like this below already would work if someone
is using auto-complete.
The problem is that variables and functions depend on the version, in theory
is possible to get the list of completions with a shell script but
- it might be time-consuming
- and OS-dependent

Any thoughts about this?
After this first attempt it would be good to show the documentation, and 
then

I would be already quite satisfied...

(require 'cmake-mode)
(require 'auto-complete)

(add-hook 'cmake-mode-hook
  '(lambda ()
 (add-to-list 'ac-sources 'cmake-command-list)
 (add-to-list 'ac-sources 'cmake-variable-list)))

;; cmake version 2.8.6
;; see how to generate for other things as well

(setq cmake-command-list
  '("add_custom_command" "add_custom_target" "add_definitions" 
"add_dependencies" "add_executable" "add_library" "add_subdirectory" 
"add_test" "aux_source_directory" "break" "build_command" 
"cmake_minimum_required" "cmake_policy" "configure_file" 
"create_test_sourcelist" "define_property" "else" "elseif" 
"enable_language" "enable_testing" "endforeach" "endfunction" "endif" 
"endmacro" "endwhile" "execute_process" "export" "file" "find_file" 
"find_library" "find_package" "find_path" "find_program" "fltk_wrap_ui" 
"foreach" "function" "get_cmake_property" "get_directory_property" 
"get_filename_component" "get_property" "get_source_file_property" 
"get_target_property" "get_test_property" "if" "include" 
"include_directories" "include_external_msproject" 
"include_regular_expression" "install" "link_directories" "list" 
"load_cache" "load_command" "macro" "mark_as_advanced" "math" "message" 
"option" "project" "qt_wrap_cpp" "qt_wrap_ui" "remove_definitions" 
"return" "separate_arguments" "set" "set_directory_properties" 
"set_property" "set_source_files_properties" "set_target_properties" 
"set_tests_properties" "site_name" "source_group" "string" 
"target_link_libraries" "try_compile" "try_run" "unset" "variable_watch" 
"while" "build_name" "exec_program" "export_library_dependencies" 
"install_files" "install_programs" "install_targets" "link_libraries" 
"make_directory" "output_required_files" "remove" "subdir_depends" 
"subdirs" "use_mangled_mesa" "utility_source" "variable_requires" 
"write_file"))


;; show the documentation of variables too
(setq cmake-variable-list
  '("CMAKE_AR" "CMAKE_ARGC" "CMAKE_ARGV0" "CMAKE_BINARY_DIR" 
"CMAKE_BUILD_TOOL" "CMAKE_CACHEFILE_DIR" "CMAKE_CACHE_MAJOR_VERSION" 
"CMAKE_CACHE_MINOR_VERSION" "CMAKE_CACHE_PATCH_VERSION" 
"CMAKE_CFG_INTDIR" "CMAKE_COMMAND" "CMAKE_CROSSCOMPILING" 
"CMAKE_CTEST_COMMAND" "CMAKE_CURRENT_BINARY_DIR" 
"CMAKE_CURRENT_LIST_DIR" "CMAKE_CURRENT_LIST_FILE" 
"CMAKE_CURRENT_LIST_LINE" "CMAKE_CURRENT_SOURCE_DIR" "CMAKE_DL_LIBS" 
"CMAKE_EDIT_COMMAND" "CMAKE_EXECUTABLE_SUFFIX" "CMAKE_EXTRA_GENERATOR" 
"CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES" "CMAKE_GENERATOR" 
"CMAKE_HOME_DIRECTORY" "CMAKE_IMPORT_LIBRARY_PREFIX" 
"CMAKE_IMPORT_LIBRARY_SUFFIX" "CMAKE_LINK_LIBRARY_SUFFIX" 
"CMAKE_MAJOR_VERSION" "CMAKE_MAKE_PROGRAM" "CMAKE_MINOR_VERSION" 
"CMAKE_PARENT_LIST_FILE" "CMAKE_PATCH_VERSION" "CMAKE_PROJECT_NAME" 
"CMAKE_RANLIB" "CMAKE_ROOT" "CMAKE_SCRIPT_MODE_FILE" 
"CMAKE_SHARED_LIBRARY_PREFIX" "CMAKE_SHARED_LIBRARY_SUFFIX" 
"CMAKE_SHARED_MODULE_PREFIX" "CMAKE_SHARED_MODULE_SUFFIX" 
"CMAKE_SIZEOF_VOID_P" "CMAKE_SKIP_RPATH" "CMAKE_SOURCE_DIR" 
"CMAKE_STANDARD_LIBRARIES" "CMAKE_STATIC_LIBRARY_PREFIX" 
"CMAKE_STATIC_LIBRARY_SUFFIX" "CMAKE_TWEAK_VERSION" 
"CMAKE_USING_VC_FREE_TOOLS" "CMAKE_VERBOSE_MAKEFILE" "CMAKE_VERSION" 
"PROJECT_BINARY_DIR" "PROJECT_NAME" "PROJECT_SOURCE_DIR" "[Project 
name]_BINARY_DIR" "[Project name]_SOURCE_DIR" "BUILD_SHARED_LIBS" 
"CMAKE_BACKWARDS_COMPATIBILITY" "CMAKE_BUILD_TYPE" 
"CMAKE_COLOR_MAKEFILE" "CMAKE_CONFIGURATION_TYPES" 
"CMAKE_DISABLE_FIND_PACKAGE_" "CMAKE_FIND_LIBRARY_PREFIXES" 
"CMAKE_FIND_LIBRARY_SUFFIXES" "CMAKE_IGNORE_PATH" "CMAKE_INCLUDE_PATH" 
"CMAKE_INSTALL_PREFIX" "CMAKE_LIBRARY_PATH" "CMAKE_MFC_FLAG" 
"CMAKE_MODULE_PATH" "CMAKE_NOT_USING_CONFIG_FLAGS" 
"CMAKE_POLICY_DEFAULT_CMP" "CMAKE_PREFIX_PATH" 
"CMAKE_PROGRAM_PATH" "CMAKE_SKIP_INSTALL_ALL_DEPENDENCY" 
"CMAKE_SYSTEM_IGNORE_PATH" "CMAKE_SYSTEM_INCLUDE_PATH" 
"CMAKE_SYSTEM_LIBRARY_PATH" "CMAKE_SYSTEM_PREFIX_PATH" 
"CMAKE_SYSTEM_PROGRAM_PATH" "CMAKE_USER_MAKE_RULES_OVERRIDE" "APPLE" 
"BORLAND" "CMAKE_CL_64" "CMAKE_COMPILER_2005" "CMAKE_HOST_APPLE" 
"CMAKE_HOST_SYSTEM" "CMAKE_HOST_SYSTEM_NAME" 
"CMAKE_HOST_SYSTEM_PROCESSOR" "CMAKE_HOST_SYSTEM_VERSION" 
"CMAKE_HOST_UNIX" "CMAKE_HOST_WIN32" "CMAKE_LIBRARY_ARCHITECTURE" 
"CMAKE_LIBRARY_ARCHITECTURE_REGEX" "CMAKE_OBJECT_PATH_MAX" 
"CMAKE_SYSTEM" "CMAKE_SYSTEM_NAME" "CMAKE_SYSTEM_PROCESSOR" 
"CMAKE_SYSTEM_VERSION" "CYGWIN" "MSVC" "MSVC80" "MSVC_IDE" 
"MSVC_VERSION" "UNIX" "WIN32" "XCODE_VERSION" "CMAKE__POSTFIX" 
"CMAKE_ARCHIVE_OUTPUT_DIRECTORY" "CMAKE_AUTOMOC" 
"CMAKE_BUILD_WITH_INSTALL_RPATH" "CMAKE_DEBUG_POSTFIX" 
"CMAKE_EXE_L

[CMake] getting all the function names

2011-10-20 Thread Andrea Crotti
I'm starting to use cmake and I will have to rely on it pretty much in 
the future.


I'm a bit overwhelmed by the quantity of variables / functions, is there 
a way

to get an automatic list of all of them?

It would be nice to improve the cmake-mode.el (for emacs) to recognise 
as much as possible,

and propose some completion possibly.

Also a nasty grep of the source code that generates some static list 
might be fine...

--

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