Re: [CMake] what is the right way to set CMAKE_USE_RELATIVE_PATHS?

2010-01-11 Thread David . Karr
>> There are lots of questions on this CMake variable and the consensus
is DO
>> NOT USE IT. PERIOD. The implementation is basically broken for all
but the
>> most trivial case.
>
>I can tell you one thing. If the original idea of this was an attempt
>to create a CMake free build that will not work.

These comments agree with the way my software group has used CMake on a
daily basis for the past 6 or 7 years (or more?).  For our project, with
a couple thousand source code files in a few dozen directories, it only
takes a minute for CMake to generate our VC++ project files, and we make
heavy use of out-of-source builds and different relative paths to source
code files, all of which says you'd be crazy to rely on relative paths
in the project files.

Every once in a while, though, we get some pushback from our parent
group, for whom my software project is just one subcomponent of a larger
system.  For example, today a very influential member of the larger team
complained that he can't attach a debugger to our project on one of the
test machines because we don't use relative paths in our project files
(unlike "everyone else").  Supposedly he can take the source code
directory of any other subsystem (including all its VCPROJ files with
their relative paths to everything), drop it onto an arbitrary directory
on the test machine, open up VC++ and attach the debugger to a running
executable of that subsystem.  I don't know if relative paths would even
work in our case, but it would be very helpful if I could just twiddle
some setting in my top-level CMakeLists.txt, produce a version of the
project files with all relative paths, and either solve this guy's
problem or show him that relative paths aren't the answer after all.  

NOT having the ability (or at least know-how) to generate projects with
relative paths, I leave someone with an unsolved problem that seems to
be my fault (because my group keeps on using CMake) and increases the
risk that I'll eventually be forced to go back to using
individually-crafted VCPROJ files for everything, which IMHO would be a
huge step backward in my development process.

As a result, even though it's been years since I've even THOUGHT about
using relative paths, I'm temporarily setting CMAKE_USE_RELATIVE_PATHS
in a copy of my source tree to see what happens.  So far, though, it
doesn't seem to help much.  The paths to libraries that are given by
relative paths in CMakeLists.txt seem to stay relative paths rather than
being converted to absolute, but all the source files are still
identified by absolute paths regardless.

David

___
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] what is the right way to set CMAKE_USE_RELATIVE_PATHS?

2009-12-21 Thread Claus Klein

Hi Micheal,

I know the discusion about CMAKE_USE_RELATIVE_PATHS, for all my test 
under cygwin and MAC-OX with gmake and gcc, it works!

Only the setting is a little tricky ;-)

There are good reasons to use this option, at leased the shorter log files.

Claus

Michael Jackson schrieb:
There are lots of questions on this CMake variable and the consensus 
is DO NOT USE IT. PERIOD. The implementation is basically broken for 
all but the most trivial case.

_
Mike Jackson  mike.jack...@bluequartz.net
BlueQuartz Softwarewww.bluequartz.net
Principal Software Engineer  Dayton, Ohio

On Dec 21, 2009, at 3:59 PM, John Drescher wrote:

On Mon, Dec 21, 2009 at 3:50 PM, Claus Klein 
 wrote:

Hi all,

I tried to use:
  set(CMAKE_USE_RELATIVE_PATHS ON)
in my CMakeLists.txt.

But I noticed, that some cmake variables can't be changed in that way.
In the CMakeCache.txt, it is still OFF?




___
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] what is the right way to set CMAKE_USE_RELATIVE_PATHS?

2009-12-21 Thread Claus Klein

Hi Aashish,

yes the set command is well explained. Thanks.

But for some CMAKE variables this not true!

I guess that GUI vars have always set with FORCE?

Claus

Aashish Chaudhary schrieb:

Is this useful?

http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:set




___
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] what is the right way to set CMAKE_USE_RELATIVE_PATHS?

2009-12-21 Thread Claus Klein

John Drescher schrieb:

On Mon, Dec 21, 2009 at 3:50 PM, Claus Klein  wrote:
  

Hi all,

I tried to use:
  set(CMAKE_USE_RELATIVE_PATHS ON)
in my CMakeLists.txt.

But I noticed, that some cmake variables can't be changed in that way.
In the CMakeCache.txt, it is still OFF?



I have no idea about CMAKE_USE_RELATIVE_PATHS since I have never
needed/wanted to use that however for the other cases that it appears
the CMake does not let me change a value I usually get around this
using the following examples:

SET (CMAKE_INSTALL_PREFIX ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME}
CACHE STRING "Default Install Path" FORCE)


IF (MAKE_DEBUGRELEASE)
SET (CMAKE_CONFIGURATION_TYPES "Debug;RelWithDebInfo" CACHE STRING
"Debug;RelWithDebInfo" FORCE)
SET (RELEASE_BUILD_NAME "RelWithDebInfo")
ELSE(MAKE_DEBUGRELEASE)
SET (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING
"Debug;Release" FORCE)
SET (RELEASE_BUILD_NAME "Release")
ENDIF (MAKE_DEBUGRELEASE)


The keys are CACHE and FORCE.


John
  

Thanks John,

I know the FORCE option.
But I tried to understand for which CMake variables I have to use FORCE 
and why?
Is it really necessary to write so much configuration when I simply want 
to change a default value?


For the CMAKE_BUILD_TYPE it is documented, quote from CMake FAQ:

IF(NOT CMAKE_BUILD_TYPE)
 SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
 "Choose the type of build, options are: None Debug Release RelWithDebInfo 
MinSizeRel."
 FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)


Claus
___
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] what is the right way to set CMAKE_USE_RELATIVE_PATHS?

2009-12-21 Thread John Drescher
> There are lots of questions on this CMake variable and the consensus is DO
> NOT USE IT. PERIOD. The implementation is basically broken for all but the
> most trivial case.
>

I can tell you one thing. If the original idea of this was an attempt
to create a CMake free build that will not work.

John
___
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] what is the right way to set CMAKE_USE_RELATIVE_PATHS?

2009-12-21 Thread Michael Jackson
There are lots of questions on this CMake variable and the consensus  
is DO NOT USE IT. PERIOD. The implementation is basically broken for  
all but the most trivial case.

_
Mike Jackson  mike.jack...@bluequartz.net
BlueQuartz Softwarewww.bluequartz.net
Principal Software Engineer  Dayton, Ohio

On Dec 21, 2009, at 3:59 PM, John Drescher wrote:

On Mon, Dec 21, 2009 at 3:50 PM, Claus Klein  
 wrote:

Hi all,

I tried to use:
  set(CMAKE_USE_RELATIVE_PATHS ON)
in my CMakeLists.txt.

But I noticed, that some cmake variables can't be changed in that  
way.

In the CMakeCache.txt, it is still OFF?


I have no idea about CMAKE_USE_RELATIVE_PATHS since I have never
needed/wanted to use that however for the other cases that it appears
the CMake does not let me change a value I usually get around this
using the following examples:

SET (CMAKE_INSTALL_PREFIX ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME}
CACHE STRING "Default Install Path" FORCE)


IF (MAKE_DEBUGRELEASE)
SET (CMAKE_CONFIGURATION_TYPES "Debug;RelWithDebInfo" CACHE STRING
"Debug;RelWithDebInfo" FORCE)
SET (RELEASE_BUILD_NAME "RelWithDebInfo")
ELSE(MAKE_DEBUGRELEASE)
SET (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING
"Debug;Release" FORCE)
SET (RELEASE_BUILD_NAME "Release")
ENDIF (MAKE_DEBUGRELEASE)


The keys are CACHE and FORCE.


John
___
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] what is the right way to set CMAKE_USE_RELATIVE_PATHS?

2009-12-21 Thread John Drescher
On Mon, Dec 21, 2009 at 3:50 PM, Claus Klein  wrote:
> Hi all,
>
> I tried to use:
>   set(CMAKE_USE_RELATIVE_PATHS ON)
> in my CMakeLists.txt.
>
> But I noticed, that some cmake variables can't be changed in that way.
> In the CMakeCache.txt, it is still OFF?
>
I have no idea about CMAKE_USE_RELATIVE_PATHS since I have never
needed/wanted to use that however for the other cases that it appears
the CMake does not let me change a value I usually get around this
using the following examples:

SET (CMAKE_INSTALL_PREFIX ${PGM_FILES}/UPMC/${CMAKE_PROJECT_NAME}
CACHE STRING "Default Install Path" FORCE)


IF (MAKE_DEBUGRELEASE)
SET (CMAKE_CONFIGURATION_TYPES "Debug;RelWithDebInfo" CACHE STRING
"Debug;RelWithDebInfo" FORCE)
SET (RELEASE_BUILD_NAME "RelWithDebInfo")
ELSE(MAKE_DEBUGRELEASE)
SET (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING
"Debug;Release" FORCE)
SET (RELEASE_BUILD_NAME "Release")
ENDIF (MAKE_DEBUGRELEASE)


The keys are CACHE and FORCE.


John
___
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] what is the right way to set CMAKE_USE_RELATIVE_PATHS?

2009-12-21 Thread Claus Klein

Hi all,

I tried to use:
   set(CMAKE_USE_RELATIVE_PATHS ON)
in my CMakeLists.txt.

But I noticed, that some cmake variables can't be changed in that way.
In the CMakeCache.txt, it is still OFF?

What goes wrong?
Which is the right way do set CMAKE_BUILD_TYPE and CMAKE_USE_RELATIVE_PATHS?

//regards

Claus
___
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