[CMake] IPhone SDK and Frameworks

2009-10-16 Thread Clemens Arth
Hi,

I know this topic comes up now and then, but I could not find a
sufficiently documented solution to this issue yet. I still think the
know-how must be out there. I wanted to set up a project to build on the
iPhone or the iPhone simulator with XCode. What I found to be most
informative are these two postings:

http://stackoverflow.com/questions/794137/how-to-set-up-cmake-to-build-a-library-for-the-iphone
http://stackoverflow.com/questions/822404/how-to-set-up-cmake-to-build-an-app-for-the-iphone

There are two issues I came up right at the start:

1) Not setting CMAKE_OSX_SYSROOT results in building the project for the
current desktop OS, but if you set it, it must point to a valid SDK
directory (e,g.
/Developer/Platform/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk)
- then it creates a iPhone project, where you can select basically any
SDK, and it seems that XCode handles the SDKs automatically, as Visual
Studio does it for Windows Mobile 5/6 a.s.o.. So far, so good. BUT:

2) I know that CMake is framework aware, it still seems to be tricky to
add frameworks to the projects in a generic way. I tried to use
FIND_LIBRARY but it did not work out as expected, because it only found
the desktop os libraries. So I fixed it using something like:

SET(TARGETSDK iPhoneSimulator3.1.sdk)
SET(CMAKE_OSX_SYSROOT
/Developer/Platform/iPhoneSimulator.platform/Developer/SDKs/${TARGETSDK})
SET(CMAKE_OSX_ARCHITECTURES ${ARCH_STANDARD_32_BIT})

FIND_LIBRARY(OPENGLES NAMES OpenGLES PATHS ${CMAKE_OSX_SYSROOT
}/System/Library PATH_SUFFIXES Frameworks NO_DEFAULT_PATH)
MARK_AS_ADVANCED(OPENGLES )
TARGET_LINK_LIBRARIES(MyApp ${OPENGLES})

and then if finds the SDK, but only for the iPhoneSimulator3.1.sdk. I
don't think it takes the right SDK if I switch to the 3.1.2 SDK in
XCode. Basically the question rises, if there is a way to add the
Framework as is into Xcode without passing an exact path to it.

Any comments are highly appreciated...
Regards...




___
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] CTest and multiple repositories

2009-10-16 Thread Martin Santa María

Hello everybody,

 

I don't know if we can post non-cmake questions here. But I have a problem with 
ctest and perhaps one of you can help me.

My project is build up as a directory structure. This directory structure is 
composed by differents checkouts from differents repositories.

 

root directory (in repository 1)

   some folders (in respository 1)

   some folders (in respository 2)

 

Each directory has a CMakeLists.txt that add test and I lunch only one CMake 
configuration for the hole structure (so I have only one solution, in case of 
MSVS)

I'm having problems with ctest -D NightlyUpdate procedure because it updates 
only the first repository (files in repository 1).

So, Can I solve the problem with a strage script that update the directory 
structure regarless the respository (like implementing another svn.exe that 
recurses the structure intead of the default svn implementation that doesn't do 
this), or would I have problems with ctest because, for example, multiples 
revisions numbers.

 

Now I'm performing a manual update of all repositories before lunching ctest 
without calling NightlyUpdate, but when commiting to CDash, I don't have users 
statistics and other usefull information because the update info was not 
submitted.

 

Do you know the best solution?

 

Thanks you for your time. Regards,

 

 

Martin
  
_
Recibí alertas de tránsito en tu celu y llegá antes a tu destino. MSN Mapas te 
ayuda
http://www.msnmapas.com/sms-mms-transito.html___
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] Updating cache entries on variable modification

2009-10-16 Thread Theodore Papadopoulo

Tyler Roscoe wrote:

On Wed, Oct 14, 2009 at 04:59:17PM +0200, Theodore Papadopoulo wrote:
  
We have a project which can be built either with static or dynamic 
libraries. The toggle
is defined via an option named BUILD_SHARED which has some default value 
(let's say static).


Unfortunately, after the first configure in ccmake all the libraries 
are set to their values corresponding
to the default static choice  (typically .a files) and then changing the 
BUILD_SHARED option to shared

never recomputes the proper library names (still the .a files).



I think we'll need to see some code from your CMakeLists, but are you
familiar with set(... CACHE)?
  
Not enough apparently Anyway thanks for the answer, it opened some 
perspectives.

Here is some simple CMakeList.txt at the end of this mail.

After the first configure the library selected is liblapack.so, then if 
you change the value
of the option BUILD_SHARED and re-configure, the library remains 
liblapack.so instead of the

expected liblapack.a.

Uncommenting the commented line, indeed forces the discovery of the 
libraries at each configure,
but we were wondering whether there is a way of doing so only if eg 
CMAKE_FIND_LIBRARY_SUFFIXES

is changed, hence the original question. I hope that this is now clearer.

Inserting something along the lines of:

   IF ( BUILD_SHARED )
   SET(LIB_TYPE SHARED)
   ELSE ( BUILD_SHARED )
   SET(LIB_TYPE STATIC)
   ENDIF ( BUILD_SHARED )

   STRING(COMPARE NOTEQUAL ${BUILD_SHARED_STATUS}  
BUILD_SHARED_STATUS_NOT_EMPTY)

   IF(BUILD_SHARED_STATUS_NOT_EMPTY)
   STRING(COMPARE NOTEQUAL ${BUILD_SHARED_STATUS} 
${BUILD_SHARED} RESET)

   IF(${RESET})
   # MESSAGE(Reset)
   SET(LAPACK_ATLAS_LIB NOTFOUND CACHE STRING Atlas Lib 
FORCE)

   ENDIF()
   ENDIF()

   # Store in cache previous value of BUILD_SHARED
   SET(BUILD_SHARED_STATUS ${BUILD_SHARED} CACHE STRING Build shared 
status (do not modify) FORCE)

   MARK_AS_ADVANCED(BUILD_SHARED_STATUS)

Seems not work but is not very elegant and there is the risk that some 
user using the advanced toggle plays with the
BUILD_SHARED_STATUS variable. So I wondered whether there is a better 
solution. Obviously, ideally,
FIND_LIBRARY would detect that CMAKE_FIND_LIBRARY_SUFFIXES has changed 
and would update the libraries,

but I probably demand too much

Thank's for any hint.

   Theo.

PROJECT(Test)

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

OPTION(BUILD_SHARED BUILD_SHARED ON)

IF(BUILD_SHARED)
   SET(CMAKE_FIND_LIBRARY_SUFFIXES .so)
ELSE ()
   SET(CMAKE_FIND_LIBRARY_SUFFIXES .a)
ENDIF()

#SET(TEST_LIB NOTFOUND CACHE STRING Lib FORCE)

FIND_LIBRARY(TEST_LIB lapack)

MESSAGE(${TEST_LIB})
___
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] Endless Regeneration of Visual Studio Files

2009-10-16 Thread Mike Jackson
Just following up with this I believe there was a problem with the
clock on the computer I was using as this symptom was NOT displayed on
another VS 2008 installation on another computer. I ended up
completely wiping out the source and pulling a new clone from the
master git repository. After that, I configured for VS and things seem
to be back to normal.


_
Mike Jackson  mike.jack...@bluequartz.net

On Thu, Oct 15, 2009 at 5:31 PM, Mike Jackson
mike.jack...@bluequartz.net wrote:
 Generated a project for VS 2008 Standard Edition Win64 and when I
 compile my code I am always getting the following:

 1-- Build started: Project: ZERO_CHECK, Configuration: Debug x64 --
 1Checking Build System
 1CMake is re-running because build system is out-of-date.
 1Warning: CMake is forcing CMAKE_CXX_COMPILER to cl to match that
 imported from ITK.  This is required because C++ projects must use the
 same compiler.  If this message appears for more than one imported
 project, you have conflicting C++ compilers and will have to re-build
 one of those projects. Was set to C:/Program Files (x86)/Microsoft
 Visual Studio 9.0/VC/bin/amd64/cl.exe
 1-- Configuring done
 1-- Generating done
 1-- Build files have been written to: 
 C:/Users/mjackson/Workspace/AIMBlades/x64

 I am not intentionally changing any of the CMake files or anything
 else that I am aware of. I can Compile the project and as soon as it
 completes, compile again and the entire project is recompiled again.
 Usually VS will just spit out a simple line that says the project was
 built. zero errors.

  So what might be causing something like this to happen. I have edited
 my CMake files in the last few days so something that got added to
 them has had this effect on the VS projects.

  I my CMakeListst.txt I am doing things like:
  Using Qt 4 in my project so UIC and MOC are being run.
  using configure_file to generate a few icon .rc files for windows
  Generating some headers the first time through

 Thanks for any pointers.

  What if moc or uic generates the same file twice (due to the same UI
 file being in 2 different targets)?

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

___
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(FILES mylib-config.cmake DESTINATION lib/myproj)

2009-10-16 Thread Mathieu Malaterre
Hi there,

  I am trying some new functionalities in CMake, in particular:

http://www.cmake.org/Wiki/CMake_2.6_Notes#Packaging_and_Exporting

  However using cmake 2.8, I get an error:

CMake Error at cmake_install.cmake:64 (FILE):
  file INSTALL cannot find
  /home/mathieu/Perso/gdcm/Sandbox/CMakeBug/5/project1/myproj-config.cmake.


It looks like the file is now named myproj-noconfig.cmake

Coud someone confirms that ? Here is my code (*)

Thanks,
-- 
Mathieu


(*)
project(project1)
find_package(PNG REQUIRED)
add_library(lib1 SHARED lib1.cxx)
target_link_libraries(lib1 ${PNG_LIBRARIES})
install(TARGETS lib1 EXPORT myproj DESTINATION lib)
install(EXPORT myproj DESTINATION lib/myproj)
install(FILES myproj-config.cmake DESTINATION lib/myproj)
___
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] temporary build directory for header files

2009-10-16 Thread James C. Sutherland
I have a fairly large project where the header files from various  
subdirectories are combined into a single include directory when the  
project is installed.


For example, header a.h may be located in:
/root/subproject1/
in the source tree, it is located in
/include/MyProject/
in the installation.

However, we have some demo files that also serve as source for some  
tests.  These files expect the installed header configuration, not the  
source header configuration.  For example, they include

#include MyProject/a.h
rather than
#include subproject/a.h
or
#include a.h

So is there a way of moving header files to a specific location in the  
build tree (like a pre-install)?  I am looking for something similar  
to setting

CMAKE_LIBRARY_OUTPUT_DIRECTORY
for library files to collect them into one location as they are built.

Any tips would be greatly appreciated!

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


Re: [CMake] temporary build directory for header files

2009-10-16 Thread Mike Jackson
configure_file(InputFile OutputFile  [COPYONLY] [ESCAPE_QUOTES] [...@only])

The Input and Output files have to have full paths. This command
replaces any variables in the input file referenced as ${VAR} or @VAR@
with their values as determined by CMake. If a variable is not
defined, it will be replaced with nothing. If COPYONLY is specified,
then no variable expansion will take place. If ESCAPE_QUOTES is
specified then any substituted quotes will be C-style escaped. The
file will be configured with the current values of CMake variables. If
@ONLY is specified, only variables of the form @VAR@ will be replaces
and ${VAR} will be ignored. This is useful for configuring scripts
that use ${VAR}. Any occurrences of #cmakedefine VAR will be replaced
with either #define VAR or /* #undef VAR */ depending on the setting
of VAR in CMake


You could try that and copy the file where ever you need it. You could
also use the include_directories to add  /root/subproject1/ to the
include directories.
_
Mike Jackson  mike.jack...@bluequartz.net
BlueQuartz Softwarewww.bluequartz.net
Principal Software Engineer  Dayton, Ohio




On Fri, Oct 16, 2009 at 12:13 PM, James C. Sutherland
james.sutherl...@utah.edu wrote:
 I have a fairly large project where the header files from various
 subdirectories are combined into a single include directory when the project
 is installed.

 For example, header a.h may be located in:
        /root/subproject1/
 in the source tree, it is located in
        /include/MyProject/
 in the installation.

 However, we have some demo files that also serve as source for some tests.
  These files expect the installed header configuration, not the source
 header configuration.  For example, they include
        #include MyProject/a.h
 rather than
        #include subproject/a.h
 or
        #include a.h

 So is there a way of moving header files to a specific location in the build
 tree (like a pre-install)?  I am looking for something similar to setting
        CMAKE_LIBRARY_OUTPUT_DIRECTORY
 for library files to collect them into one location as they are built.

 Any tips would be greatly appreciated!

 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

___
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] Post install scripts for debian

2009-10-16 Thread as
Hello:

We are using CMake to create inhouse deb packages for our project. We
need to run a script after installing the package: postinst script
which is possible in Debian. I don't know how to enable this from
CMake - do I set some flags? Do I just put the file in a particular
location? I'm not able to find much help on the web.

Any help will be appreciated.

Thanks,
Aravind.
___
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] Post install scripts for debian

2009-10-16 Thread Eric Noulard
2009/10/16 as rmct...@gmail.com:
 Hello:

 We are using CMake to create inhouse deb packages for our project. We
 need to run a script after installing the package: postinst script
 which is possible in Debian. I don't know how to enable this from
 CMake - do I set some flags? Do I just put the file in a particular
 location? I'm not able to find much help on the web.

Normally information about CPack generator may be found on the Wiki
 http://www.cmake.org/Wiki/CMake:CPackPackageGenerators

now when you cannot find information there you can try inside CPack
source or CPack module:

CPackDeb.cmake is the one for Deb packaging which defines DEB
specific variable usage.
The one which may satisty your need is:

# CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
# This variable allow advanced user to add custom script to the
control.tar.gz (inside the .deb archive)
# Typical examples are:
# - conffiles
# - postinst
# - postrm
# - prerm
# Usage:
# SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
#${CMAKE_CURRENT_SOURCE_DIR}/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm)

Thus I would say that if you
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA yourpath_to/postinst)

it should work as expected.
If it does may you can update the DEB part of the wiki accordingly:

http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29

-- 
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] Turning off extra Visual Studio options

2009-10-16 Thread John Drescher
On Fri, Oct 16, 2009 at 2:16 PM, Steven Wilson
steven.wesley.wil...@gmail.com wrote:
 Is there a way to turn off all the extra options that CMake tries to append
 to compiler flags, linker flags, etc for the Visual Studio generators?   I
 have a project that I want to explicity control every option for some of my
 exes/libs.


You can change these either in you CMakeLists.txt file or in cmake-gui or ccmake

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] Turning off extra Visual Studio options

2009-10-16 Thread Steven Wilson
Is there a way to turn off all the extra options that CMake tries to append
to compiler flags, linker flags, etc for the Visual Studio generators?   I
have a project that I want to explicity control every option for some of my
exes/libs.

Thanks,

Steve
___
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] Turning off extra Visual Studio options

2009-10-16 Thread Tyler Roscoe
On Fri, Oct 16, 2009 at 12:16:12PM -0600, Steven Wilson wrote:
 Is there a way to turn off all the extra options that CMake tries to append
 to compiler flags, linker flags, etc for the Visual Studio generators?   I
 have a project that I want to explicity control every option for some of my
 exes/libs.

I don't know of an easy way.

I guess the best way would be to just override all the appropriate flags
(CMAKE_CXX_FLAGS and friends) for any of your buildables that need to
override them.

You could also modify the Platform/ files for Windows in your CMake
installation.

tyler
___
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] Turning off extra Visual Studio options

2009-10-16 Thread Philip Lowman
You may want to also look into platform override files.   See the FAQ and
search for override.

On Oct 16, 2009 3:50 PM, Tyler Roscoe ty...@cryptio.net wrote:

On Fri, Oct 16, 2009 at 12:16:12PM -0600, Steven Wilson wrote:  Is there a
way to turn off all the ...
I don't know of an easy way.

I guess the best way would be to just override all the appropriate flags
(CMAKE_CXX_FLAGS and friends) for any of your buildables that need to
override them.

You could also modify the Platform/ files for Windows in your CMake
installation.

tyler

___ Powered by
www.kitware.comVisit other Kitware open...
___
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] Turning off extra Visual Studio options

2009-10-16 Thread John Drescher
On Fri, Oct 16, 2009 at 4:14 PM, Philip Lowman phi...@yhbt.com wrote:
 You may want to also look into platform override files.   See the FAQ and
 search for override.


Found that:

http://www.itk.org/Wiki/CMake_FAQ#Make_Override_Files

Thanks. I will have to bookmark that..

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] Turning off extra Visual Studio options

2009-10-16 Thread Steven Wilson
Thanks for the help!

On Fri, Oct 16, 2009 at 2:52 PM, Philip Lowman phi...@yhbt.com wrote:

 Thanks for linking.  Posting via mobile :)

 On Oct 16, 2009 4:27 PM, John Drescher dresche...@gmail.com wrote:

 On Fri, Oct 16, 2009 at 4:14 PM, Philip Lowman phi...@yhbt.com wrote: 
 You may want to also look ...
 Found that:

 http://www.itk.org/Wiki/CMake_FAQ#Make_Override_Files

 Thanks. I will have to bookmark that..

 John
 ___

 Powered by www.kitware.com

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


 ___
 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