[CMake] install question

2009-03-10 Thread Sharon Melamed
Hi,

 

My main CmakeList.txt file look like this:

 

cmake_minimum_required (VERSION 2.6)

project (vos)

 

add_subdirectory (system  BUILD)

add_subdirectory (osal BUILD)

add_subdirectory (logger BUILD)

add_subdirectory (loggerConfigTool BUILD)

add_subdirectory (voltSyslogd BUILD)

add_subdirectory (chassis BUILD)

add_subdirectory (eventHandler BUILD)

 

in the system subdirectory the CmakeList.txt file look like this:

 

set(main_SRCS main.cpp)

 

include_directories(${vos_SOURCE_DIR}/include)

link_directories(${vos_SOURCE_DIR}/BUILD)

 

add_executable(vos ${main_SRCS})

 

target_link_libraries(vos rt pthread logger osal)

install(TARGETS vos RUNTIME DESTINATION /bin )

 

After running cmake the make install command builds the vos executable
but does not install it.

I looked in install_manifest.txt and it was empty.

 

Any ideas what I'm doing wrong?

 

Thanks.

 

Sharon.

___
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] install question

2009-03-10 Thread ankit jain
-- Forwarded message --
From: ankit jain ankitgu...@gmail.com
Date: 2009/3/10
Subject: Re: [CMake] install question
To: Sharon Melamed shar...@voltaire.com



2009/3/10 Sharon Melamed shar...@voltaire.com

Hi,



 My main CmakeList.txt file look like this:



 cmake_minimum_required (VERSION 2.6)

 project (vos)



 add_subdirectory (system  BUILD)

 add_subdirectory (osal BUILD)

 add_subdirectory (logger BUILD)

 add_subdirectory (loggerConfigTool BUILD)

 add_subdirectory (voltSyslogd BUILD)

 add_subdirectory (chassis BUILD)

 add_subdirectory (eventHandler BUILD)



 in the system subdirectory the CmakeList.txt file look like this:



 set(main_SRCS main.cpp)



 include_directories(${vos_SOURCE_DIR}/include)

 link_directories(${vos_SOURCE_DIR}/BUILD)



 add_executable(vos ${main_SRCS})



 target_link_libraries(vos rt pthread logger osal)

 install(TARGETS vos RUNTIME DESTINATION /bin )



 After running cmake the make install command builds the vos executable but
 does not install it.

 I looked in install_manifest.txt and it was empty.



 Any ideas what I’m doing wrong?



 Thanks.



 Sharon.
 Hi,


I too facing the same problem. i too dont find those executables in the
destination folder specified. i dotn understand why they are not installing.

Ankit


 ___
 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

___
Powered by www.kitware.com

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

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

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

Re: [CMake] How to set CPACK_SOURCE_IGNORE_FILES to remove all source code?

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

 My mistake, I've cut the wrong part, sorry about that

 CPACK_SOURCE_FILES was meant to be CPACK_IGNORE_FILES

 you want to ignore files in BINARY package so the var to use is
 CPACK_IGNORE_FILES

 when you want to ignore files in a SOURCE pacakge then you should use
 CPACK_SOURCE_IGNORE_FILES

I should stop writing totally wrong advices for this for a while.
I did answer without testing because I thought I already did it.

Now that I took time to test, I'm now pretty sure my memory was flawed.
I think you may not ignore files in a BINARY packager, you may seem
to only be able to do it for a SOURCE one.

The binary CPack packager do take *all* what is installed by
INSTALL(...) command
(put aside the COMPONENT stuff which enables you to select part of it
 when the CPack generator supports it).

Thus I would say that if you want to filter something put by INSTALL
you'll have to:
  - avoid installing it alltogether
  - file a feature request to CPack


Now I'm gonna avoid fast-answer for a while because my last 2 were
totally wrong
sorry about that.

-- 
Erk
___
Powered by www.kitware.com

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

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

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


Re: [CMake] How to set CPACK_SOURCE_IGNORE_FILES to remove all source code?

2009-03-10 Thread Jesper Eskilson

Eric Noulard wrote:


I should stop writing totally wrong advices for this for a while.


Let us know when you're going to start giving wrong advice again. Just 
so we know. ;-)


--
/Jesper

___
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] warning safe linker search path

2009-03-10 Thread John Biddiscombe

Brad

BTW, the only reason CMake needs to order the directories is because
of compatibility with how CMake 2.4 ordered them.  You must be setting
CMP0003 to OLD.  If you set it to NEW you should never see this warning.


That seems to have solved the problem.

Thanks

JB

(I have CMake policy statements littered through my files, but I have no 
idea what they do or why they are there. I think at some point CMake 
tells you, use CMAKE_POLICY(blah) to make this warning go away, so you 
add it blindly, then it gradually becomes obsolete)


--
John Biddiscombe,email:biddisco @ cscs.ch
http://www.cscs.ch/
CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
Via Cantonale, 6928 Manno, Switzerland  | Fax:  +41 (91) 610.82.82


___
Powered by www.kitware.com

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

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

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


Re: [CMake] Setting environment variables prebuild

2009-03-10 Thread Kito Berg-Taylor
Upon further consideration, I think fixing the codeblocks project file
is probably too specific of a fix. After all, the only way to come
across this issue is if you are cross-compiling, in which case you need
to write a toolchain file anyway. The problem here, IMHO, is that there
are insufficient capabilities for setting up the build environment when
cross-compiling. It should be possible to setup all the necessary
environment conditions in the toolchain.cmake file, so that I can have
different environment variables depending on what I'm cross-compiling
for.

The following patch to the underlying Makefile solves the problem for
all IDEs that build using UNIX makefiles:


--- Makefile 2009-03-10 10:02:10.250079759 +0100
+++ Makefile_QNX 2009-03-10 10:31:20.359078662 +0100
@@ -29,6 +29,12 @@

#=
# Set environment variables for the build.

+# QNX Environment Variables
+QNX_HOST := /home/kito/work/qnx640/host/linux/x86
+QNX_TARGET := /home/kito/work/qnx640/target/qnx6
+QNX_CONFIGURATION := /etc/qnx
+Path := ${Path};/home/kito/work/qnx640/host/linux/x86/usr/bin
+
# The shell in which to execute make rules.
SHELL = /bin/sh

I'm sure there are similar solutions that would apply for the other
build systems. Being able to set a series of environment variables and
their values in the toolchain file would be a much more general solution
that adjusting the individual project files. For example, on the
machines I have here, not all of them even have QCC as a compiler option
in Codeblocks. Some of them have QCC, but also require changes to the
Path environment variable before they will compile cmake projects for
qnx. However, the above patch works on all of the machines I've tested,
in both Codeblocks and Eclipse. (Of course those paths need to be
correct for each machine, but since my toolchain file knows the value of
these variables, that shouldn't be a big problem).

-kito

On Tue, 2009-03-10 at 03:11 -0400, cmake-requ...@cmake.org wrote:

 Date: Tue, 10 Mar 2009 01:00:22 +0100
 From: Alexander Neundorf a.neundorf-w...@gmx.net
 Subject: Re: [CMake] Setting environment variables prebuild
 To: cmake@cmake.org
 Cc: Kito Berg-Taylor kito.berg-tay...@dlr.de
 Message-ID: 200903100100.22277.a.neundorf-w...@gmx.net
 Content-Type: text/plain;  charset=iso-8859-1
 
 On Tuesday 03 March 2009, Kito Berg-Taylor wrote:
  Hello all,
 
  I'm very new to cmake, so excuse me if I'm missing some obvious
  functionality that cmake already has.
 
  I am building a project using a QNX cross-compile toolchain that I
  setup. For those not familiar with the QNX toolchain, the QNX compiler
  qcc is a wrapper around gcc that's mostly the same but has a few
  peculiarities. Of particular relevance, it requires QNX_HOST and
  QNX_TARGET (and QNX_CONFIGURATION on win32) to be set as environment
  variables. I have setup my toolchain_qnx640.cmake file to automatically
  locate the $QNX_HOST (...etc) path and then set it as follows:
 
  SET( ENV{QNX_HOST} ${PATH_TO_QNX_HOST} )
 
  This allows the configure/generate steps to work correctly, however when
  I go to build the project unless these variables are set separately in
  the environment, the build will fail. In other words, CMake is not
  setting this variable as part of the build (although it did set them
  when it went to test the compiler, because qcc passed the compiler
  test).
 
  When building from UNIX Makefiles I can set the variable at the console
  and then make and it will work. When using Codeblocks projects if (and
  only if) I change the project compiler to QCC Compiler it will also
  build, since Codeblocks knows how to setup the environment for QCC. I
  can't find a way to make QCC the default compiler when generating the
  project (otherwise this will get overridden every time the project is
  re-generated). 
 
 You mean the generated project file for CodeBlocks should say that the 
 compiler is qcc, but it doesn't ?
 Can you please send my a codeblocks project file for a hello-world style 
 application using qcc, so I can have a look what it should contain ?
 
  Eclipse CDT projects similarly won't build, unless I mess
  around with the project settings (new to eclipse, haven't found the
  right settings yet).
 
 Same here.
 
 Alex
___
Powered by www.kitware.com

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

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

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

Re: [CMake] install question

2009-03-10 Thread ankit jain
2009/3/10 Sharon Melamed shar...@voltaire.com

  Hi,



 My main CmakeList.txt file look like this:



 cmake_minimum_required (VERSION 2.6)

 project (vos)



 add_subdirectory (system  BUILD)

 add_subdirectory (osal BUILD)

 add_subdirectory (logger BUILD)

 add_subdirectory (loggerConfigTool BUILD)

 add_subdirectory (voltSyslogd BUILD)

 add_subdirectory (chassis BUILD)

 add_subdirectory (eventHandler BUILD)



 in the system subdirectory the CmakeList.txt file look like this:



 set(main_SRCS main.cpp)



 include_directories(${vos_SOURCE_DIR}/include)

 link_directories(${vos_SOURCE_DIR}/BUILD)



 add_executable(vos ${main_SRCS})



 target_link_libraries(vos rt pthread logger osal)

 install(TARGETS vos RUNTIME DESTINATION /bin )



 After running cmake the make install command builds the vos executable but
 does not install it.

 I looked in install_manifest.txt and it was empty.



 Any ideas what I’m doing wrong?



 Thanks.



 Sharon.
 It woking now for me..

Check your CMAKE_INSTALL_PREFIX path whatever u have set. By default on
linux it is set to /usr/local but if u want it to something else you can set
it in CMakeCache.txt file.

Hope it will work ..

Ankit


 ___
 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

___
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] warning safe linker search path

2009-03-10 Thread Brad King

John Biddiscombe wrote:

Brad

BTW, the only reason CMake needs to order the directories is because
of compatibility with how CMake 2.4 ordered them.  You must be setting
CMP0003 to OLD.  If you set it to NEW you should never see this warning.


That seems to have solved the problem.


On second thought, I think there can still be cases where the warning will
appear with CMP0003 set to NEW, but not this one.

(I have CMake policy statements littered through my files, but I have no 
idea what they do or why they are there. I think at some point CMake 
tells you, use CMAKE_POLICY(blah) to make this warning go away, so you 
add it blindly, then it gradually becomes obsolete)


The messages also point you at documentation which explains what is going on.
Only the CMP0003 warning tells you what code to put in, and I only did that
because so many people complained about the warning text.  Any project that
does cmake_minimum_required(VERSION 2.6) will never see CMP0003 again
(assuming there are no places the command is invoked with 2.4).

-Brad

___
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] Joining multiple directories into one

2009-03-10 Thread Brad King

Jussi Pakkanen wrote:

On Mon, Mar 9, 2009 at 4:03 PM, Brad King brad.k...@kitware.com wrote:

do not perform very well in the VS IDE (this is not CMake, but the VS
IDE implementation).  The definitions will work, but they cause the IDE
to use a separate invocation of the compiler for every source file
instead of sharing one invocation for many sources in a target, which
leads to slower builds.


There are two distinct settings so in theory two compiler invocations
should be enough.


Unfortunately VS is not that smart.  As soon as the project file contains
any per-source configuration settings it will launch compilation of that
source in its own process.

 I think that the current build system spawns a new

compiler process for every file (it is a custom thing based on Perl
and dmake) so this should not produce any additional penalty.


The difference is that VS will do it without parallelism within a target.
They don't usually need it because typical projects share settings among
all sources and compile them all in one process.  Parallelism only exists
across targets (more than one independent target at once).

Again, this is only in the VS IDE project files.  CMake's Makefile generator
produces highly parallel systems.  Avoiding per-source flags is still
cleaner though.

-Brad
___
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] Cross Compilang and NSIS

2009-03-10 Thread Andreas Schneider
On Monday 09 March 2009 12:01:23 Hendrik Sattler wrote:
 Andreas Schneider schrieb:
  My problem is that cmake thinks that it is a windows version...

 No, it still knows that it runs on Linux and can use the native tools if
 you tell it so in the toolchain file.

Strange.


  So you successfully *cross compile* with mingw for windows under linux
  and successfully create NSIS installers with cpack?

 Yes, IIRC, doing that to cross-compile openobex for win32 using the
 mingw packages on a Debian host.
 That depends on your setting of CMAKE_FIND_ROOT_PATH_MODE_PROGRAM to
 NEVER in the toolchain file.

It is set to NEVER. maybe I have a bug in my CPackConfig.cmake could you show 
me yours?


-- andreas

-- 
cybernetic synapses - http://www.cynapses.org/


signature.asc
Description: This is a digitally signed message 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] How to set CPACK_SOURCE_IGNORE_FILES to remove all source code?

2009-03-10 Thread David Fitzpatrick
Thanks again Eric for the update... I pulled the cpack source code and 
started looking through it and came to the same conclusion. Additionally 
I ran into a message on the boards about the PACKAGE_SOURCE not being 
included in the cmake build. Everything started making sense shortly 
after I discovered the other type of build (binary versus source CPack 
projects) and I have now added the necessary code to not install source 
if desired.


-D

Eric Noulard wrote:

2009/3/9 Eric Noulard eric.noul...@gmail.com:
  

My mistake, I've cut the wrong part, sorry about that

CPACK_SOURCE_FILES was meant to be CPACK_IGNORE_FILES

you want to ignore files in BINARY package so the var to use is
CPACK_IGNORE_FILES

when you want to ignore files in a SOURCE pacakge then you should use
CPACK_SOURCE_IGNORE_FILES



I should stop writing totally wrong advices for this for a while.
I did answer without testing because I thought I already did it.

Now that I took time to test, I'm now pretty sure my memory was flawed.
I think you may not ignore files in a BINARY packager, you may seem
to only be able to do it for a SOURCE one.

The binary CPack packager do take *all* what is installed by
INSTALL(...) command
(put aside the COMPONENT stuff which enables you to select part of it
 when the CPack generator supports it).

Thus I would say that if you want to filter something put by INSTALL
you'll have to:
  - avoid installing it alltogether
  - file a feature request to CPack


Now I'm gonna avoid fast-answer for a while because my last 2 were
totally wrong
sorry about 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


[CMake] Question about if/else in Cmake

2009-03-10 Thread Sascha 'saigkill' Manns
Hello Mates,

i'm Sascha Manns from Germany. I'm new to the List, and i hope that i 
can learn more about CMake.
Actually i'm building for the openSUSE Build Service an Package called 
freeremote.

The Package has the following in the CMakeLists.txt:
SET( CONFIGFILE_PATH ${PREFIX}/etc/freeremoted CACHE PATH Path find 
config file FORCE )
SET( MODULEFILE_PATH ${PREFIX}/lib/freeremoted CACHE PATH Path find 
module file FORCE )

That means, that the Package is builded into the Userspace.

So i modified it to use /etc and /usr/lib as Destination.

SET( CONFIGFILE_PATH /etc/freeremoted CACHE PATH Path find config 
file FORCE )
SET( MODULEFILE_PATH /usr/lib CACHE PATH Path find module file FORCE)

But this only runs for i586/i686 but not for x86_64.

It is possible to make:


ifarch ix86
SET(CONFIGFILE_PATH /usr/lib)
else
SET(CONFIGFILE_PATH /usr/lib64)
endif
-- 
Sincereley yours

Sascha Manns
openSUSE Marketing Team
openSUSE Build Service
Web: http://saschamanns.gulli.to
Project-Blog: http://lizards.opensuse.org/author/saigkill
Private-Blog: http://saschasbacktrace.blogspot.com

DISCLAIMER: Please note that in accordance with the German law on data 
retention, 
information on every electronic information exchange with me is retained 
for a period of six months. 
http://www.vorratsdatenspeicherung.de
http://www.ccc.de

___
Powered by www.kitware.com

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

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

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


Re: [CMake] Question about if/else in Cmake

2009-03-10 Thread Alexander Neundorf
On Tuesday 10 March 2009, Sascha 'saigkill' Manns wrote:
 Hello Mates,

 i'm Sascha Manns from Germany. I'm new to the List, and i hope that i
 can learn more about CMake.
 Actually i'm building for the openSUSE Build Service an Package called
 freeremote.

 The Package has the following in the CMakeLists.txt:
 SET( CONFIGFILE_PATH ${PREFIX}/etc/freeremoted CACHE PATH Path find
 config file FORCE )
 SET( MODULEFILE_PATH ${PREFIX}/lib/freeremoted CACHE PATH Path find
 module file FORCE )

 That means, that the Package is builded into the Userspace.

 So i modified it to use /etc and /usr/lib as Destination.

 SET( CONFIGFILE_PATH /etc/freeremoted CACHE PATH Path find config
 file FORCE )
 SET( MODULEFILE_PATH /usr/lib CACHE PATH Path find module file FORCE)

 But this only runs for i586/i686 but not for x86_64.

 It is possible to make:



There are different things you can do:

You can test the variable ${CMAKE_SIZEOF_VOID_P}, if it is equal to 8, you are 
on a 64 bit system and may want to use lib64.

Or you could test whether e.g. /usr/lib64 exists, and if so, also use lib64.

Or you can just make it an option:

option(USE_LIB64_DIR Enable this option to use lib64 instead of lib/ FALSE)

And then in all cases set a variable like LIB_INSTALL_DIR accordingly.

Does that help ?

Alex
___
Powered by www.kitware.com

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

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

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


Re: [CMake] Question about if/else in Cmake

2009-03-10 Thread Sascha 'saigkill' Manns
Hello Alexander,

is this right?

SET( CONFIGFILE_PATH /etc/freeremoted CACHE PATH Path find config file 
FORCE )
SET( MODULEFILE_PATH /usr/lib CACHE PATH Path find module file FORCE)
option(USE_LIB64_DIR Enable this option to use lib64 instead of lib/ 
FALSE)

Or must i run this Option extra?
-- 
Sincereley yours

Sascha Manns
openSUSE Marketing Team
openSUSE Build Service
Web: http://saschamanns.gulli.to
Project-Blog: http://lizards.opensuse.org/author/saigkill
Private-Blog: http://saschasbacktrace.blogspot.com

DISCLAIMER: Please note that in accordance with the German law on data 
retention, information on every electronic information exchange with me 
is retained for a period of six months. 
http://www.vorratsdatenspeicherung.de
http://www.ccc.de

___
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] Ability to tell if it is a relative path

2009-03-10 Thread Tristan Carel
On Tue, Mar 10, 2009 at 23:42, James Bigler jamesbig...@gmail.com wrote:
 Is there a way to discover if a path is a relative path or not?

 I need to make sure that all paths are absolute for a given application, and
 I can be given either relative or absolute paths to files.  If I'm given a
 relative path I want to prepend ${CMAKE_CURRENT_SOURCE_DIR} to make it
 absolute, but if it's already absolute, I don't want to add anything.

Hi James,

by grepping `absolute' is the CMake documentation, you find:

if(IS_ABSOLUTE path)
True if the given path is an absolute path.

Cheers
-- 
Tristan Carel
Normal is getting dressed in clothes that you buy for work and driving
through traffic in a car that you are still paying for - in order to
get to the job you need to pay for the clothes and the car, and the
house you leave vacant all day so you can afford to live in it.
http://www.tristancarel.com
___
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] Ability to tell if it is a relative path

2009-03-10 Thread James Bigler
On Tue, Mar 10, 2009 at 3:54 PM, Tristan Carel tristan.ca...@gmail.comwrote:

 On Tue, Mar 10, 2009 at 23:42, James Bigler jamesbig...@gmail.com wrote:
  Is there a way to discover if a path is a relative path or not?
 
  I need to make sure that all paths are absolute for a given application,
 and
  I can be given either relative or absolute paths to files.  If I'm given
 a
  relative path I want to prepend ${CMAKE_CURRENT_SOURCE_DIR} to make it
  absolute, but if it's already absolute, I don't want to add anything.

 Hi James,

 by grepping `absolute' is the CMake documentation, you find:

 if(IS_ABSOLUTE path)
 True if the given path is an absolute path.

 Cheers
 --
 Tristan Carel


That's rather embarrassing that I missed that.  I thought I search the docs
for something like that.  Oh, well.  Thanks for the quick reply.

James
___
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] Memory cleanup of variables

2009-03-10 Thread Naram Qashat
I have a CMake project that I have been testing with various verisons of CMake 
2.4.x and 2.6.x to make sure it works as far back as 2.4.0, due to not knowing 
what version of CMake our users will be using since a lot of them use shells. 
In some instances, I have to read lines from a file using a specific regular 
expression.  With CMake 2.6.x, this works fine using the file(STRINGS) command. 
 With CMake 2.4.x, though (I haven't checked what versions specifically), after 
reading in a lot of files, I notice that a memory exhausted error comes up. 
I'm wondering when CMake cleans up the memory it uses, and if there is a way 
around this problem.  I would prefer not to force our uses to use CMake 2.6.x if 
their shell provider won't provide them something newer.


Thanks,
Naram Qashat
___
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] Memory cleanup of variables

2009-03-10 Thread Bill Hoffman

Naram Qashat wrote:
I have a CMake project that I have been testing with various verisons of 
CMake 2.4.x and 2.6.x to make sure it works as far back as 2.4.0, due to 
not knowing what version of CMake our users will be using since a lot of 
them use shells. In some instances, I have to read lines from a file 
using a specific regular expression.  With CMake 2.6.x, this works fine 
using the file(STRINGS) command.  With CMake 2.4.x, though (I haven't 
checked what versions specifically), after reading in a lot of files, I 
notice that a memory exhausted error comes up. I'm wondering when 
CMake cleans up the memory it uses, and if there is a way around this 
problem.  I would prefer not to force our uses to use CMake 2.6.x if 
their shell provider won't provide them something newer.


There may have been leaks in 2.4.X, not really much we can do about that 
now   What does the your cmake code look like that causes the leak?



-Bill

___
Powered by www.kitware.com

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

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

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


Re: [CMake] Question about if/else in Cmake

2009-03-10 Thread Sascha 'saigkill' Manns
On Dienstag 10 März 2009 20:56:17 Alexander Neundorf wrote:
 Or you could test whether e.g. /usr/lib64 exists, and if so, also use
 lib64.
This was an good idea.Now it runs perfectly :-)
-- 
Sincereley Yours

Sascha Manns
openSUSE Build Service
openSUSE Marketing Team
Maifeldstrasse 10
D-56 727 Mayen

Phone: +49 2651 4014045
Fax: +49 1805 019800 64392
Email: sascha.ma...@directbox.com
Web: http://saschamanns.gulli.to
Project-Blog: http://lizards.opensuse.org/author/saigkill
Private-Blog: http://saschasbacktrace.blogspot.com
PGP-Key: E31B59FB @ hkp://wwwkeys.pgp.net

DISCLAIMER: 
Please note that in accordance with the German law on data retention, 
information on every electronic information exchange with me is retained 
for a period of six months. 
http://www.vorratsdatenspeicherung.de
http://www.ccc.de

___
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] Memory cleanup of variables

2009-03-10 Thread Naram Qashat

Bill Hoffman wrote:

Naram Qashat wrote:
I have a CMake project that I have been testing with various verisons 
of CMake 2.4.x and 2.6.x to make sure it works as far back as 2.4.0, 
due to not knowing what version of CMake our users will be using since 
a lot of them use shells. In some instances, I have to read lines from 
a file using a specific regular expression.  With CMake 2.6.x, this 
works fine using the file(STRINGS) command.  With CMake 2.4.x, though 
(I haven't checked what versions specifically), after reading in a lot 
of files, I notice that a memory exhausted error comes up. I'm 
wondering when CMake cleans up the memory it uses, and if there is a 
way around this problem.  I would prefer not to force our uses to use 
CMake 2.6.x if their shell provider won't provide them something newer.


There may have been leaks in 2.4.X, not really much we can do about that 
now   What does the your cmake code look like that causes the leak?



-Bill


I believe it is within this macro of mine:

macro(read_from_file FILE REGEX STRINGS)
  if(CMAKE26_OR_BETTER)
# For CMake 2.6.x or better, we can just use the STRINGS sub-command to get 
the lines that match the given regular expression (if one is given, otherwise 
get all lines)

if(REGEX STREQUAL )
  file(STRINGS ${FILE} RESULT)
else(REGEX STREQUAL )
  file(STRINGS ${FILE} RESULT REGEX ${REGEX})
endif(REGEX STREQUAL )
  else(CMAKE26_OR_BETTER)
# For CMake 2.4.x, we need to do this manually, firstly we read the file in
file(READ ${FILE} ALL_STRINGS)
# Next we replace all newlines with semicolons
string(REGEX REPLACE \n ; ALL_STRINGS ${ALL_STRINGS})
if(REGEX STREQUAL )
  # For no regular expression, just set the result to all the lines
  set(RESULT ${ALL_STRINGS})
else(REGEX STREQUAL )
  # Clear the result list
  set(RESULT)
  # Iterate through all the lines of the file
  foreach(STRING ${ALL_STRINGS})
# Check for a match against the given regular expression
string(REGEX MATCH ${REGEX} STRING_MATCH ${STRING})
# If we had a match, append the match to the list
if(STRING_MATCH)
  append_to_list(RESULT ${STRING})
endif(STRING_MATCH)
  endforeach(STRING)
endif(REGEX STREQUAL )
  endif(CMAKE26_OR_BETTER)
  # Set the given STRINGS variable to the result
  set(${STRINGS} ${RESULT})
endmacro(read_from_file)

I had done this so I could call the macro and have it work with either 2.6.x or 
2.4.x.


Thanks,
Naram Qashat
___
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