[CMake] How to set suid for an executable with CMake and CPack?

2009-08-10 Thread Dong Tiger
Hi,

I use CPack to  build debian package for my project. One of the executables
in my project need to have suid set. How could I do that?

TIA

--
Tiger
___
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 suid for an executable with CMake and CPack?

2009-08-10 Thread Dong Tiger
BTW, are there any project using CPack? I want to take a reference so I can
get things right easier.

For example, one problem I ran into is the owner of files installed from my
debian package is myself instead of root.

2009/8/10 Dong Tiger idlecat...@gmail.com

 Hi,

 I use CPack to  build debian package for my project. One of the executables
 in my project need to have suid set. How could I do that?

 TIA

 --
 Tiger

___
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 suid for an executable with CMake and CPack?

2009-08-10 Thread Dong Tiger
I tried with

install(TARGETS
  my_executable
  RUNTIME DESTINATION bin
  PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE SETUID
)

But it only works if I do sudo make install before cpack -G DEB. How to
avoid the sudo make install step?  Can I embed post-install script in
cpack generated debian package?

--
Tiger


2009/8/10 Dong Tiger idlecat...@gmail.com

 Hi,

 I use CPack to  build debian package for my project. One of the executables
 in my project need to have suid set. How could I do that?

 TIA

 --
 Tiger

___
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 suid for an executable with CMake and CPack?

2009-08-10 Thread Michael Wild

you probably want to have a look at the fakeroot package

Michael

On 10. Aug, 2009, at 12:23, Dong Tiger wrote:


I tried with

install(TARGETS
my_executable
RUNTIME DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE SETUID
)

But it only works if I do sudo make install before cpack -G DEB.  
How to
avoid the sudo make install step?  Can I embed post-install script  
in

cpack generated debian package?

--
Tiger


2009/8/10 Dong Tiger idlecat...@gmail.com


Hi,

I use CPack to  build debian package for my project. One of the  
executables

in my project need to have suid set. How could I do that?

TIA

--
Tiger


___
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 pass -D options when compiling assembly files using gcc?

2009-08-10 Thread Marcel Loose
On Fri, 2009-07-24 at 22:16 +0200, Alexander Neundorf wrote:
 On Monday 13 July 2009, Michael Wild wrote:
  On 13. Jul, 2009, at 10:28, Eric Noulard wrote:
   2009/7/12 Marcel Loose lo...@astron.nl:
   Hi Eric,
  
   Thanks, I'll try that tomorrow. Another option that occurred to me
   today
   is that, since I'm using gcc to preprocess and compile the assembly
   sources, I might add .S as source file extension to
   CMAKE_C_SOURCE_FILE_EXTENSIONS. Any idea if that might work?
  
   I really don't know.
   Like I said before I have no experience with ASM file and CMake
   nor the definition of a new compiler variant with CMake.
  
   Once you have tried a little more, I'd rather let CMake developer
   or CMake user with more expeperience in the field
   answer that one :-)
  
  
   --
   Erk
   Membre de l'April - « promouvoir et défendre le logiciel libre » -
   http://www.april.org
 
  Hi
 
  I think I remember once having seen that for such a thing the LANGUAGE
  property on the .S files was being set to C. Might want to give that a
  shot...
 
  set(ASM_SRCS foo.S bar.S)
  set_source_files_properties(${ASM_SRCS} PROPERTIES LANGUAGE C)
 
 That's a bit ugly but it should do what you want.

Hi Alex,

Sorry for the late reply; holidays :-)

 I think it's this bug: http://public.kitware.com/Bug/view.php?id=8392
 and I'm not completely sure how to fix it.
 Should I add a CMakeASM-GCCInformation.cmake, and use that if the extension 
 is .S ? (...and set it up so that it keeps the definitions).

Yes, that bug covers exactly what I meant.

 Do other C compilers also support compiling assembler files or is this only 
 gcc ?
 
 Alex
 ___

Best regards,
Marcel Loose.

___
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] Linking against OS X Frameworks

2009-08-10 Thread Sean McBride
On 8/9/09 9:59 AM, ML said:

CMake Error at CMakeLists.txt:70 (message):
   MoreFilesX requires the SDK version to be not newer than 10.4u (10.6
   detected)

I have a recollection of that being true, but it's easy to change
MoreFiles to build with the new headers.  I have an old project that
uses the 10.5 SDK and the MoreFilesX code and it works fine.

What is the command to force 32-bit carbon as now that I set 10.4 as  
my SDK and I am running on a 64 -bit machine I am getting errors like:

In file included from /Volumes/Data/jtsm/Checkout/Universal GUI/source/ 
thirdparty/OSX/MoreFilesX/MoreFilesX.c:80:
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ 
Carbon.framework/Headers/Carbon.h:20:6: error: #error 64-bit not  
supported

The 10.4 SDK does not support 64 bit development.  If you want to build
as 64 bit, you need to use the 10.5 SDK.

I wish Apple had decided to support 64-bit Carbon, but that is another  
thread all together.

Much of Carbon is available in 64 bit, but definitely not all. 
MoreFilesX is largely obsolete and deprecated.  I suspect many of the
APIs it uses are unavailable in 64 bit.  Also, much of what MoreFiles
provided is now part of the file manager.  In fact, I think that's the
problem with the 10.4 SDK... one MoreFiles function became part of
Carbon's Files.h.

I'm curious why you want to use MoreFileX in a modern 64 bit app.  What
does it provide that is still helpful?

Lastly, discussion of 10.6 is verboten; discussing it violates your NDA.

-- 

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com 
Mac Software Developer  Montréal, Québec, Canada


___
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] [New Module] FindHDF5.cmake

2009-08-10 Thread James C. Sutherland
Out of curiosity, was a module ever submitted for this?  I would love  
to have a copy ;-)


Specifically, I am interested in detecting statically linked libraries  
and the c++ library and header(s).  I also would like to see a list of  
libraries like the z library for compression.


Utility executables like h5diff are also really useful for regression  
testing, so returning handles to those would be really great as well.


Thanks for your work on this!

James


On Jul 10, 2009, at 11:01 AM, Michael Jackson wrote:


reponses in line..


On Jul 10, 2009, at 12:33 PM, Will Dicharry wrote:


Michael Jackson wrote:



On Jul 10, 2009, at 11:13 AM, Brad King wrote:


Will Dicharry wrote:

Mike Jackson wrote:
Can you post your module or attach it to a bug/feature request?  
I also

have a FindHDF5 module and I would like to compare the two.


Sorry about that, I meant to attach the module to the first  
email.  It

is attached to this one.


After you two have combined your versions and reached consensus,
please post again and Cc me.  Then I'll send instructions to get
CVS commit access.  I see no reason not to have co-maintainers
for a module.

Thanks,
-Brad


I'll let Will be the maintainer. My module ends up being a bit  
more specific to my own version of HDF5, ie, I am just looking for  
the libraries (c, c++, and High Level) but not really looking for  
the HDF5 compiler scripts.


Couple of observations about the module:

Does it find the HDF5 C++ library?


No, but I'll add that in by invoking the HDF5 C++ wrapper compiler  
and searching the output.


Great.




Can it figure out if the HDF5 library is a static or dynamic  
library? (I configure a header file that has that information  
inside it which can then be tested for).


No, I'll look into how to determine that.  Suggestions welcome.


Well, I don't think there is an easy way to do it besides looking at  
the fully name of the library file, but even then that can give you  
bad results. In my CMake build system for HDF5 I add a few more  
#define elements into the H5Config.h file that has the necessary  
parts to be able to determine how HDF5 was compiled- static or  
dynamic.






Is it properly finding dependent libraries when needed, like szip  
or zip ( I don't as I do NOT compile HDF5 with that support)?


Yes, I need it to work across a number of platforms, many of which  
do compile in szip support.  I search for all libraries linked by  
the wrapper compiler and add them to the HDF5_LIBRARIES list.


You may also want to include variables such as HDF5_SZIP_LIBRARY and  
HDF5_ZIP_LIBRARY. You also might want to include some CMake code to  
generate the following variables:


HDF5_LIBRARY_DEBUG
HDF5_LIBRARY_RELEASE
HDF5_LIBRARY

For each library found. I think the normal hdf5 distribution will  
append a 'd' to the name of the hdf5 library when built in Debug  
mode. My own build system uses '_d' on windows and _debug on gcc.  
The necessary cmake code will do the right thing if one of the  
libraries are not found.



#
# Check the existence of the libraries.
#

# This macro was taken directly from the FindQt4.cmake file that is  
included
# with the CMake distribution. This is NOT my work. All work was  
done by the
# original authors of the FindQt4.cmake file. Only minor  
modifications were
# made to remove references to Qt and make this file more generally  
applicable

#

MACRO (_MXA_ADJUST_LIB_VARS basename)
 IF (${basename}_INCLUDE_DIR)

 # if only the release version was found, set the debug variable  
also to the release version

 IF (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG)
   SET(${basename}_LIBRARY_DEBUG ${${basename}_LIBRARY_RELEASE})
   SET(${basename}_LIBRARY   ${${basename}_LIBRARY_RELEASE})
   SET(${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE})
 ENDIF (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG)

 # if only the debug version was found, set the release variable  
also to the debug version

 IF (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE)
   SET(${basename}_LIBRARY_RELEASE ${${basename}_LIBRARY_DEBUG})
   SET(${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG})
   SET(${basename}_LIBRARIES   ${${basename}_LIBRARY_DEBUG})
 ENDIF (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE)
 IF (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE)
   # if the generator supports configuration types then set
   # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a  
value

   IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
 SET(${basename}_LIBRARY   optimized ${$ 
{basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG})

   ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
 # if there are no configuration types and CMAKE_BUILD_TYPE has  
no 

Re: [CMake] Linking against OS X Frameworks

2009-08-10 Thread ML

Michael,

I wish Apple had decided to support 64-bit Carbon, but that is  
another thread all together.


Just set CMAKE_OSX_ARCHITECTURES to i368, ppc or if you want a  
universal binary, i368;ppc


Ah, it was the ';' that was I was missing. I was using a space

-Jason
___
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 suid for an executable with CMake and CPack?

2009-08-10 Thread Dong Tiger
Thanks. I'll take a look although I feel CPack should be able to take care
of that automatically. Especially the owner of files should not be the user
who builds the package.

2009/8/10 Michael Wild them...@users.sourceforge.net

 you probably want to have a look at the fakeroot package

 Michael


 On 10. Aug, 2009, at 12:23, Dong Tiger wrote:

  I tried with

 install(TARGETS
 my_executable
 RUNTIME DESTINATION bin
 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
 GROUP_EXECUTE WORLD_READ WORLD_EXECUTE SETUID
 )

 But it only works if I do sudo make install before cpack -G DEB. How
 to
 avoid the sudo make install step?  Can I embed post-install script in
 cpack generated debian package?

 --
 Tiger


 2009/8/10 Dong Tiger idlecat...@gmail.com

  Hi,

 I use CPack to  build debian package for my project. One of the
 executables
 in my project need to have suid set. How could I do that?

 TIA

 --
 Tiger

  ___
 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] Linking against OS X Frameworks

2009-08-10 Thread ML

Hi Sean,

I wish Apple had decided to support 64-bit Carbon, but that is  
another

thread all together.


Much of Carbon is available in 64 bit, but definitely not all.
MoreFilesX is largely obsolete and deprecated.  I suspect many of the
APIs it uses are unavailable in 64 bit.  Also, much of what MoreFiles
provided is now part of the file manager.  In fact, I think that's the
problem with the 10.4 SDK... one MoreFiles function became part of
Carbon's Files.h.

I'm curious why you want to use MoreFileX in a modern 64 bit app.   
What

does it provide that is still helpful?

Lastly, discussion of 10.6 is verboten; discussing it violates your  
NDA.


Thanks for the reply. I will actually get rid of MoreFilesX shortly, I  
am just using it to get some old code running/upgraded and as part I  
will move to using FileManager.


As for 10.6, I dont want to discuss it at all! All of my questions  
have been 10.4u related.


-Jason
___
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 suid for an executable with CMake and CPack?

2009-08-10 Thread Eric Noulard
2009/8/10 Dong Tiger idlecat...@gmail.com:
 Thanks. I'll take a look although I feel CPack should be able to take care
 of that automatically.

That's your point of view and I respect it but...

 Especially the owner of files should not be the user who builds the package.

this is precisely the jobs of the packager (or the final packaging
tool, rpm, dpkg etc...)
to chose that kind of thing.
How would CPack decide to change ownership?

root may be an option for your particular package and distros but other
choices may be valid too. Moreover giving ownership to root mostly
need to be root unless you use something like fakeroot (already
pointed-out previously).

That said some CPack generator (DEB, RPM) mostly relies on underlying
tools (dpkg, rpmbuild)
so the CPACK_DEBIAN_xxx or CPACK_RPM_xxx are used to control actual feature
of the underlying tool.
See:
http://www.vtk.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29
http://www.vtk.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29

If you know the dpkg specific features or file from DEB format which
should be used
to tune the package build, do not hesitate to propose patches.

Concerned file for CPack Deb generator are
CMake/Source/CPack/cmCPackDebGenerator.cxx
CMake/Source/CPack/cmCPackDebGenerator.h
CMake/Modules/CPackDeb.cmake

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

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

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

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


[CMake] How to catch CMake Error get_directory_property

2009-08-10 Thread Marcel Loose
Hi all,

Is there a way to catch the CMake Error 'get_directory_property' when
requesting a property from a directory that has not yet been processed
by CMake.

I need to do this, because, in my situation, it is not an error if one
or more directories are not present (i.e. checked out). I would like
get_directory_property() to return FALSE or NOTFOUND when it cannot find
the requested directory, so that I can take appropriate action myself.
Is that somehow possible?

Best regards,
Marcel Loose.
 

___
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 catch CMake Error get_directory_property

2009-08-10 Thread Eric Noulard
2009/8/10 Marcel Loose lo...@astron.nl:
 Hi all,

 Is there a way to catch the CMake Error 'get_directory_property' when
 requesting a property from a directory that has not yet been processed
 by CMake.

The doc says:
If the property is not found, CMake will report an error.
and
You can only get properties of a directory during
   or after it has been traversed by cmake.


 I need to do this, because, in my situation, it is not an error if one
 or more directories are not present (i.e. checked out). I would like
 get_directory_property() to return FALSE or NOTFOUND when it cannot find
 the requested directory, so that I can take appropriate action myself.
 Is that somehow possible?

May be you can check the directory exists with

if(EXISTS directory)

before

calling get_directory_property.

or coding your own

my_get_directory_property which does the job you want.

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

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

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

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


Re: [CMake] Linking against OS X Frameworks

2009-08-10 Thread ML

Hi Michael,

What is the command to force 32-bit carbon as now that I set 10.4  
as my SDK and I am running on a 64 -bit machine I am getting errors  
like:


In file included from /Volumes/Data/jtsm/Checkout/Universal GUI/ 
source/thirdparty/OSX/MoreFilesX/MoreFilesX.c:80:
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ 
Carbon.framework/Headers/Carbon.h:20:6: error: #error 64-bit not  
supported


Just set CMAKE_OSX_ARCHITECTURES to i368, ppc or if you want a  
universal binary, i368;ppc


I have:

SET (CMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk)
SET (CMAKE_OSX_DEPLOYMENT_TARGET=10.4)
SET (CMAKE_OSX_ARCHITECTURES=i368;ppc)

but I am still getting warnings like:
In file included from FSCopyObject.h:53,
 from FSCopyObject.c:48:
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ 
CoreServices.framework/Headers/CoreServices.h:20:6: error: #error 64- 
bit not supported
In file included from /Developer/SDKs/MacOSX10.4u.sdk/System/Library/ 
Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:12,
 from /Developer/SDKs/MacOSX10.4u.sdk/System/Library/ 
Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/ 
Headers/CarbonCore.h:20,
 from /Developer/SDKs/MacOSX10.4u.sdk/System/Library/ 
Frameworks/CoreServices.framework/Headers/CoreServices.h:24,

 from FSCopyObject.h:53,
 from FSCopyObject.c:48:

What am I missing now?

-Jason

___
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] Linking against OS X Frameworks

2009-08-10 Thread ML

Everyone,

What is the command to force 32-bit carbon as now that I set 10.4  
as my SDK and I am running on a 64 -bit machine I am getting  
errors like:


In file included from /Volumes/Data/jtsm/Checkout/Universal GUI/ 
source/thirdparty/OSX/MoreFilesX/MoreFilesX.c:80:
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ 
Carbon.framework/Headers/Carbon.h:20:6: error: #error 64-bit not  
supported


Just set CMAKE_OSX_ARCHITECTURES to i368, ppc or if you want a  
universal binary, i368;ppc


I have:

SET (CMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk)
SET (CMAKE_OSX_DEPLOYMENT_TARGET=10.4)
SET (CMAKE_OSX_ARCHITECTURES=i368;ppc)


And, yes for clarity i did change the above from Michael to say:

SET (CMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk)
SET (CMAKE_OSX_DEPLOYMENT_TARGET=10.4)
SET (CMAKE_OSX_ARCHITECTURES=i386;ppc)

[CMAKE_OSX_ARCHITECTURES was wrong.]

Still errors I mentioned.

-Jason

___
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] Including Files

2009-08-10 Thread ML

Hi All,

In my CMakeList..txt, I want to do some including of other files that  
will do some setting or options, etc, etc/


Something like:

if (APPLE)

 include(apple.txt)

endif (APPLE)

Can I do this? is there a proper naming convention I should use?

-Jason

___
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] Including Files

2009-08-10 Thread Mike Jackson
The convention is to use *.cmake but any text file will do. The nice
thing about using .cmake as the extension is that lots of editors will
pick up on this fact and then use some sort of syntax coloring for
your cmake file.

The thing to note is that using the include() command is just like
substituting the code in the included file right into the current
cmake file where you wrote the include() command.


Mike Jackson

On Mon, Aug 10, 2009 at 7:43 PM, MLmailingli...@mailnewsrss.com wrote:
 Hi All,

 In my CMakeList..txt, I want to do some including of other files that will
 do some setting or options, etc, etc/

 Something like:

 if (APPLE)

  include(apple.txt)

 endif (APPLE)

 Can I do this? is there a proper naming convention I should use?

 -Jason
___
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] Linking against OS X Frameworks

2009-08-10 Thread Mike Jackson
On Mon, Aug 10, 2009 at 7:36 PM, MLmailingli...@mailnewsrss.com wrote:
 Everyone,

 What is the command to force 32-bit carbon as now that I set 10.4 as my
 SDK and I am running on a 64 -bit machine I am getting errors like:

 In file included from /Volumes/Data/jtsm/Checkout/Universal
 GUI/source/thirdparty/OSX/MoreFilesX/MoreFilesX.c:80:

 /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20:6:
 error: #error 64-bit not supported

 Just set CMAKE_OSX_ARCHITECTURES to i368, ppc or if you want a universal
 binary, i368;ppc

 I have:

 SET (CMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk)
 SET (CMAKE_OSX_DEPLOYMENT_TARGET=10.4)
 SET (CMAKE_OSX_ARCHITECTURES=i368;ppc)

 And, yes for clarity i did change the above from Michael to say:

 SET (CMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk)
 SET (CMAKE_OSX_DEPLOYMENT_TARGET=10.4)
 SET (CMAKE_OSX_ARCHITECTURES=i386;ppc)

 [CMAKE_OSX_ARCHITECTURES was wrong.]

 Still errors I mentioned.

 -Jason



What version of CMake are you using? I'm not sure if the
CMAKE_OSX_DEPLOYMENT_TARGET was included in the CMake 2.6 branch.

 You may also have to set these BEFORE the first time you ever run
CMake in your build directory. I don't have access to cmake at the
moment (wrong computer.. ) so I can not check how those variables are
initialized.

-- 
Mike Jackson   mike.jack...@bluequartz.net
BlueQuartz Softwarewww.bluequartz.net
___
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] Linking against OS X Frameworks

2009-08-10 Thread ML

All,

What is the command to force 32-bit carbon as now that I set  
10.4 as my
SDK and I am running on a 64 -bit machine I am getting errors  
like:


In file included from /Volumes/Data/jtsm/Checkout/Universal
GUI/source/thirdparty/OSX/MoreFilesX/MoreFilesX.c:80:

/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ 
Carbon.framework/Headers/Carbon.h:20:6:

error: #error 64-bit not supported


Just set CMAKE_OSX_ARCHITECTURES to i368, ppc or if you want a  
universal

binary, i368;ppc


I have:

SET (CMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk)
SET (CMAKE_OSX_DEPLOYMENT_TARGET=10.4)
SET (CMAKE_OSX_ARCHITECTURES=i368;ppc)


And, yes for clarity i did change the above from Michael to say:

SET (CMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk)
SET (CMAKE_OSX_DEPLOYMENT_TARGET=10.4)
SET (CMAKE_OSX_ARCHITECTURES=i386;ppc)

[CMAKE_OSX_ARCHITECTURES was wrong.]



What version of CMake are you using?



[j...@jason-t-slack-moehrles-macbook-pro ~/Checkout/Universal GUI]$  
cmake -version

cmake version 2.6-patch 4


I'm not sure if the
CMAKE_OSX_DEPLOYMENT_TARGET was included in the CMake 2.6 branch.


Yeah, I dont see it here: http://cmake.org/cmake/help/cmake2.6docs.html


You may also have to set these BEFORE the first time you ever run
CMake in your build directory.


Well  for my CMakeLists.txt I set them almost off the bat.

Are you thinking environment variables and run cmake form a shell  
script of something?


I suppose I can check out the latest development branch from CVS and  
see what happens with that.


-Jason
___
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] Linking against OS X Frameworks

2009-08-10 Thread Michael Wild


On 11. Aug, 2009, at 4:56, ML wrote:


All,

What is the command to force 32-bit carbon as now that I set  
10.4 as my
SDK and I am running on a 64 -bit machine I am getting errors  
like:


In file included from /Volumes/Data/jtsm/Checkout/Universal
GUI/source/thirdparty/OSX/MoreFilesX/MoreFilesX.c:80:

/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ 
Carbon.framework/Headers/Carbon.h:20:6:

error: #error 64-bit not supported


Just set CMAKE_OSX_ARCHITECTURES to i368, ppc or if you want a  
universal

binary, i368;ppc


I have:

SET (CMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk)
SET (CMAKE_OSX_DEPLOYMENT_TARGET=10.4)
SET (CMAKE_OSX_ARCHITECTURES=i368;ppc)


And, yes for clarity i did change the above from Michael to say:

SET (CMAKE_OSX_SYSROOT=/Developer/SDKs/MacOSX10.4u.sdk)
SET (CMAKE_OSX_DEPLOYMENT_TARGET=10.4)
SET (CMAKE_OSX_ARCHITECTURES=i386;ppc)

[CMAKE_OSX_ARCHITECTURES was wrong.]


Don't set them in the CMakeLists.txt. Set them in the CACHE! That is,  
either using ccmake, cmake-gui or the -D flag for the cmake  
executable. You can also use an initial cache, as described in the  
cmake.1 man-page.





What version of CMake are you using?



[j...@jason-t-slack-moehrles-macbook-pro ~/Checkout/Universal GUI]$  
cmake -version

cmake version 2.6-patch 4


I'm not sure if the
CMAKE_OSX_DEPLOYMENT_TARGET was included in the CMake 2.6 branch.


Yeah, I dont see it here: http://cmake.org/cmake/help/ 
cmake2.6docs.html



In the code I posted, I emulate the behaviour of  
CMAKE_OSX_DEPLOYMENT_TARGET in older versions of cmake. Proper support  
for this variable will probably appear in 2.8.





You may also have to set these BEFORE the first time you ever run
CMake in your build directory.


Well  for my CMakeLists.txt I set them almost off the bat.

Are you thinking environment variables and run cmake form a shell  
script of something?


There are several ways. Again, refer to the man-page. But Probably the  
most convenient way for you is using the -C flag:


http://cmake.org/cmake/help/cmake2.6docs.html#opt:-Cinitial-cache



I suppose I can check out the latest development branch from CVS and  
see what happens with that.


-Jason



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