Re: [CMake] Wrong LOCATION_CONFIG property value with MACOSX_BUNDLE option set

2009-01-19 Thread Nicolas Desprès
I forgot to mention that setting CMAKE_BUILD_TYPE by either Debug or
Release does not change the problem.

I except the value to be:

/Users/polrop/src/helloworld/_build/helloworld.app/Contents/MacOS/helloworld

Cheers,

On Tue, Jan 20, 2009 at 12:44 AM, Nicolas Desprès
nicolas.desp...@gmail.com wrote:
 Hi there,

 I'm having trouble with LOCATION_CONFIG property when using
 MACOSX_BUNDLE at the same time with cmake version 2.6-patch 3 RC-8.

 The value of the property is the one without the MACOSX_BUNDLE option.

 Here my CMakeLists.txt for an helloworld project:
 ==
 cmake_minimum_required(VERSION 2.6.2)
 #set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/modules)

 project(helloworld)

 add_executable(helloworld MACOSX_BUNDLE
  main.cc
  )
 get_target_property(binary_loc helloworld LOCATION_${CMAKE_BUILD_TYPE})
 message(binary_loc=${binary_loc})
 =

 The output of cmake -G Unix Makefiles .. is:
 =
 [...]
 binary_loc=/Users/polrop/src/helloworld/_build/helloworld
 [...]
 =

 I'm using this cmake:
 http://www.cmake.org/files/v2.6/cmake-2.6.3-RC-8-Darwin-universal.dmg

 Cheers,

 --
 Nicolas Desprès




-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] File modification detection based on content (not timestamp)

2009-01-07 Thread Nicolas Desprès
On Wed, Jan 7, 2009 at 11:14 PM, Robin Vobruba cz...@sunrise.ch wrote:
[...]

Hi Robin,

 We also recently moved from SVN to GIT with our main repository.
 Because of the way GIT works, we would like CMake to check for file
 modification based on file contents, rather then timestamps. This
 would let us use the advantages of GIT to its fullest, save us from
 keeping a separate local repository for each branch, and in general
 make development much more comfortable.
 If you want me to further explain all this, i would be happy to do that.

I'm also using git and cmake and I use ccache to solve this problem.
When building after switching branch if you did not change anything
ccache hits the cache. I know ccache works well with gcc or mingw but
for other compiler I don't know. Maybe it is possible to use it only
with the Makefile generator of cmake.

[...]

-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Symlink problem under linux for runtime search path generation

2008-12-26 Thread Nicolas Desprès
Hi Brad,

Sorry for the delayed answer. It was Christmas break :-)

I've tried your patch and it works :-) Thank you very much. I think
the next step is to open an issue in the bug tracker (I could do it).
Or maybe you can directly commit the patch if you have access.

Thanks again,

-- 
Nico

On Wed, Dec 24, 2008 at 10:39 PM, Brad King brad.k...@kitware.com wrote:
 Nicolas Desprès wrote:

 But in this kind of case, cmake could figure out that these two
 directories are actually the same ?

 There is code to figure that out but it doesn't seem to be working
 for some reason.  My guess is that the recent change to help find
 openbsd-style libraries enabled loading of the directory content
 including that on disk from the directory.  This tricks the code
 into thinking CMake will build the file which skips the same-file test.

 Try the patch below.  If it doesn't work, look in
 Source/cmOrderDirectories.cxx for the function

  cmOrderDirectoriesConstraint::FileMayConflict

 This is the function that checks for a file in a given directory that
 could conflict with a given file in another directory during the runtime
 search.  First it checks whether a conflicting file will be built by
 CMake.  If not, then it looks for a file on disk that is not the same
 (considering symlinks) as the given file.  Can you please add some print
 statements in there to see what it is doing?

 -Brad

 diff --git Source/cmOrderDirectories.cxx Source/cmOrderDirectories.cxx
 index 54f23f7..24b7138 100644
 --- Source/cmOrderDirectories.cxx
 +++ Source/cmOrderDirectories.cxx
 @@ -113,25 +113,22 @@ protected:
  bool cmOrderDirectoriesConstraint::FileMayConflict(std::string const dir,
std::string const name)
  {
 -  // Check if the file will be built by cmake.
 -  std::setcmStdString const files =
 -(this-GlobalGenerator-GetDirectoryContent(dir, false));
 -  if(std::setcmStdString::const_iterator(files.find(name)) !=
 files.end())
 -{
 -return true;
 -}
 -
 -  // Check if the file exists on disk and is not a symlink back to the
 -  // original file.
 +  // Check if the file exists on disk.
   std::string file = dir;
   file += /;
   file += name;
 -  if(cmSystemTools::FileExists(file.c_str(), true) 
 - !cmSystemTools::SameFile(this-FullPath.c_str(), file.c_str()))
 +  if(cmSystemTools::FileExists(file.c_str(), true))
 {
 -return true;
 +// The file conflicts only if it is not the same as the original
 +// file due to a symlink or hardlink.
 +return !cmSystemTools::SameFile(this-FullPath.c_str(), file.c_str());
 }
 -  return false;
 +
 +  // Check if the file will be built by cmake.
 +  std::setcmStdString const files =
 +(this-GlobalGenerator-GetDirectoryContent(dir, false));
 +  std::setcmStdString::const_iterator fi = files.find(name);
 +  return fi != files.end();
  }

  
 //




-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Custom NSIS script

2008-12-26 Thread Nicolas Desprès
On Thu, Dec 25, 2008 at 9:45 PM, Yevgen Muntyan ymunt...@gmail.com wrote:
 Hello and Merry Christmas,

Hello!

Merry Christmas to you too,


 I've got a question: how to use my custom NSIS script with
 CMake+CPack?

You could copy the original NSIS.template.in from cmake sources in
your CMAKE_MODULE_PATH and then patch it to do the same job of your
custom nsis script.

[...]

Cheers,

-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] [CPACK][NSIS] Installing files in My Documents folder

2008-11-05 Thread Nicolas Desprès
Hi cpackers,

I'm looking for a way to tell cpack NSIS generator (version 2.6.2) to
install some files in the users My Documents folder. For instance, I
would like to install sample projects in a directory there. If there
is no way to do so, I will post a request features on the tracker.

Best regards,

-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] [CPACK][NSIS] Installing files in My Documents folder

2008-11-05 Thread Nicolas Desprès
Hi David,

Thanks for the tricks. I've never thought about it before. I'll try to
do my best to make it as much general as I can.

Cheers,

Nico

On Wed, Nov 5, 2008 at 8:46 PM, David Cole [EMAIL PROTECTED] wrote:
 There is a way to do so, but it's not as easy as you'll want it to be... :-)

 You would have to provide your own NSIS.template.in file that does NSIS
 stuff directly. You can start out with a copy of the one in the CMake
 Modules directory, and then put it in a place in your own source tree, and
 then set CMAKE_MODULES_PATH to point to yours first.
 If you could generalize it so that it is based on some CPACK_* variables
 rather than hardcoding into the NSIS.template.in file, feel free to attach a
 patch to a feature request.
 Let us know how you make out!
 Thanks,
 David

 On Wed, Nov 5, 2008 at 8:28 AM, Nicolas Desprès [EMAIL PROTECTED]
 wrote:

 Hi cpackers,

 I'm looking for a way to tell cpack NSIS generator (version 2.6.2) to
 install some files in the users My Documents folder. For instance, I
 would like to install sample projects in a directory there. If there
 is no way to do so, I will post a request features on the tracker.

 Best regards,

 --
 Nicolas Desprès
 ___
 CMake mailing list
 CMake@cmake.org
 http://www.cmake.org/mailman/listinfo/cmake





-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] How to find GetPrerequisites.cmake ?

2008-11-03 Thread Nicolas Desprès
On Mon, Nov 3, 2008 at 8:47 PM, Stephen Collyer
[EMAIL PROTECTED] wrote:
 I'm trying to call this script at install time with
 something like:

 INSTALL(SCRIPT ${CMAKE_MODULE_PATH}/GetPrerequisites.cmake)

 I've tried a variety of variables in place of CMAKE_MODULE_PATH,
 but none of them seem to point to the right location for the
 default Cmake modules. Could someone tell me what I should be
 using in place of CMAKE_MODULE_PATH here ? I'm running with
 cmake 2.6.1.


CMAKE_MODULE_PATH is probably set to your module path instead of the
cmake's module path. That's why the path given to install(SCRIPT)
point to the wrong place.

Try something like that:

configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/install-script.cmake.in
   ${CMAKE_CURRENT_BINARY_DIR}/install-script.cmake
   )
install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/install-script.cmake)

where install-script.cmake.in contains:

include(GetPrerequisites)

Hope this helps,

Cheers,

-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] How to find GetPrerequisites.cmake ?

2008-11-03 Thread Nicolas Desprès
On Mon, Nov 3, 2008 at 9:11 PM, Stephen Collyer
[EMAIL PROTECTED] wrote:
 Nicolas Desprès wrote:
 On Mon, Nov 3, 2008 at 8:47 PM, Stephen Collyer
 [EMAIL PROTECTED] wrote:
 I'm trying to call this script at install time with
 something like:

 INSTALL(SCRIPT ${CMAKE_MODULE_PATH}/GetPrerequisites.cmake)

 I've tried a variety of variables in place of CMAKE_MODULE_PATH,
 but none of them seem to point to the right location for the
 default Cmake modules. Could someone tell me what I should be
 using in place of CMAKE_MODULE_PATH here ? I'm running with
 cmake 2.6.1.


 CMAKE_MODULE_PATH is probably set to your module path instead of the
 cmake's module path. That's why the path given to install(SCRIPT)
 point to the wrong place.

 I've set CMAKE_MODULE_PATH like this:

 SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules
 ${CMAKE_MODULE_PATH})


You are prepending ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules to the
original value of CMAKE_MODULE_PATH, right?
It looks weird to me. I think

SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)

is what you need.

 Shouldn't that allow cmake to search on the augmented path,
 including the original default path ?

 Try something like that:

 configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/install-script.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/install-script.cmake
)
 install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/install-script.cmake)

 where install-script.cmake.in contains:

 include(GetPrerequisites)

 Can you explain how that include works - how will it find
 GetPrerequisites, if my earlier attempts failed ?


As explain here:

http://www.cmake.org/cmake/help/cmake2.6docs.html#command:include

the include command do the file look up for you if you give the name
of a module. First searching in your custom module path and then in
the cmake's module path.

Cheers,

-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Get parse error with cmake -C

2008-10-30 Thread Nicolas Desprès
Hi all,

I'm trying cmake -C with cmake-2.6.3-RC-1 and I get the following output:

$ cmake -C ../_build-r/CMakeCache.txt
loading initial cache file ../_build-r/CMakeCache.txt
CMake Error: Error in cmake code at
/home/despres/src/urbi-lab/_build-r/CMakeCache.txt:17:
Parse error.  Expected a command name, got unquoted argument with text //No.
CMake Error: Error processing file:../_build-r/CMakeCache.txt

Note, that the CMakeCache.txt file I'm using has been generated by a
previous call to cmake.

Obviously, cmake does not parse C++ style comment used in CMakeCache.txt.

Maybe I'm not using the -C option properly...

Cheers,

-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] How is GetPreRequisites used?

2008-10-29 Thread Nicolas Desprès
On linux I ship all .so files (with few exception) listed by ldd in a
given directory. I also ship a wrapper script that add this directory
to LD_LIBRARY_PATH prior to execute the executable.

Here the script:

#!/bin/sh

# This script overload the dynamic library path.

# Resolve links referring to me.
if test -L $0; then
exec $(readlink -f $0)
fi

appname=$(basename $0 | sed s,\.sh$,,)
dirname=$(dirname $0)
case $dirname in
/*)
# nothing to do
;;
*)
dirname=$PWD/$dirname
;;
esac
paths=$dirname/../@EXTRA_LIBRARIES_DIR@
LD_LIBRARY_PATH=$paths
export LD_LIBRARY_PATH
DYLD_LIBRARY_PATH=$paths
export DYLD_LIBRARY_PATH
$dirname/$appname $*

and here the list of .so that I do not ship:

  set(DLDEP_UNIX_EXCLUSION_LIST
^libc.so
^libdl.so
^libpthread.* # Fedora 9
)

Note that, when you ship binary package for Linux you have to compile
your project on a system with the oldest GLIBC you want to support.
For instance package built on Ubuntu (glibc 2.4) won't work on Debian
stable (glibc 2.0). I build my package on Debian and I have tested it
on various freshly installed Linux distribution and it works fine.

Cheers,

On Tue, Oct 28, 2008 at 9:47 PM, David Cole [EMAIL PROTECTED] wrote:
 You are not being stupid. It does need to be used at installation time to be
 useful.
 The intent is to analyze a given built executable to determine the required
 set of (possibly 3rd-party, possibly built elsewhere on the build machine)
 libraries that it needs to run. Then, given that set, you need to make sure
 that you have install rules to cover all of those libraries.

 The first working example of its use is in the ParaView code base where it
 is used to copy libraries into ParaView's Mac bundle application. It is used
 in conjunction with BundleUtilities.cmake to fix up the bundle app so that
 it is standalone and contains all of its referenced libraries in the bundle
 directory structure. Then the bundle can be copied to any directory or to
 another Mac and it should all just work.
 Having said that, there is more work to be done to make this a genuinely
 easy to use feature of CMake. I envision being able to do the same thing at
 make install time for Linux and Win32 builds, but according to the
 conventions of those platforms. Dlls copied into the same dir with the exe
 on Win32 and whatever's appropriate on Linux builds... (Feel free to make
 suggestions.)
 So... ideally it would all just work automatically and all you would have to
 do in CMake is add an install rule for your executable and call a
 post-install script that copies/fixes up libraries appropriately in a
 platform-independent manner.
 Thanks for asking questions / contributing to the discussion / improving
 this development feature of CMake.
   David

 On Tue, Oct 28, 2008 at 7:36 AM, Mike Arthur [EMAIL PROTECTED] wrote:

 Perhaps I'm just being stupid but I can't see how this can be used as it
 needs
 to be called at installation time and I'm not aware that modules can be?

 Does anyone have a working example of how to install its outputted
 libraries?
 --
 Cheers,
 Mike Arthur
 http://mikearthur.co.uk/
 ___
 CMake mailing list
 CMake@cmake.org
 http://www.cmake.org/mailman/listinfo/cmake


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




-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] [CPACK][NSIS] vendor name used in the install directory

2008-10-23 Thread Nicolas Desprès
Hi all,

I would like to have the default install path in my installer to be
something like:

c:\Program Files\Vendor\ProgName x.y

But the InstallDir in the NSIS template is set to something like that:

InstallDir [EMAIL PROTECTED]@

Hacking CPACK_PACKAGE_INSTALL_DIRECTORY to be something like
Vendor\ProgName x.y leads to an error on Vista since it claims that
my program has not been installed properly (something similar to
http://www.cmake.org/pipermail/cmake/2008-August/023459.html)

I attach a patch that what I want.

Best regards,

-- 
Nicolas Desprès


vendor-dir.patch
Description: Binary data
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

[CMake] [CPACK][NSIS] How to set default start menu directory

2008-10-23 Thread Nicolas Desprès
Hi all,

I would like to have a default start menu directory different than the
default install directory.
I know I can change the default install directory by setting
CPACK_PACKAGE_INSTALL_DIRECTORY, but I would like to have an
equivalent for the start menu.

I have also searched the NSIS.template.in in the CVS but I've found nothing.

Any help?

Best regards,

-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Configuring .bat file with native path under windows

2008-10-14 Thread Nicolas Desprès
On Tue, Oct 14, 2008 at 4:48 PM, Andy Lego [EMAIL PROTECTED] wrote:
 Hi,

 Look at FILE and STRING commands.

Thanks. That's what I did.

Here the wrapper I have written:

  # Wrapper around 'configure_file'
  # _in_: the input file
  # _out_ the output file
  # OPTIONS: the list of options to give to 'configure_file'.
  # VARIABLES: the list of variables to convert. The result is stored in a
  #variable suffixed by '_in'. Use this variable in your template.
  function(configure_file_with_native_paths in out)

parse_arguments(
  ${in}
  OPTIONS;VARIABLES;
  
  ${ARGN})

foreach(var ${${in}_VARIABLES})
  string(REPLACE / \\ ${var}_in ${${var}})
endforeach(var)

configure_file(${in} ${out} ${${in}_OPTIONS})
  endfunction(configure_file_with_native_paths)

Cheers,

Nico


 Andy

 On Tue, Oct 14, 2008 at 7:29 AM, Nicolas Desprès [EMAIL PROTECTED]
 wrote:

 Hi everyone,

 I'm using cmake 2.6.2 for win32 and I'm trying to configure a .bat
 file. I use a couple of cmake variable in my .bat.in template such as
 CMAKE_CURRENT_BINARY_DIR. The problem is that I have to convert every
 variable used in the template and containing a cmake path to a native
 path before to configure the file. Currently, I'm using a wrapper
 around configure_file to do the tricks but it is very cumbersome.

 Does any one know a better way to deal with this issue?
 Is there any chance to have an option to configure_file that do the
 tricks?

 Best regards,

 --
 Nicolas Desprès
 ___
 CMake mailing list
 CMake@cmake.org
 http://www.cmake.org/mailman/listinfo/cmake



 --
 Lets bike the world together
 http://legoandy.com




-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Configuring .bat file with native path under windows

2008-10-14 Thread Nicolas Desprès
Hi everyone,

I'm using cmake 2.6.2 for win32 and I'm trying to configure a .bat
file. I use a couple of cmake variable in my .bat.in template such as
CMAKE_CURRENT_BINARY_DIR. The problem is that I have to convert every
variable used in the template and containing a cmake path to a native
path before to configure the file. Currently, I'm using a wrapper
around configure_file to do the tricks but it is very cumbersome.

Does any one know a better way to deal with this issue?
Is there any chance to have an option to configure_file that do the tricks?

Best regards,

-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] FILE(INSTALL does not follow symbolic links

2008-10-02 Thread Nicolas Desprès
Hi there,

I'm using cmake 2.6.2 and I'm using FILE(INSTALL ...) to install
dependent dynamic libraries in script called by INSTALL(SCRIPT ...).

Here my scenario:

$ cd /tmp/test
$ ls -l
total 4.0K
lrwxrwxrwx 1 despres despres 11 Oct  2 16:25 libfoo.so - libfoo.so.1
-rw-r--r-- 1 despres despres  0 Oct  2 16:25 libfoo.so.1
-rw-r--r-- 1 despres despres 67 Oct  2 16:25 test.cmake
$ cat test.cmake
file(INSTALL DESTINATION /tmp/install TYPE FILE FILES ./libfoo.so)
$ cmake -P test.cmake
-- Installing: /tmp/install/libfoo.so
$ ls -l /tmp/install
total 0
lrwxrwxrwx 1 despres despres 11 Oct  2 16:26 libfoo.so - libfoo.so.1
$

I have read the source of the file command in cmFileCommand.cxx
(because the subcommand INSTALL is not documented in --help-command
file), but I couldn't find a way to tell the FILE(INSTALL command to
follow symbolic links.

Of course I could do the copy by hand using cmake -E copy but I would
like to have a consistent output with the -- Installing:  printed
by cmake and the -- Up-to-date stuff.

As a workaround, how can I write a cmake script that retrieve the name
of the file pointed by a symbolic link?

-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] -DNDEBUG passed to Qt moc compiler

2008-09-03 Thread Nicolas Desprès
Hi,

I'm using cmake 2.6.0 and Qt-4.4.1 commercial on windows. While trying
to compile my Qt application in release mode using
-DCMAKE_BUILD_TYPE=Release, I met a problem with conditional Qt slots.
In one of my header, I have something like that:

#ifndef NDEBUG
  void mySlot()
#endif

In debug mode, there is no problem. But in release mode my C++
compiler complains that it cannot find the identifier mySlot  when
it compiles the source file generated by Qt's moc compiler.

Adding:
 -D
 NDEBUG

in the parameter file given to moc in the build tree fixed the issue.

I suggest that FindQt4 module could handle such issue automatically.

Cheers,

-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] find_library first searches for static libraries

2008-07-02 Thread Nicolas Desprès
On Wed, Jul 2, 2008 at 4:25 AM, Philip Lowman [EMAIL PROTECTED] wrote:
 On Tue, Jul 1, 2008 at 2:37 PM, Nicolas Desprès [EMAIL PROTECTED]
 wrote:

 Hi list,

 I'm looking for a way to say to find_library (cmake 2.6.0) that I
 prefer static libraries rather than shared libraries. It seems that
 there is no option to do. The only work around I found is the
 following but it is not portable obviously.

 set(CMAKE_FIND_LIBRARY_SUFFIXES .a;.so)
 find_library(OPENSSL_LIBRARY ssl)

 2.6.0 checks the library names specified to find_library() as filenames
 first so you could do something like this to ensure that on a Unix build it
 would pick up the static library first:

 find_library(OPENSSL_LIBRARY libssl.a)
 find_library(OPENSSL_LIBRARY ssl)
 or
 find_library(OPENSSL_LIBRARY NAMES libssl.a ssl)


Thanks for your answer Philip, but this is still not portable and we
have to duplicate the code that cmake's author already wrote to
portably set CMAKE_FIND_LIBRARY_SUFFIXES.

 Unfortunately this only works for CMake code that you can control.  If one
 had to use a CMake module to add an external dependency your idea would seem
 to be the only viable option without modifying the module code itself.


Yes. If I want to rewrite OpenSSL module so that it could be used like this:

find_package(OpenSSL REQUIRED)
set(OPENSSL_USE_STATIC 1)
include(${OPENSSL_USE_FILE})

I will still have to do either your suggestion or mine but they
duplicate cmake's code.

Cheers,

-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] find_library first searches for static libraries

2008-07-01 Thread Nicolas Desprès
Hi list,

I'm looking for a way to say to find_library (cmake 2.6.0) that I
prefer static libraries rather than shared libraries. It seems that
there is no option to do. The only work around I found is the
following but it is not portable obviously.

set(CMAKE_FIND_LIBRARY_SUFFIXES .a;.so)
find_library(OPENSSL_LIBRARY ssl)

If someone has a better solution, please fill free to tell me.

Thx in advance,

-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake 2.6.0 Beta ready for testing!

2008-04-02 Thread Nicolas Desprès
On Wed, Apr 2, 2008 at 10:25 PM, Bill Hoffman [EMAIL PROTECTED] wrote:
[...]
  I suppose we could.  I like the installer as it prompts the user for the
 license, and setting up the command line stuff.  Also, I have something
 working automatically with cpack.


I have installed Firefox recently and the license popup when the dmg
is opened. Then, you only have to drag and drop the icon in the finder
to your Applications directory. I would love that DMG cpack generator
could do that.

-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Texinfo file configuration.

2008-03-28 Thread Nicolas Desprès
Hi list,

I have a peace of code that I would like to share with you. When
trying to configure a texinfo file such as:

@set myemail ${MYEMAIL}

using CONFIGURE_FILE, I faced a character escaping proble. The
variable MYEMAIL is set to [EMAIL PROTECTED] but in texinfo, since @ is the
command prefix I have to escape the one in the email address like
this: foo@@bar.com. The ESCAPE_QUOTES option of CONFIGURE_FILE doesn't
help for this. May be, we need a way to specify a custom list of
character to escape to CONFIGURE_FILE.

Thus, I wrote this function that do the job by collecting all the
variables included in the input file, then escapes the @ and finally
ask to CONFIGURE_FILE to configure the file.

# - Configure texinfo file
# This function is very similar to configure_file except that it takes care to
# escape @ characters. Prefers to use ${var} expansion form instead of @var@

if(NOT COMMAND CONFIGURE_TEXINFO)

function(CONFIGURE_TEXINFO input output)
  # Collect all variables ${var} in the file.
  file(READ ${input} inbuf)
  # We write [{] instead of { to avoid pattern like ${..} that cmake tries to
  # expand.
  string(REGEX MATCHALL \\$[{]([^}]+)} varlist ${inbuf})
  # Removes $, { and } from the variables list.
  set(tmpvarlist )
  foreach(i ${varlist})
string(REGEX REPLACE [$}{]  tmp ${i})
list(APPEND tmpvarlist ${tmp})
  endforeach(i)
  set(varlist ${tmpvarlist})
  set(tmpvarlist)
  # Save and escape variables.
  foreach(i ${varlist})
set(__configure_textinfo_copy__${i} ${${i}})
string(REGEX REPLACE @([EMAIL PROTECTED]) @@\\1 tmp ${${i}})
set(${i} ${tmp})
  endforeach(i)
  # Configure the file.
  configure_file(${input} ${output} ESCAPE_QUOTES)
  # Restore variables and destroy backup.
  foreach(i ${varlist})
set(${i} ${__configure_textinfo_copy__${i}})
set(__configure_textinfo_copy__${i})
  endforeach(i)
  message(STATUS Configure '${input}' to '${output}')
endfunction(CONFIGURE_TEXINFO)

endif(NOT COMMAND CONFIGURE_TEXINFO)

Best regards,

-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] [CPack] Generated package description file.

2008-03-28 Thread Nicolas Desprès
Hi,

In my project, I generate the readme file that I use as package
description file in cpack. In my top CMakeLists.txt I have:

set(CPACK_PACKAGE_DESCRIPTION_FILE ${README_FILE})
include(CPack)

When I run cmake, it complains that my file does not exist... Can't we
disable this test? Is there any work around except writting my own
CPack.cmake?

Best regards,

-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] [CPack] Generated package description file.

2008-03-28 Thread Nicolas Desprès
On Fri, Mar 28, 2008 at 4:02 PM, Bill Hoffman [EMAIL PROTECTED] wrote:

 Nicolas Desprès wrote:
   Hi,
  
   In my project, I generate the readme file that I use as package
   description file in cpack. In my top CMakeLists.txt I have:
  
   set(CPACK_PACKAGE_DESCRIPTION_FILE ${README_FILE})
   include(CPack)
  
   When I run cmake, it complains that my file does not exist... Can't we
   disable this test? Is there any work around except writting my own
   CPack.cmake?
  

  I don't get it, why does the file not exist?


Sorry, for being unclear.

It doesn't exists at configuration time because I build it at build
time. It gets built when the users start make not cmake. I use
ADD_CUSTOM_COMMAND to build it.

Cheers,

-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] [CPack] Generated package description file.

2008-03-28 Thread Nicolas Desprès
On Fri, Mar 28, 2008 at 4:42 PM, Bill Hoffman [EMAIL PROTECTED] wrote:

[...]
  OK, I see the problem.   Can you create a bug report for this.  I guess
  that could be pushed to cpack time, and not cmake time.


Done.

BTW, I found a work around which is to use execute_process instead of
add_custom_command.

-- 
Nicolas Desprès
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


<    1   2   3