[CMake] Different installers for different applications with CPack

2014-06-14 Thread Daniel Dekkers
Hi,

 

I have a number of applications sharing the same libraries in a single CMake
source tree:

 

Development

-  LibraryA

-  LibraryB

-  ApplicationA (might depend on LibraryA and/or LibraryB)

-  ApplicationB (might depend on LibraryA and/or LibraryB)

 

Now I would like to create different installers for the different
applications. 

I'm trying CPack and managed to create a (NSIS) installer for a single
application (Calling CPack at the end of the root CMakeLists.txt of
Development) but don't know how to create more of them.

Can I "INCLUDE(CPACK)" more than once, ie in the CMakeLists.txt of the
different Applications or is that bad practice?

Or should I lose the direct coupling with CMake and make different
CPackConfig.cmake scripts for all of them?

 

Note: I'm not looking for the component system, where the user selects which
components to install. I'm looking for separate installers, so I can
distribute the applications separately.

 

Thanks,

Daniel Dekkers

-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] Finding Freetype on Windows

2012-08-20 Thread Daniel Dekkers
Hi,

 

Having trouble finding Freetype with the find module shipped with
Cmake2.8.9-rc1:

 

SET( ENV{FREETYPE_DIR} ${DEVELOPMENT_ROOT}/freetype-2.4.6 )

FIND_PACKAGE( Freetype REQUIRED )

 

I can't see anything wrong with these lines? 

 

Thanks,

Daniel

 

 

 

--

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] Adding "*.obj" geometry files...

2012-06-25 Thread Daniel Dekkers
Hi Brad,

Yes you are right. With the VS2010 generator, with HEADER_FILE_ONLY, the file 
"Item Type" is set to "C++/C header". So it works (I've tested it with 
CMake-2.8.9-rc1).

But it is still uncomfortable that with the VS2008 generator, the file is 
explicitly set as "Excluded From Build", complete with red stop sign icons in 
the IDE, while with VS2010, the files are not "Excluded From Build" but labeled 
as header only.

Isn't there a "CMake-way" that always results in "Excluded From Build" set, 
independent of the generator?

Thanks,
Daniel Dekkers


On Jun 20, 2012, at 5:34 PM, Brad King wrote:

> On 06/20/2012 11:08 AM, Daniel Dekkers wrote:
>> Here you go...
> 
> The project file contains
> 
>  
>
>
>  
> 
> so it tells VS that "test.xml" is "HEADER_FILE_ONLY".
> That is the same as in my project file.  I can build
> with no errors.  Be sure to use a fresh build tree.
> 
> -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] Adding "*.obj" geometry files...

2012-06-19 Thread Daniel Dekkers
Nope :(

-Oorspronkelijk bericht-
Van: Brad King [mailto:brad.k...@kitware.com] 
Verzonden: dinsdag 19 juni 2012 22:45
Aan: Daniel Dekkers
CC: 'j'; cmake@cmake.org; 'Bill Hoffman'
Onderwerp: Re: [CMake] Adding "*.obj" geometry files...

On 06/19/2012 04:27 PM, Daniel Dekkers wrote:
> SET_TARGET_PROPERTIES(HeaderOnlyTest PROPERTIES RESOURCE
"${RESOURCE_FILE}")

Does removing this line fix it?

-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] Adding "*.obj" geometry files...

2012-06-19 Thread Daniel Dekkers
Hi Brad,

We were already using 2.8.8. We tried the nightly build but still no effect.
It's not just the obj files, it's xml, ttf, png, ...
The VS2008 generator works fine, with the nightly build as well, but
VS2010,.. no excludes.

Thanks,
Daniel

-Oorspronkelijk bericht-
Van: Brad King [mailto:brad.k...@kitware.com] 
Verzonden: dinsdag 19 juni 2012 16:25
Aan: Daniel Dekkers
CC: 'Petr Kmoch'; 'j'; cmake@cmake.org; 'Bill Hoffman'
Onderwerp: Re: [CMake] Adding "*.obj" geometry files...

On 06/19/2012 09:13 AM, Daniel Dekkers wrote:
> Although with the VS2008 generator setting the HEADER_FILE_ONLY 
> property works to exclude the files from the build, in VS2010 no such
luck.
> Am I doing something wrong in the syntax? Or is it a known issue with 
> VS2010?

IIRC CMake 2.8.7 and earlier did not implement this in the VS 10 generator
correctly for .obj files.  I think I fixed that in 2.8.8 while working on
some other changes:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=328c0f65

Note that the removed WriteObjSources method did not check for the
HEADER_FILE_ONLY property.

Please try 2.8.8, and if that does not work then try a nightly build:

  http://www.cmake.org/files/dev/?C=M;O=D

because even more changes have been made to the VS 10 generator since 2.8.8.

-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] Adding "*.obj" geometry files...

2012-06-19 Thread Daniel Dekkers
Hi,

Although with the VS2008 generator setting the HEADER_FILE_ONLY property
works to exclude the files from the build, in VS2010 no such luck.
Am I doing something wrong in the syntax? Or is it a known issue with
VS2010?

We're doing this:

# Mark all resource files as HEADER_ONLY to avoid (for instance) Visual
Studio interpreting obj files as regular object files...
SET_SOURCE_FILES_PROPERTIES( ${RT_ALL_RSRC_FILES} PROPERTIES
HEADER_FILE_ONLY TRUE)

Also tried:

# Mark all resource files as HEADER_ONLY to avoid (for instance) Visual
Studio interpreting obj files as regular object files...
FOREACH( RSRC_FILE ${RT_ALL_RSRC_FILES} )
SET_SOURCE_FILES_PROPERTIES( ${RSRC_FILE} PROPERTIES
HEADER_FILE_ONLY TRUE )
ENDFOREACH()

Thanks,
Daniel

-Oorspronkelijk bericht-
Van: Petr Kmoch [mailto:petr.km...@gmail.com] 
Verzonden: woensdag 13 juni 2012 8:10
Aan: Daniel Dekkers
CC: Bill Hoffman; cmake@cmake.org
Onderwerp: Re: [CMake] Adding "*.obj" geometry files...

Hi Daniel.

Yes, that's how Visual Studio shows excluded files. If you exclude a file by
setting its "Excluded from build" property manually, you get the same.

Petr

On Tue, Jun 12, 2012 at 8:31 PM, Daniel Dekkers 
wrote:
> Ok, great, works.
> So I guess the little red stop-sign icons shown by Visual Studio 
> denote that these files are excluded from the build?
>
> Thanks,
> Daniel
>
>
> -Oorspronkelijk bericht-
> Van: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] Namens 
> Bill Hoffman
> Verzonden: dinsdag 12 juni 2012 19:41
> Aan: cmake@cmake.org
> Onderwerp: Re: [CMake] Adding "*.obj" geometry files...
>
> On 6/12/2012 1:10 PM, Daniel Dekkers wrote:
>> Hi,
>>
>> We are adding some resource files (XML files, shaders, etc.) to a 
>> Visual Studio project just to make them visible and accessible in the
IDE.
>>
>> We also add geometry files with the extension "obj". Visual Studio 
>> treats these as regular object files and starts using them during the
> build.
>>
>> Is there a way that we can "label" these obj files so Visual Studio 
>> leaves them alone?
>>
>> Kind Regards,
>>
>> Daniel Dekkers
>>
> Mark them as HEADER_FILE_ONLY .
>
>
> http://www.cmake.org/cmake/help/v2.8.8/cmake.html#prop_sf:HEADER_FILE_
> ONLY
>
> --
>
> 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

--

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] Preserving resource directory structure on bundle level in OSX and iOS

2012-06-14 Thread Daniel Dekkers
Hi,

If we add a set of resources to an application (OSX or iOS) with...

ADD_EXECUTABLE( ${APPNAME} MACOSX_BUNDLE ${ALLSOURCES} ${ALLRESOURCES} )

... where ALLRESOURCES contains references with complete paths (ie 
/path/rsrc/images/image.png, /path/rsrc/xml/data.xml, etc...)
and label these files as resources...

SET_TARGET_PROPERTIES( ${APPNAME} PROPERTIES RESOURCE "${ALLRESOURCES}" )

after having "grouped" them...

SOURCE_GROUP("Application/rsrc/xml" FILES ... )
SOURCE_GROUP("Application/rsrc/images" FILES ... )

... the files show up correctly in Xcode and are copied to the application 
bundle(s) (by Xcode, no POST_BUILD copy command).

But.. the hierarchy is flattened and gets lost on bundle level.

For an iOS application, the resources end up in APPNAME.app (directly in the 
root of the bundle, together with everything else).
For an OSX application, the resources end up in APPNAME.app/Contents/Resources 
(dedicated resources container).

Someone knows a way to preserve the hierarchy in the bundle?

For iOS something like:
APPNAME.app/rsrc/images/image.png
APPNAME.app/rsrc/xml/data.xml

and for OSX something like:

APPNAME.app/Contents/Resources/rsrc/images/image.png
APPNAME.app/Contents/Resources/rsrc/xml/data.xml

Thanks,
Daniel








--

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] Adding "*.obj" geometry files...

2012-06-13 Thread Daniel Dekkers
Sorry to keep bothering you guys...

Our problem now is that resource files could have the same names in
different folders.
The ADD_CUSTOM_COMMAND seems to create a rule "identifier" based on the name
of the resource file relative to the CMakeFiles directory.
But we have a "saveloadicon.png" in /images and a "saveloadicon.png" in
/textures, both trying to add a rule resulting in a conflict:

CMake Error: Attempt to add a custom rule to output
"C:/development/build/DEBUGBULLET/StyleClash//CMakeFiles/saveloadicon.png.ru
le" which already has a custom rule.

Is there a way to influence this rule identifier?

This is the ADD_CUSTOM_COMMAND we're using:

ADD_CUSTOM_COMMAND(OUTPUT
"${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH}"
 COMMAND ${CMAKE_COMMAND} -E copy_if_different
${RSRC_FILE} ${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH}
 DEPENDS "${RSRC_FILE}"
  )

Thanks,
Daniel

-Oorspronkelijk bericht-
Van: Petr Kmoch [mailto:petr.km...@gmail.com] 
Verzonden: woensdag 13 juni 2012 14:36
Aan: Daniel Dekkers
CC: Tim Hutton; J; cmake@cmake.org
Onderwerp: Re: [CMake] Adding "*.obj" geometry files...

You could use solution filters to put all the copy targets into one folder:

set_property(GLOBAL PROPERTY USE_FOLDERS TRUE) set_property(TARGET
${RESOURCESCOPYTARGET} PROPERTY FOLDER "Copy
Projects") #for each resource copy target

Petr

On Wed, Jun 13, 2012 at 2:26 PM, Daniel Dekkers 
wrote:
> Hi Tim,
>
> That works. In our case we get:
>
> # Additional dedicated "copy-the-resource-files-for-this-app"-target
> strategy.
> # Copies resource files to the build directory, triggered by a file 
> change in one of them.
> IF( RT_ALL_RSRC_FILES )
>        SET( RESOURCESCOPYTARGET "Copy${RT_APP_NAME}Resources" )
>        FOREACH( RSRC_FILE ${RT_ALL_RSRC_FILES} )
>                GET_FILENAME_COMPONENT(RSRC_FILE_NO_PATH ${RSRC_FILE} 
> NAME)
>                ADD_CUSTOM_COMMAND(
>                        OUTPUT
> "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH}"
>                        COMMAND ${CMAKE_COMMAND} -E copy_if_different 
> ${RSRC_FILE} 
> ${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH}
>                        DEPENDS "${RSRC_FILE}"
>                        )
>                LIST( APPEND DEPENDENT_RSRC_FILES 
> "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH}" )
>        ENDFOREACH()
>        ADD_CUSTOM_TARGET( ${RESOURCESCOPYTARGET} ALL DEPENDS 
> ${DEPENDENT_RSRC_FILES} )
>        ADD_DEPENDENCIES(${RT_APP_NAME} ${RESOURCESCOPYTARGET})
> ENDIF()
>
> Only "problem" are the extra targets shown in the IDE. A bit "cluttery".
> We have anywhere between 1 or 10 executables in a single solution and 
> they all get their own additional CopyResources target.
> But, ok...
>
> Thanks!
> Daniel
>
>
>
> -Oorspronkelijk bericht-
> Van: Tim Hutton [mailto:tim.hut...@gmail.com]
> Verzonden: woensdag 13 juni 2012 12:42
> Aan: Daniel Dekkers
> CC: Petr Kmoch; cmake@cmake.org; Bill Hoffman
> Onderwerp: Re: [CMake] Adding "*.obj" geometry files...
>
> You can group all the files to be copied into a single subproject.
>
> We do this here:
> http://reaction-diffusion.googlecode.com/svn/trunk/Ready/CMakeLists.tx
> t (see the section "copy installation files to build folder")
>
> On 13 June 2012 11:13, Daniel Dekkers  wrote:
>> Somewhat related...
>>
>> We now have the resources excluded from the build but visible in the 
>> IDE. So far so good.
>> But we also want to copy them (all) to the build directory.
>> We have a post build command that does that.
>> But if you only change the contents of one of the resource files, a 
>> rebuild is not invoked (exclude from build) and so the files are not
> copied.
>> For another project we made specific targets (ADD_CUSTOM_TARGET) just 
>> to handle the copying but that gives a lot of extra subprojects in 
>> the
> IDE.
>> Is there another way to achieve this?
>>
>> Thanks,
>> Daniel
>>
>> -Oorspronkelijk bericht-
>> Van: Petr Kmoch [mailto:petr.km...@gmail.com]
>> Verzonden: woensdag 13 juni 2012 8:10
>> Aan: Daniel Dekkers
>> CC: Bill Hoffman; cmake@cmake.org
>> Onderwerp: Re: [CMake] Adding "*.obj" geometry files...
>>
>> Hi Daniel.
>>
>> Yes, that's how Visual Studio shows excluded files. If you exclude a 
>> file by setting its "Excluded from build" property manually, you get 
>> the
> same.
>>

Re: [CMake] Adding "*.obj" geometry files...

2012-06-13 Thread Daniel Dekkers
Hi Tim,

That works. In our case we get:

# Additional dedicated "copy-the-resource-files-for-this-app"-target
strategy.
# Copies resource files to the build directory, triggered by a file change
in one of them.
IF( RT_ALL_RSRC_FILES )
SET( RESOURCESCOPYTARGET "Copy${RT_APP_NAME}Resources" )
FOREACH( RSRC_FILE ${RT_ALL_RSRC_FILES} )
GET_FILENAME_COMPONENT(RSRC_FILE_NO_PATH ${RSRC_FILE} NAME)
ADD_CUSTOM_COMMAND(
OUTPUT
"${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH}"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${RSRC_FILE} ${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH}
DEPENDS "${RSRC_FILE}"
)
LIST( APPEND DEPENDENT_RSRC_FILES
"${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RSRC_FILE_NO_PATH}" )
ENDFOREACH()
ADD_CUSTOM_TARGET( ${RESOURCESCOPYTARGET} ALL DEPENDS
${DEPENDENT_RSRC_FILES} )
ADD_DEPENDENCIES(${RT_APP_NAME} ${RESOURCESCOPYTARGET})
ENDIF()

Only "problem" are the extra targets shown in the IDE. A bit "cluttery".
We have anywhere between 1 or 10 executables in a single solution and they
all get their own additional CopyResources target.
But, ok... 

Thanks!
Daniel



-Oorspronkelijk bericht-
Van: Tim Hutton [mailto:tim.hut...@gmail.com] 
Verzonden: woensdag 13 juni 2012 12:42
Aan: Daniel Dekkers
CC: Petr Kmoch; cmake@cmake.org; Bill Hoffman
Onderwerp: Re: [CMake] Adding "*.obj" geometry files...

You can group all the files to be copied into a single subproject.

We do this here:
http://reaction-diffusion.googlecode.com/svn/trunk/Ready/CMakeLists.txt
(see the section "copy installation files to build folder")

On 13 June 2012 11:13, Daniel Dekkers  wrote:
> Somewhat related...
>
> We now have the resources excluded from the build but visible in the 
> IDE. So far so good.
> But we also want to copy them (all) to the build directory.
> We have a post build command that does that.
> But if you only change the contents of one of the resource files, a 
> rebuild is not invoked (exclude from build) and so the files are not
copied.
> For another project we made specific targets (ADD_CUSTOM_TARGET) just 
> to handle the copying but that gives a lot of extra subprojects in the
IDE.
> Is there another way to achieve this?
>
> Thanks,
> Daniel
>
> -Oorspronkelijk bericht-
> Van: Petr Kmoch [mailto:petr.km...@gmail.com]
> Verzonden: woensdag 13 juni 2012 8:10
> Aan: Daniel Dekkers
> CC: Bill Hoffman; cmake@cmake.org
> Onderwerp: Re: [CMake] Adding "*.obj" geometry files...
>
> Hi Daniel.
>
> Yes, that's how Visual Studio shows excluded files. If you exclude a 
> file by setting its "Excluded from build" property manually, you get the
same.
>
> Petr
>
> On Tue, Jun 12, 2012 at 8:31 PM, Daniel Dekkers 
> 
> wrote:
>> Ok, great, works.
>> So I guess the little red stop-sign icons shown by Visual Studio 
>> denote that these files are excluded from the build?
>>
>> Thanks,
>> Daniel
>>
>>
>> -Oorspronkelijk bericht-
>> Van: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] Namens 
>> Bill Hoffman
>> Verzonden: dinsdag 12 juni 2012 19:41
>> Aan: cmake@cmake.org
>> Onderwerp: Re: [CMake] Adding "*.obj" geometry files...
>>
>> On 6/12/2012 1:10 PM, Daniel Dekkers wrote:
>>> Hi,
>>>
>>> We are adding some resource files (XML files, shaders, etc.) to a 
>>> Visual Studio project just to make them visible and accessible in 
>>> the
> IDE.
>>>
>>> We also add geometry files with the extension "obj". Visual Studio 
>>> treats these as regular object files and starts using them during 
>>> the
>> build.
>>>
>>> Is there a way that we can "label" these obj files so Visual Studio 
>>> leaves them alone?
>>>
>>> Kind Regards,
>>>
>>> Daniel Dekkers
>>>
>> Mark them as HEADER_FILE_ONLY .
>>
>>
>> http://www.cmake.org/cmake/help/v2.8.8/cmake.html#prop_sf:HEADER_FILE
>> _
>> ONLY
>>
>> --
>>
>> 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.co

Re: [CMake] Adding "*.obj" geometry files...

2012-06-13 Thread Daniel Dekkers
Somewhat related...

We now have the resources excluded from the build but visible in the IDE. So
far so good.
But we also want to copy them (all) to the build directory.
We have a post build command that does that. 
But if you only change the contents of one of the resource files, a rebuild
is not invoked (exclude from build) and so the files are not copied.
For another project we made specific targets (ADD_CUSTOM_TARGET) just to
handle the copying but that gives a lot of extra subprojects in the IDE.
Is there another way to achieve this?

Thanks,
Daniel

-Oorspronkelijk bericht-
Van: Petr Kmoch [mailto:petr.km...@gmail.com] 
Verzonden: woensdag 13 juni 2012 8:10
Aan: Daniel Dekkers
CC: Bill Hoffman; cmake@cmake.org
Onderwerp: Re: [CMake] Adding "*.obj" geometry files...

Hi Daniel.

Yes, that's how Visual Studio shows excluded files. If you exclude a file by
setting its "Excluded from build" property manually, you get the same.

Petr

On Tue, Jun 12, 2012 at 8:31 PM, Daniel Dekkers 
wrote:
> Ok, great, works.
> So I guess the little red stop-sign icons shown by Visual Studio 
> denote that these files are excluded from the build?
>
> Thanks,
> Daniel
>
>
> -Oorspronkelijk bericht-
> Van: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] Namens 
> Bill Hoffman
> Verzonden: dinsdag 12 juni 2012 19:41
> Aan: cmake@cmake.org
> Onderwerp: Re: [CMake] Adding "*.obj" geometry files...
>
> On 6/12/2012 1:10 PM, Daniel Dekkers wrote:
>> Hi,
>>
>> We are adding some resource files (XML files, shaders, etc.) to a 
>> Visual Studio project just to make them visible and accessible in the
IDE.
>>
>> We also add geometry files with the extension "obj". Visual Studio 
>> treats these as regular object files and starts using them during the
> build.
>>
>> Is there a way that we can "label" these obj files so Visual Studio 
>> leaves them alone?
>>
>> Kind Regards,
>>
>> Daniel Dekkers
>>
> Mark them as HEADER_FILE_ONLY .
>
>
> http://www.cmake.org/cmake/help/v2.8.8/cmake.html#prop_sf:HEADER_FILE_
> ONLY
>
> --
>
> 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

--

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] Adding "*.obj" geometry files...

2012-06-12 Thread Daniel Dekkers
Ok, great, works.
So I guess the little red stop-sign icons shown by Visual Studio denote that
these files are excluded from the build?

Thanks,
Daniel


-Oorspronkelijk bericht-
Van: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] Namens Bill
Hoffman
Verzonden: dinsdag 12 juni 2012 19:41
Aan: cmake@cmake.org
Onderwerp: Re: [CMake] Adding "*.obj" geometry files...

On 6/12/2012 1:10 PM, Daniel Dekkers wrote:
> Hi,
>
> We are adding some resource files (XML files, shaders, etc.) to a 
> Visual Studio project just to make them visible and accessible in the IDE.
>
> We also add geometry files with the extension "obj". Visual Studio 
> treats these as regular object files and starts using them during the
build.
>
> Is there a way that we can "label" these obj files so Visual Studio 
> leaves them alone?
>
> Kind Regards,
>
> Daniel Dekkers
>
Mark them as HEADER_FILE_ONLY .


http://www.cmake.org/cmake/help/v2.8.8/cmake.html#prop_sf:HEADER_FILE_ONLY

--

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] Adding "*.obj" geometry files...

2012-06-12 Thread Daniel Dekkers
Hi, 

 

We are adding some resource files (XML files, shaders, etc.) to a Visual
Studio project just to make them visible and accessible in the IDE.

We also add geometry files with the extension "obj". Visual Studio treats
these as regular object files and starts using them during the build.

Is there a way that we can "label" these obj files so Visual Studio leaves
them alone?

 

Kind Regards,

Daniel Dekkers

 

 

--

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] iOS application with seperate libs archiving problem...

2012-04-03 Thread Daniel Dekkers
David, concerning this bug on the roadmap for 2.8-8...

http://www.cmake.org/Bug/view.php?id=12640

Things seem to have improved since Xcode 4.3/iOS5.1.
The lib is now correctly built at the correct location, i.e. 
[cmakebuilddirectory]/[libname]/[configuration]-iphoneos (with configuration 
Debug, Release, ...).

You still have to edit the scheme to make sure a Release build of the lib is 
performed (it's not automatically triggered by the archive build).
But ok,.. after that... it archives.
Wow

Thanks, 
Daniel Dekkers

--

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] CMake 2.8-8 rc1 and Xcode 4.3

2012-03-27 Thread Daniel Dekkers
I have Lion, sorry, wrong info about Snow Leopard.

What I did to get it working was...

sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer

... which "selects the right Xcode". Although I think I've uninstalled the 
previous version.

Now changing the other paths from /Developer to /Applications. 
-sigh-
Although actually it's ok, I didn't like Xcode not being in the /Applications 
folder anyway.

Thanks,
Daniel

On Mar 27, 2012, at 5:34 PM, Sean McBride wrote:

> On Tue, 27 Mar 2012 16:59:07 +0200, Daniel Dekkers said:
> 
>> I've upgraded to Xcode 4.3 and CMake to 2.8-8 rc1 on a Snow Leopard system.
> 
> Xcode 4.3 requires Mac OS X 10.7 Lion.  On 10.6, the last version you can use 
> is 4.2.  See:
> <http://en.wikipedia.org/wiki/Xcode>
> 
> --
> 
> 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


[CMake] CMake 2.8-8 rc1 and Xcode 4.3

2012-03-27 Thread Daniel Dekkers
Hi,

I've upgraded to Xcode 4.3 and CMake to 2.8-8 rc1 on a Snow Leopard system.
When configuring from the CMake GUI, I get:

CMake Error at /Applications/CMake 
2.8-8.app/Contents/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 
(MESSAGE):
The C compiler "/usr/bin/gcc" is not able to compile a simple test program.

It fails with the following output:

Change Dir: 
/Users/danieldekkers/development/rendertools/examples/MeshTest/build/ES1/DEBUG/CMakeFiles/CMakeTmp

Run Build Command:/Applications/CMake\ 2.8-8.app/Contents/bin/cmakexbuild
-project CMAKE_TRY_COMPILE.xcodeproj build -target
cmTryCompileExec4035594004 -configuration Debug

Error: No developer directory found at /Developer. Run
/usr/bin/xcode-select to update the developer directory path.

Is this a known problem?

Thanks,
Daniel Dekkers--

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] apply for maintainer of FindOpenCL.cmake

2012-02-24 Thread Daniel Dekkers
It would be nice to have an OpenCL find module. But it should include easy 
access to the Intel and NVIDIA libraries as well, I think, not just AMD. And 
what about the different OpenCL versions? And does it work on Mac OS as well? 
Finding the OpenCL framework?

Daniel

Op 24 feb. 2012 om 06:00 heeft Michael Wild  het volgende 
geschreven:

> On 02/24/2012 10:52 AM, yao wang wrote:
>> Hi,
>> We've written a module finding AMD's APP SDK's "include" abd "library"
>> paths. And set  "OPENCL_INCLUDE_DIR" and "OPENCL_LIBRARY", which are
>> useful for compiling OpenCL programs. Is it possible for me to
>> contribute to the share modules and make it included in next release?
>> 
>> Thanks!
> 
> 
> You'll want to read this:
> http://www.vtk.org/Wiki/CMake:Module_Maintainers
> 
> 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
--

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] Boost_DIR

2012-01-11 Thread Daniel Dekkers
Hi, does anyone know what this "Boost_DIR" variable is from the
findBoost.cmake module? And why it is never found? 

Everything works well, I use BOOST_ROOT to set the path to the Boost
distribution, just curious.

Daniel

--

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] Changing "PROJECT" level build settings in Xcode

2012-01-09 Thread Daniel Dekkers
Hi, 

In Xcode, can I change build settings at "PROJECT" level via CMake?
SET_TARGET_PROPERTIES() always seems to work on "TARGETS" level.

Thanks,
Daniel Dekkers

--

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] Bug fix requests for the *next* release of CMake...

2012-01-07 Thread Daniel Dekkers
Xcode stuff would be great...
http://public.kitware.com/Bug/view.php?id=12640
http://public.kitware.com/Bug/view.php?id=12506
http://public.kitware.com/Bug/view.php?id=12532

On Jan 2, 2012, at 6:11 PM, David Cole wrote:

> Hi all,
> 
> Replies requested. Short replies only. Read on. Just a short reply
> with bug numbers or links to the bugs is all we need here. Please move
> specific discussions into the bugs themselves or start a new thread to
> talk about it... Replies on this thread should just be a collector for
> bug numbers.
> 
> Example one-line reply:
> 
>  http://public.kitware.com/Bug/view.php?id=12647
> 
> We are aiming for quarterly releases from now on, scheduling them
> every 3 months. That would make the next release of CMake version
> 2.8.8, scheduled to have an "rc1" release candidate on Wed. March 7,
> 2012 -- just 9 weeks from this Wednesday.
> 
> If you have a particular issue that you think should be fixed for
> inclusion in 2.8.8, please bring it up within the next two weeks.
> Ideally, each issue will be discussed as needed on the mailing list to
> come to any consensus about what should be done to fix it, and then an
> entry in the bug tracker may be used to keep it on the radar screen,
> and to track activity related to it. You can see what's on the roadmap
> for this release here:
> http://public.kitware.com/Bug/roadmap_page.php?version_id=90
> 
> Patches are always welcome. Patches that include testing of any new
> features, or tests that prove a bug is really fixed on the dashboards,
> basically any patch with testing is preferred over a patch with no
> testing. Also, if you are *adding* code, then you also probably need
> to add *tests* of that code, so that the coverage percentage stays as
> is or rises.
> 
> Please discuss issues here as needed, and add notes to existing issues
> in the bug tracker that you are interested in seeing fixed -- we will
> be looking at the mailing list and activity in the bug tracker to help
> prioritize the bug fixes that will occur in the near future.
> 
> 
> Thanks,
> David Cole
> Kitware, Inc.
> 
> 
> P.S. - as a nice summary of what we accomplished in the CMake 2.8.7
> release, see here:
> http://public.kitware.com/Bug/changelog_page.php?version_id=89
> -- it currently lists 43 issues that we resolved: nice job, everybody!
> 
> (Many of those were specifically addressed because somebody brought it
> up in response to my similar email from just after the last release...
> Don't be shy!)
> --
> 
> 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] file(GLOB …)

2011-12-23 Thread Daniel Dekkers
Yeah, ok, thanks.
It actually does go wrong. You intend "all model files with *.obj extension" 
and suddenly it starts including C++ object files as well.
But it's a bit of a pity to discard your "find all files in a specific 
category" script, included by all your apps, and start enumerating every file 
individually.

On Dec 23, 2011, at 5:20 PM, David Cole wrote:

> On Fri, Dec 23, 2011 at 10:45 AM, Rolf Eike Beer  wrote:
>> Daniel Dekkers wrote:
>>> On 12/21/2011 05:25 PM, André Caron wrote:
>>> Get rid of the file(GLOB ...). Never, ever use it unless you know
>>> exactly what you're doing. Using it usually breaks something.
>>> 
>>> On Dec 21, 2011, at 5:59 PM, David Cole wrote:
>>> I agree with the advice to get rid of file(GLOB
>>> 
>>> What's the alternative. Enumerate all your filenames by hand?
>> 
>> Yes. This is no real problem as you need to do this only once. You can even
>> use the current CMake code to MESSAGE() out whatever CMake currently finds
>> using FILE(GLOB) and just copy that into your CMakeLists.txt
>> 
>> Eike
>> --
>> 
>> --
>> 
>> 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
> 
> 
> Just to clarify: the point of enumerating all your files in the
> CMakeLists.txt file is so that when you add or remove a file, the
> CMakeLists file changes, and can trigger a re-run of CMake based on
> the usual "make' file dependency tracking.
> 
> If you don't do it, and you use glob instead, then CMake does not know
> when you've added or removed files from the file system, and so cannot
> re-run automatically when (and only when) necessary.
> 
> To use glob *and* get this sort of behavior, we'd have to institute
> some sort of file-system-watcher that's always running. We don't
> really want to get into the business of monitoring your disk for file
> adds and removes...
> 
> 
> :-)
> 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

--

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] file(GLOB …)

2011-12-23 Thread Daniel Dekkers
On 12/21/2011 05:25 PM, André Caron wrote:
Get rid of the file(GLOB ...). Never, ever use it unless you know
exactly what you're doing. Using it usually breaks something.

On Dec 21, 2011, at 5:59 PM, David Cole wrote:
I agree with the advice to get rid of file(GLOB

What's the alternative. Enumerate all your filenames by hand?

--

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] iOS Archiving (again)

2011-12-13 Thread Daniel Dekkers
Hi,

I'm starting to get really worried about the iOS archiving when having to link 
to a static library. I'm writing an article where I'm "selling" CMake as a way 
to do cross-platform development for OpenGL/ES applications, including iOS. I 
have to decide now if I have to put a disclaimer in the article, delimiting 
CMake iOS builds to builds without  static libraries, which will put people 
off. A disclaimer would frustrate me very much because it feels like iOS 
support is *almost* on top of the hill (like 99%). The applications work, on 
devices and simulators, code signing, resources, everything. The only thing is 
archiving, which shouldn't really be that big of a deal anyway. But it is, and 
it's essential in the sense that if you can't archive, you can't distribute 
your application. It would feel wrong not warning readers about that.

Please let me know what you think. Should i feel confident that "it will work 
eventually", in say three months, before the book comes out. Or is there some 
structural problem going on, more than lack of interest. 

Thanks,
Daniel

On Dec 10, 2011, at 1:34 PM, Daniel Dekkers wrote:

> One more... 
> A (the main?) difference between building and archiving:
> 
> Building Functions phase:
> Build Functions
> ...
>  Libtool build/Release-iphoneos/libFunctions.a normal armv7
> ...
> 
> Archiving Functions phase:
> Build Functions
> ...
>  Libtool 
> Users/danieldekkers/Library/Developer/Xcode/DerivedData/[blabla]/libFunctions.a
>  normal armv7
> ...
> 
> So, during a normal build, the library is placed in build/Release-iphoneos/. 
> But when archiving it is placed in the "new" (since Xcode 4 I think) 
> DerivedData folder. 
> In the second case, the application won't find it while linking.
> 
> It's annoying that Xcode forces its own out-of-source build system which 
> introduces complications, when we've got that aspect covered with CMake.
> 
> Thanks,
> Daniel
> 
> On Dec 9, 2011, at 4:41 PM, daniel dekkers wrote:
> 
>> Hi,
>> 
>> A small step in the iOS release archiving problem.
>> Note, this is all Xcode 4.0.2, Xcode 4.2 (the LLVM GCC compiler) doesn't 
>> specify the error (more than "1"), so is basically unworkable. At least the 
>> "old" GCC 4.2 compiler tells you what is going on.
>> 
>> For archiving to work on iOS (OSX don't know) you have to set "skip install" 
>> to "yes" for all static libs you might be using, so they don't end up in the 
>> final product:
>> http://developer.apple.com/library/ios/#technotes/tn2215/_index.html
>> 
>> So, in the iOSNavApp example from the CMake test suite, which uses a library 
>> named Functions I set this "skip install" property to "yes" in the Functions 
>> target, and to "no" for the application target itself.
>> But then, during the link phase of a release archive step, the compiler can 
>> not find the library in /path/to/build/Release-iphoneos (libFunctions.a not 
>> found). Xcode doesn't copy the lib to this destination directory, could be 
>> related to:
>> http://www.cmake.org/Bug/bug_relationship_graph.php?bug_id=12506&graph=dependency
>> 
>> My "solution" now is to split the process in two phases:
>> 1) Set "skip install" to "no" for both targets (library and application) and 
>> do a (release) archive. This will result in a corrupt ipa but at least the 
>> lib is built and copied.
>> 2) Set "skip install" to "yes" for the lib and do an archive again. Now it 
>> will create a proper ipa.
>> 
>> Hope this helps a bit. Mainly in battling 
>> http://developer.apple.com/library/ios/#technotes/tn2215/_index.html
>> 
>> Thanks, Daniel
>> 
>> 
>> --
>> 
>> 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

--

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] iOS Archiving (again)

2011-12-10 Thread Daniel Dekkers
One more... 
A (the main?) difference between building and archiving:

Building Functions phase:
Build Functions
...
  Libtool build/Release-iphoneos/libFunctions.a normal armv7
...

Archiving Functions phase:
Build Functions
...
  Libtool 
Users/danieldekkers/Library/Developer/Xcode/DerivedData/[blabla]/libFunctions.a 
normal armv7
...

So, during a normal build, the library is placed in build/Release-iphoneos/. 
But when archiving it is placed in the "new" (since Xcode 4 I think) 
DerivedData folder. 
In the second case, the application won't find it while linking.

It's annoying that Xcode forces its own out-of-source build system which 
introduces complications, when we've got that aspect covered with CMake.

Thanks,
Daniel

On Dec 9, 2011, at 4:41 PM, daniel dekkers wrote:

> Hi,
> 
> A small step in the iOS release archiving problem.
> Note, this is all Xcode 4.0.2, Xcode 4.2 (the LLVM GCC compiler) doesn't 
> specify the error (more than "1"), so is basically unworkable. At least the 
> "old" GCC 4.2 compiler tells you what is going on.
> 
> For archiving to work on iOS (OSX don't know) you have to set "skip install" 
> to "yes" for all static libs you might be using, so they don't end up in the 
> final product:
> http://developer.apple.com/library/ios/#technotes/tn2215/_index.html
> 
> So, in the iOSNavApp example from the CMake test suite, which uses a library 
> named Functions I set this "skip install" property to "yes" in the Functions 
> target, and to "no" for the application target itself.
> But then, during the link phase of a release archive step, the compiler can 
> not find the library in /path/to/build/Release-iphoneos (libFunctions.a not 
> found). Xcode doesn't copy the lib to this destination directory, could be 
> related to:
> http://www.cmake.org/Bug/bug_relationship_graph.php?bug_id=12506&graph=dependency
> 
> My "solution" now is to split the process in two phases:
> 1) Set "skip install" to "no" for both targets (library and application) and 
> do a (release) archive. This will result in a corrupt ipa but at least the 
> lib is built and copied.
> 2) Set "skip install" to "yes" for the lib and do an archive again. Now it 
> will create a proper ipa.
> 
> Hope this helps a bit. Mainly in battling 
> http://developer.apple.com/library/ios/#technotes/tn2215/_index.html
> 
> Thanks, Daniel
> 
> 
> --
> 
> 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] iOS Archiving (again)

2011-12-09 Thread Daniel Dekkers
Hi,

A small step in the iOS release archiving problem.
Note, this is all Xcode 4.0.2, Xcode 4.2 (the LLVM GCC compiler) doesn't 
specify the error (more than "1"), so is basically unworkable. At least the 
"old" GCC 4.2 compiler tells you what is going on.

For archiving to work on iOS (OSX don't know) you have to set "skip install" to 
"yes" for all static libs you might be using, so they don't end up in the final 
product:
http://developer.apple.com/library/ios/#technotes/tn2215/_index.html

So, in the iOSNavApp example from the CMake test suite, which uses a library 
named Functions I set this "skip install" property to "yes" in the Functions 
target, and to "no" for the application target itself.
But then, during the link phase of a release archive step, the compiler can not 
find the library in /path/to/build/Release-iphoneos (libFunctions.a not found). 
Xcode doesn't copy the lib to this destination directory, could be related to:
http://www.cmake.org/Bug/bug_relationship_graph.php?bug_id=12506&graph=dependency

My "solution" now is to split the process in two phases:
1) Set "skip install" to "no" for both targets (library and application) and do 
a (release) archive. This will result in a corrupt ipa but at least the lib is 
built and copied.
2) Set "skip install" to "yes" for the lib and do an archive again. Now it will 
create a proper ipa.

Hope this helps a bit. Mainly in battling 
http://developer.apple.com/library/ios/#technotes/tn2215/_index.html

Thanks, Daniel


--

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] Build doesn't work with Mac OS X Lion...

2011-12-08 Thread Daniel Dekkers
Adventures reverse engineering...
Turning the thread in the direction of iOS, sorry about that, but similar 
problems I think.

If I don't fill in any CMake architecture related variables at all, I get a 
"standard" Mac OS X app for Intel. But universal, both 32/64 bit, very 
impressive:

Architectures   Standard (32/64-bit Intel) - 
$(ARCHS_STANDARD_32_64_BIT)
Base SDK/Developer/SDKs/MacOSX10.7.sdk
Build Active Architecture Only  Yes
Supported Platforms macosx
Valid Architectures i386 x86_64

Now I would like an iOS app.
If I *only* change the root SDK (to iOS 5.0 in my case) the project files are 
automagically changed to a default iOS app, set(CMAKE_OSX_SYSROOT 
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk) results 
in:

Architectures   $(ARCHS_STANDARD_32_64_BIT) - 
$(ARCHS_STANDARD_32_64_BIT)
Base SDK
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk
Build Active Architecture Only  Yes
Supported Platforms iphonesimulator iphoneos
<- smart
Valid Architectures armv6 armv7 
<- smart

But, the Architectures field is not "substituted". Xcode doesn't know how to 
handle "$(ARCHS_STANDARD_32_64_BIT)" in an iOS context. 
I *have* to choose something for CMAKE_OSX_ARCHITECTURES at this point (feels 
like a forced move).
Ok, I choose: set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_BIT)"), inspired 
by Xcodes standard iOS templates. This results in:

Architectures   Standard (armv7) - 
$(ARCHS_STANDARD_32_BIT)
Base SDK
/Developer/Plattforms/[blabla]/iPhoneOS5.0.sdk
Build Active Architecture Only  Yes
Supported Platforms iphonesimulator iphoneos
Valid Architectures armv6 armv7

Ok, now Xcode can substitute for its Architectures field.
The project builds and runs after I add set(CMAKE_XCODE_EFFECTIVE_PLATFORMS 
"-iphoneos;-iphonesimulator") setting, but that's more about finding a library.
Device run works, Simulator run works. It just doesn't archive, in release mode 
(but i've been staring at that problem for weeks).

So iOS in a nutshell, three lines:

set(CMAKE_OSX_SYSROOT SDKROOT 
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk)
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_BIT)")
set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator")

I'm not fiddling with anything else (CMAKE_XCODE_EFFECTIVE_PLATFORMS for 
instance, or compiler choice). If it's not broke, don't fix it.

Now if only iOS (release) archiving would work, i'd be very happy.

Thanks, Daniel


On Dec 8, 2011, at 5:54 PM, Michael Jackson wrote:

> Maybe this will help:
> 
> On Lion 10.7.x (and I think Snow Leopard 10.6.x) if you leave the 
> CMAKE_OSX_ARCHITECTURES blank you will get the default compile which is 
> x86_64 (64 bit). OS X 10.5 and below you will get i386 (32 bit).
> 
> If you want to specifically build for certain architectures then fill in the 
> CMAKE_OSX_ARCHITECTURES with any of the following:
> i386
> x86_64
> ppc
> ppc64
>  The PowerPC (ppc) archs I think you can only build for if you build against 
> the 10.5 SDK. (Someone else can verify that). If you want to build a 
> "Universal Binary" then put multiple values on a single line like so:
> 
> CMAKE_OSX_ARCHITECTURES   i386;x86_64
> 
> All of this is for OS X Applications. I have no idea how any of this relates 
> to iOS development.
> --
> Mike Jackson 
> 
> On Dec 8, 2011, at 11:49 AM, Daniel Dekkers wrote:
> 
>> Hi,
>> 
>> And which one is which?
>> In Xcode (4.2), Lion, 64 bit Intel platform, a standard Xcode Mac OS X 
>> "template" will give these build settings in the Architectures section:
>> 
>> Architectures
>>  Additional SDKs
>>  Architectures   64-bit Intel - 
>> $(ARCHS_STANDARD_64_BIT) (this last value is grayed out)
>>  Base SDKLatest Mac OS X (Mac OS 
>> X 10.7)
>>  Build Active Architecture Only  
>>  Supported Platforms macosx
>>  Valid Architectures i386 x86_64
>> 
>> I always thought that the CMAKE_OSX_ARCHITECTURES value corresponded with 
>> the "first" Architectures Xcode field. So I set:
>> set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_64_BIT)") in my CMake builds.
>> But with your last mail i

Re: [CMake] Build doesn't work with Mac OS X Lion...

2011-12-08 Thread Daniel Dekkers
Hi,

And which one is which?
In Xcode (4.2), Lion, 64 bit Intel platform, a standard Xcode Mac OS X 
"template" will give these build settings in the Architectures section:

Architectures
  Additional SDKs
  Architectures 64-bit Intel - 
$(ARCHS_STANDARD_64_BIT) (this last value is grayed out)
  Base SDK  Latest Mac OS X (Mac OS 
X 10.7)
  Build Active Architecture Only
  Supported Platforms   macosx
  Valid Architectures   i386 x86_64

I always thought that the CMAKE_OSX_ARCHITECTURES value corresponded with the 
"first" Architectures Xcode field. So I set:
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_64_BIT)") in my CMake builds.
But with your last mail i'm confused if it corresponds to the Valid 
Architectures field instead. 
Or are these fields related? 64-bit Intel *implies* i386 and x86_64, although 
you could remove one of the two.

For an iOS "template" on the same system I get this:

Architectures
  Additional SDKs
  Architectures Standard (armv7) - 
$(ARCHS_STANDARD_32_BIT) (this last value is grayed out)
  Base SDK  
/Developer/[blabla]/iPhoneOS5.0.sdk
  Build Active Architecture OnlyNo
  Supported Platforms   iphonesimulator iphoneos
  Valid Architectures   armv6 armv7

Thanks,
Daniel

On Dec 8, 2011, at 3:35 PM, Nicolas Rannou wrote:

> What about moving to 64 bits?
> (which I guess is more relevant for Lion apps)
> 
> In your build directory:
> ccmake .
> Then modify:
> CMAKE_OSX_ARCHITECTURES  x86_64   
>  CMAKE_OSX_DEPLOYMENT_TARGET  10.7
>  
>  CMAKE_OSX_SYSROOT/Developer/SDKs/MacOSX10.7.sdk
> 
> Nicolas
> 
> On Tue, Dec 6, 2011 at 5:35 PM, Dick Munroe  wrote:
> Yes I'm using 2.8.6.  Best,  Dick Munroe
> 
> 
> On 11/26/11 11:18 AM, David Cole wrote:
> Are you using CMake 2.8.6...? Older CMake versions have not been used
> much on Lion. It wouldn't surprise me if 2.8.6 works, but earlier
> versions have issues...
> 
> 
> HTH,
> David
> 
> 
> On Sat, Nov 26, 2011 at 6:37 AM, Daniel Dekkers  wrote:
> This:
> 
> SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_BIT)")
> seems to result in a "standard" Xcode setting (armv7 (standard)) which is 
> also set when you let Xcode create a fresh iOS app (from its own templates).
> 
> But you also see this a lot on the fora:
> SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_UNIVERSAL_IPHONE_OS)")
> 
> Not sure.
> 
> On Nov 26, 2011, at 4:38 AM, Michael Jackson wrote:
> 
> There is a cmake variable that you set during  onfiguration time.
> Something like os_x_architectures. There you can add the specific arch
> that you want to build for.
> 
> -
> Mike Jackson www.bluequartz.net
> Principal Software Engineer   mike.jack...@bluequartz.net
> BlueQuartz Software   Dayton, Ohio
> 
> Sent from my mobile device. Please excuse the shortness of the reply.
> 
> On Nov 25, 2011, at 14:47, Dick Munroe  wrote:
> 
> I've got a build that works just fine with Leopard.
> 
> For reasons I won't get into, I had to upgrade one of my systems to Lion and 
> now (I've installed XCode 4.2) the build won't work.  I get the following 
> error:
> 
> [  0%] Reaping winning child 0x10260c510 PID 1009
> Live child 0x10260c510 
> (libxp/CMakeFiles/xp.dir/Users/munroe/Documents/My_SVN/ESPlanner_Computation_Engine.U2011-11-01/Common/xmllib/print/libxp.cpp.o)
>  PID 1010
> Building CXX object 
> libxp/CMakeFiles/xp.dir/Users/munroe/Documents/My_SVN/ESPlanner_Computation_Engine.U2011-11-01/Common/xmllib/print/libxp.cpp.o
> Reaping winning child 0x10260c510 PID 1010
> Live child 0x10260c510 
> (libxp/CMakeFiles/xp.dir/Users/munroe/Documents/My_SVN/ESPlanner_Computation_Engine.U2011-11-01/Common/xmllib/print/libxp.cpp.o)
>  PID 1011
> llvm-g++-4.2: Invalid arch name : -O2
> Reaping losing child 0x10260c510 PID 1011
> make[2]: *** 
> [libxp/CMakeFiles/xp.dir/Users/munroe/Documents/My_SVN/ESPlanner_Computation_Engine.U2011-11-01/Common/xmllib/print/libxp.cpp.o]
>  Error 1
> Removing child 0x10260c510 PID 1011 from chain.
> Reaping losing child 0x10c20c290 PID 1008
> make[1]: *** [libxp/CMakeFiles/xp.dir/all] Error 2
> Removing child 0x10c20c290 PID 1008 from chain.
> Reaping losing child 0x10940e730 PID 996
> 
> If I dig around, I find the CXX flags to be:
> 
> -arch  -O2 -fPIC
> 
> and for

[CMake] hear hear

2011-12-06 Thread Daniel Dekkers
On Dec 4, 2011, at 11:59 AM, Michael Jackson wrote:
> I think if the CMake community took a vote we could probably come up with an 
> "Exemplar" Find*.cmake file that is good for someone trying to develop a new 
> one.

Yes please.
And I think in general that is true. Of course it is more interesting and often 
more urgent to spend time on "exotic" problems. But there are these basics that 
are missing in the documentation.
Like,.. this works in 99% of the cases, we, CMake, advise you to do this. If 
you don't, you are making life hard on yourself and you are more or less on 
your own.
Something like:
1) a single executable
2) a single executable linked to a lib built from source
3) different executables using the same lib built from source
4) a single executable linked to a binary lib (with the aid of a find module)
...
n) multiple executables linked to multiple libraries (linked to third-party 
libraries), some static, some dynamic, some with their own CMake builds, some 
without, on different platforms. Auch.
n+1) making anything work with Xcode

"Buy the book" is a good response of course. But people don't do that, until 3 
months later.

Thanks, 
Daniel 
--

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] Build doesn't work with Mac OS X Lion...

2011-11-26 Thread Daniel Dekkers
This:

SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_BIT)")
seems to result in a "standard" Xcode setting (armv7 (standard)) which is also 
set when you let Xcode create a fresh iOS app (from its own templates).

But you also see this a lot on the fora:
SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_UNIVERSAL_IPHONE_OS)")

Not sure.

On Nov 26, 2011, at 4:38 AM, Michael Jackson wrote:

> There is a cmake variable that you set during  onfiguration time.
> Something like os_x_architectures. There you can add the specific arch
> that you want to build for.
> 
> -
> Mike Jackson www.bluequartz.net
> Principal Software Engineer   mike.jack...@bluequartz.net
> BlueQuartz Software   Dayton, Ohio
> 
> Sent from my mobile device. Please excuse the shortness of the reply.
> 
> On Nov 25, 2011, at 14:47, Dick Munroe  wrote:
> 
>> I've got a build that works just fine with Leopard.
>> 
>> For reasons I won't get into, I had to upgrade one of my systems to Lion and 
>> now (I've installed XCode 4.2) the build won't work.  I get the following 
>> error:
>> 
>> [  0%] Reaping winning child 0x10260c510 PID 1009
>> Live child 0x10260c510 
>> (libxp/CMakeFiles/xp.dir/Users/munroe/Documents/My_SVN/ESPlanner_Computation_Engine.U2011-11-01/Common/xmllib/print/libxp.cpp.o)
>>  PID 1010
>> Building CXX object 
>> libxp/CMakeFiles/xp.dir/Users/munroe/Documents/My_SVN/ESPlanner_Computation_Engine.U2011-11-01/Common/xmllib/print/libxp.cpp.o
>> Reaping winning child 0x10260c510 PID 1010
>> Live child 0x10260c510 
>> (libxp/CMakeFiles/xp.dir/Users/munroe/Documents/My_SVN/ESPlanner_Computation_Engine.U2011-11-01/Common/xmllib/print/libxp.cpp.o)
>>  PID 1011
>> llvm-g++-4.2: Invalid arch name : -O2
>> Reaping losing child 0x10260c510 PID 1011
>> make[2]: *** 
>> [libxp/CMakeFiles/xp.dir/Users/munroe/Documents/My_SVN/ESPlanner_Computation_Engine.U2011-11-01/Common/xmllib/print/libxp.cpp.o]
>>  Error 1
>> Removing child 0x10260c510 PID 1011 from chain.
>> Reaping losing child 0x10c20c290 PID 1008
>> make[1]: *** [libxp/CMakeFiles/xp.dir/all] Error 2
>> Removing child 0x10c20c290 PID 1008 from chain.
>> Reaping losing child 0x10940e730 PID 996
>> 
>> If I dig around, I find the CXX flags to be:
>> 
>> -arch  -O2 -fPIC
>> 
>> and for some reason the Lion g++ compiler is choking thinking that there 
>> should be and arch value.  Which if I dig around in the Leopard build I find:
>> 
>> -Dxp_EXPORTS  -arch i386 -O2 -g -fPIC
>> 
>> Which brings up the questions, (1) with the same CMakeLists.txt file, why am 
>> I getting different values and (2) how do I get the arch to be i386 on the 
>> Lion build.
>> 
>> Best,
>> 
>> Dick Munroe
>> 
>> --
>> 
>> 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

--

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] iOS Archiving (Xcode 4.2, Lion, CMake2.8-6)

2011-11-25 Thread Daniel Dekkers
Hi,

Has anyone managed to perform a successful iOS Archiving pass yet?

Our apps run on the simulator (both iPhone (5.0) and iPad (5.0)) and on the 
actual devices iPhone 3GS (5.0.1) and iPad2 (5.0.1), but archiving always gives 
a link error:

Ld 
/Users/danieldekkers/Library/Developer/Xcode/DerivedData/All-fgyaqwkvsryjkhbiepprnmdcager/ArchiveIntermediates/Discs/InstallationBuildProductsLocation/Application/Discs.app/Discs
 normal armv7
cd /Users/danieldekkers/development
setenv IPHONEOS_DEPLOYMENT_TARGET 4.3
setenv PATH 
"/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang++ -arch 
armv7 -isysroot 
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk 
-L/Users/danieldekkers/Library/Developer/Xcode/DerivedData/All-fgyaqwkvsryjkhbiepprnmdcager/ArchiveIntermediates/Discs/BuildProductsPath/Release-iphoneos
 
-F/Users/danieldekkers/Library/Developer/Xcode/DerivedData/All-fgyaqwkvsryjkhbiepprnmdcager/ArchiveIntermediates/Discs/BuildProductsPath/Release-iphoneos
 -filelist 
/Users/danieldekkers/Library/Developer/Xcode/DerivedData/All-fgyaqwkvsryjkhbiepprnmdcager/ArchiveIntermediates/Discs/IntermediateBuildFilesPath/All.build/Release-iphoneos/Discs.build/Objects-normal/armv7/Discs.LinkFileList
 -dead_strip -ObjC -framework OpenGLES -framework UIKit -framework Foundation 
-framework CoreGraphics -framework QuartzCore -framework CoreData -framework 
Coremotion -Wl,-search_paths_first -Wl,-headerpad_max_install_names 
/Users/danieldekkers/development/build/iOS/ES1/rendertools/src/Rel
 ease-iphoneos/libRenderTools.a -lz -miphoneos-version-min=4.3 -o 
/Users/danieldekkers/Library/Developer/Xcode/DerivedData/All-fgyaqwkvsryjkhbiepprnmdcager/ArchiveIntermediates/Discs/InstallationBuildProductsLocation/Application/Discs.app/Discs
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang++ failed 
with exit code 1

This is a problem, because you have to archive an ipa file, AdHoc or AppStore 
to ship your application.

These are our IOS specific settings at the moment, lots of trial-and-error, but 
at least they work on the simulator and attached devices:

IF( RT_IOS )
# "Toolchain" settings can (for the time being) just be included...
SET (CMAKE_SYSTEM_NAME Generic)
SET (CMAKE_SYSTEM_VERSION 1)
SET (CMAKE_SYSTEM_PROCESSOR arm)

SET (RT_SDKVER "5.0" CACHE PATH "iOS SDK version" )
SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${RT_SDKVER}.sdk")
IF( EXISTS ${SDKROOT} )
SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
ELSE()
MESSAGE( "Warning, iOS SDK path not found: " ${SDKROOT})
ENDIF()
SET (CMAKE_OSX_ARCHITECTURES "$(ARCHS_UNIVERSAL_IPHONE_OS)") # Either 
"$(ARCHS_UNIVERSAL_IPHONE_OS)" or "arm6" "arm7"

# SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc")  # Can be 
removed, just let Xcode choose the default.
# SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++")# Can be 
removed, just let Xcode choose the default.

SET (CMAKE_FIND_ROOT_PATH "${DEVELOPMENT_ROOT}" "${SDKROOT}" 
"${DEVROOT}")
SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

SET( RT_DEPLOYMENT_TARGET "4.3" CACHE STRING "minimum required SDK" )

SET( GCC_INPUT_FILETYPE "Objective-C++" )
SET( CMAKE_CXX_FLAGS "-x objective-c++ -mno-thumb" )

# For iOS builds this is needed for the app to initiate the 
UIApplication delegate instance...
SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ObjC" )

# Look in the correct build directories when linking the app to the 
RenderTools library...
SET( CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator" )
ENDIF()

Just wondering if someone is following the same path.

Thanks,

Daniel 
--

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] Checking for empty list

2011-11-25 Thread Daniel Dekkers
Thanks, so...

IF( MYLIST )
MESSAGE( STATUS "List is not empty" )
ENDIF()

Without the ${...} surrounding MYLIST, which confuses me, but probably makes
sense if you (better than I do) know what you're doing ;-)

-Oorspronkelijk bericht-
Van: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] Namens Michael
Wild
Verzonden: vrijdag 25 november 2011 15:15
Aan: cmake@cmake.org
Onderwerp: Re: [CMake] Checking for empty list

On 11/25/2011 02:52 PM, Daniel Dekkers wrote:
> Hi,
> 
>  
> 
> I know it should be out there somewhere in the documentation, but 
> can't find it.
> 
> How do I check for an empty list?
> 
> I can use LIST(LENGTH MYLIST LISTCOUNT) with an extra variable 
> LISTCOUNT but isn't there a single command?
> 
>  
> 
> Thanks,
> 
> Daniel
> 


An empty list is an empty variable, and evaluates to FALSE. So you can use

if(NOT MYLIST)
  message("Either MYLIST is empty or otherwise FALSE")
endif()

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

--

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] Checking for empty list

2011-11-25 Thread Daniel Dekkers
Hi,

 

I know it should be out there somewhere in the documentation, but can't find
it.

How do I check for an empty list?

I can use LIST(LENGTH MYLIST LISTCOUNT) with an extra variable LISTCOUNT but
isn't there a single command?

 

Thanks,

Daniel

--

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] Xcode: Nested Xcode Projects

2011-11-22 Thread Daniel Dekkers
Hi,

CMake doesn't support Xcode "workspaces" like it does Visual Studio "solutions".
But you can still define multiple PROJECT()'s that will all be visible and 
buildable (via the scheme selector)  in the IDE.
In our setup, we have a bunch of apps and a library, in the top level 
CMakeLists.txt we do...

PROJECT(Suite)
ADD_SUBDIRECTORY(Lib)
ADD_SUBDIRECTORY(App0)
...
ADD_SUBDIRECTORY(Appn)

And every CMakeLists.txt in the leaves of the source tree contains exactly one 
PROJECT() call: 
Lib: PROJECT(Lib) ... ADD_LIBRARY(Lib ...)
App0: PROJECT(App0) ... ADD_EXECUTABLE(App0 ...)
...
App1: PROJECT(Appn) ... ADD_EXECUTABLE(Appn ...)

But yes... workspaces would be great.

Daniel

On Nov 22, 2011, at 1:28 PM, Matthias Dörfelt wrote:

> Hi,
> 
> I am currently generating sub projects with cmake using the add_subdirectory 
> command together with the Xcode generator. It works, but the top level Xcode 
> project includes the sources and targets of all the sub projects. Is it 
> possible to make it reference the actual Xcode sub projects instead(to get 
> closer to a "normal" Xcode workflow)? 
> If it's not possible with current CMake it would certainly be a very neat 
> addition!
> 
> Thanks 
> --
> 
> 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] Specifying library build path for simulator and device for an iOS target in Xcode

2011-11-11 Thread Daniel Dekkers
Thanks.
You saved the day (again).
Works perfectly.

On Nov 11, 2011, at 5:22 PM, David Cole wrote:

> On Fri, Nov 11, 2011 at 11:12 AM, Daniel Dekkers  
> wrote:
>> Hi,
>> 
>> We are building a lib and an example app in Xcode (4.2) targeting iOS (5.0).
>> 
>> The top-level CMakeLists.txt recurses into lib and example:
>> 
>> PROJECT(Suite)
>> ADD_SUBDIRECTORY(MyLibrary)
>> ADD_SUBDIRECTORY(MyExample)
>> 
>> The lib is built in the traditional way…
>> 
>> PROJECT(MyLib)
>> …
>> ADD_LIBRARY( ${MYLIB_SOURCES} )
>> 
>> As is the example:
>> 
>> PROJECT(MyExample)
>> …
>> ADD_EXECUTABLE(MyExample MACOS_BUNDLE ${MYEXAMPLE_SOURCES})
>> TARGET_LINK_LIBRARIES( MyExample MyLib)
>> ADD_DEPENDENCIES(MyExample MyLib)
>> 
>> But during linking of the example, MyExample expects the built lib to be in:
>> 
>> path/to/build/MyLibrary/Debug/
>> 
>> While Xcode will build to
>> 
>> path/to/build/MyLibrary/Debug-iphonesimulator/
>> 
>> or
>> 
>> path/to/build/MyLibrary/Debug-iphoneos/
>> 
>> depending on the scheme you select.
>> 
>> Anyone know how to get "inbetween", letting CMake know there is this 
>> "-iphoneos" or "-iphonesimulator" postfix needed.
>> 
>> Thanks,
>> Daniel
>> 
>> 
>> 
>> 
>> --
>> 
>> 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
>> 
> 
> Are you using CMake 2.8.6?
> 
> Is the following line in your top level CMakeLists.txt file?
> 
>  set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator")
> 
> If not, try both of those and let me know if it's still wrong. The
> effective platform stuff is new in 2.8.6, and there are probably still
> some rough edges for "complex" projects...
> 
> 
> HTH,
> 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


[CMake] Specifying library build path for simulator and device for an iOS target in Xcode

2011-11-11 Thread Daniel Dekkers
Hi,

We are building a lib and an example app in Xcode (4.2) targeting iOS (5.0).

The top-level CMakeLists.txt recurses into lib and example:

PROJECT(Suite)
ADD_SUBDIRECTORY(MyLibrary)
ADD_SUBDIRECTORY(MyExample)

The lib is built in the traditional way…

PROJECT(MyLib)
… 
ADD_LIBRARY( ${MYLIB_SOURCES} )

As is the example:

PROJECT(MyExample)
…
ADD_EXECUTABLE(MyExample MACOS_BUNDLE ${MYEXAMPLE_SOURCES})
TARGET_LINK_LIBRARIES( MyExample MyLib)
ADD_DEPENDENCIES(MyExample MyLib)

But during linking of the example, MyExample expects the built lib to be in:

path/to/build/MyLibrary/Debug/

While Xcode will build to

path/to/build/MyLibrary/Debug-iphonesimulator/

or

path/to/build/MyLibrary/Debug-iphoneos/

depending on the scheme you select.

Anyone know how to get "inbetween", letting CMake know there is this 
"-iphoneos" or "-iphonesimulator" postfix needed.

Thanks,
Daniel




--

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] CMake 2.4.6 and Xcode 4.2 on Mac OS X 10.7

2011-11-10 Thread Daniel Dekkers
>> In reality, the Xcode generator only works 100% reliably well when you
>> do not try to specify the compiler, and let Xcode use the one it wants
>> to use by default.

Hm…

But we still want to build for iOS. There isn't really a problem with that in 
Xcode 4.2/Lion/iOS5.0/CMake2.8-6 in my experience.
We now have this as "toolchain" (but actually, just included):

...
IF ( RT_IOS)
SET (CMAKE_SYSTEM_NAME Generic)
SET (CMAKE_SYSTEM_VERSION 1)
SET (CMAKE_SYSTEM_PROCESSOR arm)

SET (RT_SDKVER "5.0" CACHE PATH "iOS SDK version" )
SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${RT_SDKVER}.sdk")

SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
SET (CMAKE_OSX_ARCHITECTURES "$(ARCHS_UNIVERSAL_IPHONE_OS)") # Either 
"$(ARCHS_UNIVERSAL_IPHONE_OS)" or "arm6" "arm7"

SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc")
SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++")

# SET (CMAKE_FIND_ROOT_PATH "${DEVELOPMENT_ROOT}" 
"/opt/iphone-${RT_SDKVER}/" "/usr/local/iphone-${RT_SDKVER}/")
SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
ENDIF()
…

So you propose we skip specifying the compiler altogether? Remove:

SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc")
SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++")

Wasn't sure if this worked anyway. 
I see now Xcode is just using the default compiler (Apple LLVM Compiler (3.0)) 
instead of LLVM GCC 3.0.

Thanks,
Daniel

--

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] find_package(), sources only

2011-11-07 Thread Daniel Dekkers
Hi Hendrik,

Could you write a few more lines. I want to understand,... but I don't. ;-)

We only have one copy of Bullet "as a bundle" present on the system. Let's
say you just downloaded Bullet.
With BULLET_ROOT, we set the root path to that copy and do a
find_package(BULLET), it returns with:
   BULLET_FOUND (only true if everything is found, no, because the libs
aren't built)
   BULLET_INCLUDE_DIR (set if the sources are found, ok, we downloaded the
source distribution)
   BULLET_COLLISION_LIBRARY[_DEBUG] (not defined, we haven't built Bullet
(yet))
   BULLET_DYNAMICS_LIBRARY[_DEBUG] (not defined, we haven't built Bullet
(yet))
   BULLET_MATH_LIBRARY[_DEBUG] (not defined, we haven't built Bullet (yet))

>From BULLET_INCLUDE_DIR (which is typically a complete path, something like:
C:/development/bullet/src) we can get to the sources to include in our own
lib, typically located in C:/development/bullet/src/BulletCollision,
C:/development/bullet/src/BulletDynamics, etc. So, if we build with sources,
there is no problem at all if the Bullet libs aren't pre built, yet
BULLET_FOUND is false.

So, it would be nice if "we haven't found everything, but we found this..."
would be communicated from find_package(), or... you could specify
more clearly what you are looking for, so _FOUND is an exact answer
to that specific question. 

I would guess that this sources/binaries distinction actually is quite
common, and it comes in all flavors:
- GLEW, only sources. Don't know if there is a findGLEW.cmake.
- Boost, only sources (header only) or libs (in rare cases). Boost will
return Boost_FOUND true even if the libs are not present (if you didn't
specify via COMPONENTS).
- Bullet, preferably built from sources in your project, but you can also
link to pre built binaries.
- OpenGL, only binaries. Well, ok, an include directory but you never
actually build OpenGL from source yourself.

Again, just a thought, it's not that big of a problem, but it makes your
CMake files a bit less elegant:

MESSAGE( STATUS "Looking for Bullet..." )
SET(BULLET_ROOT ${DEVELOPMENT_ROOT}/bullet CACHE PATH "Root directory for
Bullet")
FIND_PACKAGE( BULLET REQUIRED )
IF( BULLET_FOUND )
MESSAGE( STATUS "Bullet found" )
ELSE()
IF( RT_SOURCE )
# If the compiled libraries are not found, BULLET_FOUND is
false, 
# this is ok (RT_SOURCE) as long as BULLET_INCLUDE_DIR has
been set.
IF( BULLET_INCLUDE_DIR )
MESSAGE( STATUS "Bullet include/src directory found"
)
ELSE()
MESSAGE( STATUS "Bullet include/src directory not
found" )
ENDIF()
...

Daniel


-Oorspronkelijk bericht-
Van: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] Namens Hendrik
Sattler
Verzonden: maandag 7 november 2011 12:29
Aan: cmake@cmake.org
Onderwerp: Re: [CMake] find_package(), sources only

Am 07.11.2011 12:04, schrieb Daniel Dekkers:
> Just a thought.

Just a thought on your thought.

> We are incorporating 3rd party library Bullet in our own library. 
> This can
> be done on two levels (via an option). Either by sources (which is 
> standard practice with Bullet), or by linking to the built Bullet 
> libraries directly.
> Now find_package(BULLET) (i.e. the findBullet.cmake script) sets 
> BULLET_FOUND to true only if the include directory *and* the libraries 
> are found. But if we only use the sources, we don't need the libs and 
> we ignore the BULLET_FOUND "error" if they don't exist but still use 
> the path to the include directories.
>
> Wouldn't it be good if you could extend find_package() with some kind 
> of "SOURCE-ONLY" communication or do you think that is the 
> responsibility of the find.cmake writer?

If you are using the sources as internal copy of that library, don't you
also have the include files as internal copy? In this case, it would be
wrong to use the external headers as they might not match your source copy.

HS

--

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] find_package(), sources only

2011-11-07 Thread Daniel Dekkers
Hi,

 

Just a thought.

 

We are incorporating 3rd party library Bullet in our own library. This can
be done on two levels (via an option). Either by sources (which is standard
practice with Bullet), or by linking to the built Bullet libraries directly.
Now find_package(BULLET) (i.e. the findBullet.cmake script) sets
BULLET_FOUND to true only if the include directory *and* the libraries are
found. But if we only use the sources, we don't need the libs and we ignore
the BULLET_FOUND "error" if they don't exist but still use the path to the
include directories.

 

Wouldn't it be good if you could extend find_package() with some kind of
"SOURCE-ONLY" communication or do you think that is the responsibility of
the find.cmake writer?

 

Thanks,

Daniel Dekkers   

--

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] ADD_SUBDIRECTORY() with a higher level directory

2011-11-06 Thread Daniel Dekkers
Every project's code base should be organized in the way that suits the
needs best, whatever the needs may be. ;-) E.g., my personal liking for the
general directory hierarchy of a project xyz - library or not - is

xyz
  xyz
  examples
  utilities
  ...

i.e., the project's main part is organized as a sibling of typical
supplementary parts like examples and utilities, and perhaps, one likes to
centralize the tests in another sibling xyz/tests, too.
This approach makes it easier to cope with a growing complexity; e.g., you
do not need to worry where to put the examples if the main part is about to
be split in, say, xyz-{core,gui,net,...}.
In other words: Separate the main part(s) of a project from its
supplementary parts and make the code base reflect this clearly.
Again, that's just my personal taste, and others certainly vary.


Ok...
The top level directory/bundle name would probably have a version number:

xyz-3.1.4
CMakeLists.txt
+ xyz <- represents the lib
  CMakeLists.txt
  + src
CMakeLists.txt
  + rsrc
+ examples
  CMakeLists.txt
  + example0 
CMakeLists.txt
+ src
  CMakeLists.txt
+ rsrc
...
+ tests
+ utilities
...

With... 

xyz-3.1.4/CMakeLists.txt
Main entry point for complete build, PROJECT(all), ADD_SUBDIRECTORY(xyz),
ADD_SUBDIRECTORY(examples)

xyz-3.1.4/xyz/CMakeLists.txt
Setup context for the lib

xyz-3.1.4/xyz/src/CMakeLists.txt
Add the sources/resources of the lib, PROJECT(xyz), ADD_LIBRARY(...)

xyz-3.1.4/examples/CMakeLists.txt
Enumerate the examples, PROJECT(examples), ADD_SUBDIRECTORY(example0),
ADD_SUBDIRECTORY(example1),...

xyz-3.1.4/examples/example0/CMakeLists.txt
Setup context for example0

xyz-3.1.4/examples/example0/src/CMakeLists.txt
adds the sources/resources of example0, PROJECT(example0),
ADD_EXECUTABLE(...), ADD_DEPENDENCY(xyz)

...

This "template" stuff should really be in the documentation, it would have
helped me a lot.
More than http://www.cmake.org/cmake/help/examples.html. A library called
"Hello", really?

Thanks,
Daniel

--

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] ADD_SUBDIRECTORY() with a higher level directory

2011-11-03 Thread Daniel Dekkers
It's standard practice if you go down your hierarchy, hence add_SUBdirectory().
But "upstream"? add_subdirectory(../../library)? Doesn't work.
Maybe a standard include() with an absolute path, but doesn't feel right.

Op 3 nov. 2011 om 21:27 heeft Dan Kegel  het volgende 
geschreven:

> Wait, what happens when you do add_subdirectory(..), or whatever?  I
> thought that was standard practice.
--

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] ADD_SUBDIRECTORY() with a higher level directory

2011-11-03 Thread Daniel Dekkers
Hi,

We are creating a directory structure for distribution of an open-source
library with examples included.
It looks something like this:

+ library <- the root directory
  CMakeLists.txt <- create context for building (only) the library
  + src <- contains the sources of the library
CMakeLists.txt <- actually add sources for (only) the library
  + examples
CMakeLists.txt <- create context for building all the examples (and the
library, once)
+ example0
  CMakeLists.txt <- create context for building example0 (and the
library)
  + src
CMakeLists.txt <- add sources for example0
  + rsrc
+ example1
  CMakeLists.txt <- create context for building example1 (and the
library)
  + src
CMakeLists.txt <- add sources for example1 
  + rsrc
+ ...

The CMakeLists.txt in library, library/examples and
library/examples/example0 and library/examples/example1 should all be
possible entry points for a build. Maybe you want to build only the library,
maybe you want to build the whole example suite, or maybe an individual
example.

Of course, the CMakeLists.txt in examples (or example0 and example1) depends
on the actual library, so, from that level, we would like to call
ADD_SUBDIRECTORY() to the *higher level* library directory... which is
unacceptable for ADD_SUBDIRECTORY() (and probably conflicts with the whole
CMake structure).

If we would move examples "up" the hierarchy there wouldn't be a problem,
but that doesn't give a nice distribution package.

Any hints on a proper way to do this?

Kind Regards,

Daniel Dekkers

--

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] cmake, boost on windows, and linking: shouldn't find_package have put BOOST_ROOT/lib into LIB?

2011-10-30 Thread Daniel Dekkers
find_package() searches for a package, and sets variables. Typically variables 
like...

_FOUND # package found or not
_INCLUDE_DIR # path to the libraries include directory
_LIBRARY # name of the library

You still have to link in the library yourself:

target_link_libraries(${TARGET} ${_LIBRARY})

For Boost, you can specify which libraries you are actually going to use:

set(BOOST_ROOT path/to/Boost) # boost root dir
find_package(Boost 1.47.0 COMPONENTS regex REQUIRED) # find the regex lib

...

include_directories(${Boost_INCLUDE_DIR}) # if you use Boost header only, this 
is all you need

…

target_link_libraries(${TARGET} ${Boost_REGEX_LIBRARY}) # link in the regex lib 
from boost.

Daniel

On Oct 29, 2011, at 4:11 AM, Dan Kegel wrote:

> I'm slowly learning cmake and converting some real software to it,
> targeting Linux, Windows, and Mac OS X.
> Along the way, I'm making minimal working examples (they're a lot
> easier to debug them than the real thing) and putting them up at
> http://code.google.com/p/winezeug/source/browse/#svn/trunk/cmake_examples
> 
> Today, I wrote an example that uses a single function from boost.  It's at
>  
> http://code.google.com/p/winezeug/source/browse/#svn%2Ftrunk%2Fcmake_examples%2Fex4
> 
> For Linux, demo.sh builds and runs the example, assuming you've
> installed everything needed with apt-get.
> For Windows (or Linux with Wine), demo.bat builds and runs the
> example, assuming you've installed visual c++ 2005 express, the win 7
> platform sdk, and boostpro.com's pre-build boost (the whole thing,
> don't skip any libraries, or you may be mystified why things don't
> link, like I was).It sets BOOST_ROOT so find_package can find
> boost.
> 
> And now the question.
> I needed to put $BOOST_ROOT/lib into the LIB environment variable by
> hand (well, by running
> http://code.google.com/p/winezeug/source/browse/trunk/cmake_examples/settings.bat
> ).
> If I leave it out, I get the error
> LINK : fatal error LNK1104: cannot open file
> 'libboost_date_time-vc80-mt-gd-1_47.lib'
> when bulding on Windows.
> Shouldn't find_package have taken care of 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

--

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] Checking for empty string

2011-10-25 Thread Daniel Dekkers
Great, thanks.

On Oct 25, 2011, at 11:17 AM, Eric Noulard wrote:

> 2011/10/25 Daniel Dekkers :
>> hi there,
>> 
>> how do I test if a string is empty ("") or not ?
>> IF( ${test} STREQUAL "" )
>> gives the wrong number of arguments if ${test} is ""
> 
> Did you try
> 
> IF( "${test}" STREQUAL "" ) ?
> 
> 
> -- 
> 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] Checking for empty string

2011-10-25 Thread Daniel Dekkers
hi there,

how do I test if a string is empty ("") or not ?
IF( ${test} STREQUAL "" )
gives the wrong number of arguments if ${test} is ""

thanks,

J 
--

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] Bug fix requests for the *next* release of CMake...

2011-10-21 Thread Daniel Dekkers
Yes, me -> http://public.kitware.com/Bug/view.php?id=12532

Don't think as a reporter you can even edit your own bug entries after 
committing them. Or I'm missing a button somewhere.

Op 21 okt. 2011 om 20:20 heeft David Cole  het volgende 
geschreven:

> As an esteemed colleague has pointed out, those with "reporter" level
> account in Mantis may not edit bugs other than their own directly.
> So. if you are in that boat, but would like to vote for a bug fix
> to be considered for 2.8.7, please reply to this thread, and just list
> the bug number, or a URL linking to its bug tracker page.
> 
> I will follow the replies to this thread and add those bugs to the
> roadmap as they roll in.
> 
> 
> Thanks,
> David C.
> 
> 
> On Fri, Oct 21, 2011 at 12:19 PM, David Cole  wrote:
>> Hi all,
>> 
>> *NO* replies requested. Different technique this time. Please edit the
>> bug tracker directly. (Unless you have problems with the bug tracker:
>> if so, please feel free to reply here with your suggestions.)
>> 
>> We are planning for CMake 2.8.7, aiming for a December release. We're
>> targeting Dec. 28, 2011 for releasing it, and in order to make that
>> happen we'll have to do an "rc1" by Dec. 7th or so... about 7 weeks
>> from now.
>> 
>> If you have a particular issue that you think should be fixed for
>> inclusion in 2.8.7, please put it on the roadmap yourself by the end
>> of next week, Fri. Oct. 28th. To do so, edit the bug at
>> http://public.kitware.com/Bug and set the "Target Version" field to
>> "CMake 2.8.7" - that will make it appear on the roadmap page (
>> http://www.cmake.org/Bug/roadmap_page.php?version_id=89 ). Also: add a
>> note saying why it's important to you, or even add a patch that fixes
>> and documents and tests it if you're able to.
>> 
>> Ideally, each issue will be discussed as needed on the mailing list to
>> come to any consensus about what should be done to fix it, and then
>> the entry in the bug tracker may be used to keep it on the radar
>> screen, and to track activity related to it.
>> 
>> Patches are *always* welcome. Patches that include testing of any new
>> features, or tests that prove a bug is really fixed on the dashboards
>> are better: a patch with testing is strongly preferred over a patch
>> with no testing. Also, if you are *adding* code, then you also
>> probably need to add *tests* of that code, so that the coverage
>> percentage stays as is or rises.
>> 
>> Please discuss issues here on the mailing list as needed, and add
>> notes to existing issues in the bug tracker that you are interested in
>> seeing fixed for 2.8.7 -- we will be looking at activity both on the
>> mailing list and in the bug tracker to help prioritize the bug fixes
>> for the next couple months.
>> 
>> 
>> Thanks,
>> David Cole
>> Kitware, Inc.
>> 
>> 
>> P.S. - as a nice summary of what we accomplished in the CMake 2.8.6
>> release, including contributions from 27 individuals around the world,
>> see here: http://public.kitware.com/Bug/changelog_page.php?version_id=87
>> -- it currently lists 43 issues that we resolved: nice job, everybody!
>> 
>> (Many of those were specifically addressed because somebody brought it
>> up in response to my similar email from just after 2.8.5... Don't be
>> shy!)
>> 
> --
> 
> 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] XCode workspace with projects and Visual Studio solution with projects

2011-10-20 Thread Daniel Dekkers
Hi,

I was wondering, if I generate for Visual Studio, and do PROjECT(...) calls in 
nested CMakeLists.txt files, I get a top level solution with separate projects 
in it (exes and libs).
But the XCode generator doesn't create a top level workspace (with separate 
projects in it) but a single project with the (sub)projects divided in /Sources.
Is this still a CMake/Xcode limitation (read something about problems with 
dependencies) or is there a workaround that I don't know about?

Thanks,
Daniel

--

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] Xcode4 and OpenMP

2011-10-20 Thread Daniel Dekkers
Shouldn't it be SET_TARGET_PROPERTIES( ${TARGET} PROPERTIES 
XCODE_ATTRIBUTE_ENABLE_OPENMP_SUPPORT YES )?

On Oct 19, 2011, at 6:15 PM, Kieran Parsons wrote:

> I am having difficulty with enabling OpenMP on Xcode 4.0.2 (cmake 2.8.6). I 
> need to manually set the "Enable OpenMP support" build option (once I do 
> everything is fine). I want to set this directly from CMakeLists.txt. I tried 
> SET(CMAKE_XCODE_ATTRIBUTE_ENABLE_OPENMP_SUPPORT "Yes") based on 
> CMakeLists.txt found at 
> https://github.com/thmxv/blender-ocio/blob/master/CMakeLists.txt
> 
> But this did not work (still need to manually set). I see the 
> ENABLE_OPENMP_SUPPORT setting in the ALL_BUILD options, but under the 
> specific target I still see "No" for the "Enable OpenMP support".
> 
> Thanks.
> --
> 
> 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] Different settings for different configurations in Xcode

2011-10-19 Thread Daniel Dekkers
Hi,

I still have issues with the CMake feature to define different settings for 
different configurations in Xcode (4.0.2).
Related to...

http://www.cmake.org/Bug/view.php?id=11667
http://www.cmake.org/Bug/view.php?id=8179

I've tried lots of different interpretations of the syntax (which is 
undocumented apart from the bug tracker?) but nothing seems to work, if I try 
this...

SET_TARGET_PROPERTIES( ${RT_APP_NAME} PROPERTIES 
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY[variant=Debug] 
${RT_CODE_SIGN_IDENTITY_DEVELOPMENT} )
SET_TARGET_PROPERTIES( ${RT_APP_NAME} PROPERTIES 
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY[variant=Release] 
${RT_CODE_SIGN_IDENTITY_DISTRIBUTION} )

or...

SET_TARGET_PROPERTIES( ${RT_APP_NAME} PROPERTIES 
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY[variant=Debug][sdk=*] 
${RT_CODE_SIGN_IDENTITY_DEVELOPMENT} )
SET_TARGET_PROPERTIES( ${RT_APP_NAME} PROPERTIES 
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY[variant=Release][sdk=*] 
${RT_CODE_SIGN_IDENTITY_DISTRIBUTION} )

... it always results in both settings being added to both configurations 
(under the key "Any sdk" that is added twice per configuration).

I'm using CMake 2.8-6.

Any suggestions?

Thanks,
Daniel Dekkers
 






--

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] Separating SET_TARGET_PROPERTIES() for different configurations

2011-10-14 Thread Daniel Dekkers
Hi,

I don't think the [variant=###] method works to separate 
SET_TARGET_PROPERTIES() to different configurations in Xcode (4.0.2).

If I try this (simple example)...

SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES 
XCODE_ATTRIBUTE_COMPRESS_PNG_FILES[variant=Debug] YES )
SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES 
XCODE_ATTRIBUTE_COMPRESS_PNG_FILES[variant=Release] NO )

... the result in Xcode is:

Compress PNG Files Yes
  Debug Yes
No condition allowed No
No condition allowed Yes
  MinSizeRel Yes
No condition allowed No
No condition allowed Yes
  RelWithDebInfo Yes
No condition allowed No
No condition allowed Yes
  Release Yes
No condition allowed No
No condition allowed Yes

Instead of:

Compress PNG Files 
   Debug Yes
   Release No

Would there be another way of achieving separate configuration settings that 
anyone knows of?

Kind Regards,

Daniel

--

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] Separating SET_TARGET_PROPERTIES() for different configurations

2011-10-13 Thread Daniel Dekkers
Hi, 

Comparing Xcode generator output to standard Xcode output...

If I look at a different project file (non CMake) which shows correct behavior, 
a part of the project.pbxproj looks like:

...
/* Begin XCBuildConfiguration section */
1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CODE_SIGN_ENTITLEMENTS = ./EntitlementsDebug.plist;
"CODE_SIGN_ENTITLEMENTS[sdk=*]" = 
./EntitlementsDebug.plist; 
...

While in this case for this new CMake project it looks like:

...
346308F43B804647BD39C65F /* RelWithDebInfo */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
"CODE_SIGN_ENTITLEMENTS[variant=Debug]" = 
/Users/danieldekkers/development/RenderTools/examples/SettingsTest/rsrc/apple/ios/entitlements/EntitlementsDebug.plist;
...

So the first doesn't seem to need a [variant=] (internally) 
since it is already in the section "Debug". But it does use [sdk=*]. To avoid 
further subdivision of the Debug setting into different SDKs?

On Oct 13, 2011, at 3:23 PM, Daniel Dekkers wrote:

> Thanks Michael,
> 
> Just found it out myself as well (and yes, XCODE_ATTRIBUTE was the google 
> entry).
> 
> SET_TARGET_PROPERTIES( ${RT_APP_NAME} PROPERTIES 
> XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS[variant=Debug] 
> ${RT_IOS_CODE_SIGN_ENTITLEMENTS_DEBUG} )
> SET_TARGET_PROPERTIES( ${RT_APP_NAME} PROPERTIES 
> XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS[variant=Release] 
> ${RT_IOS_CODE_SIGN_ENTITLEMENTS_ADHOC} )
> SET_TARGET_PROPERTIES( ${RT_APP_NAME} PROPERTIES 
> XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS[variant=RelWithDebInfo] 
> ${RT_IOS_CODE_SIGN_ENTITLEMENTS_DISTRIBUTION} )
> SET_TARGET_PROPERTIES( ${RT_APP_NAME} PROPERTIES 
> XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS[variant=MinSizeRel] 
> ${RT_IOS_CODE_SIGN_ENTITLEMENTS_DISTRIBUTION} )
> 
> But now I get four "Any SDK" entries inside each of the four different 
> configurations (16 in total), the list of "Any SDK"'s containing the 
> different entitlement entries.
> 
> So...
> 
> Code Signing Entitlements
>  Debug
>Any SDK   path/to/.../EntitlementsAdHoc.plist
>Any SDK   path/to/.../EntitlementsDistribution.plist
>Any SDK   path/to/.../EntitlementsDebug.plist
>Any SDK   path/to/.../EntitlementsDistribution.plist
>  MinSizeRel
>Any SDK   path/to/.../EntitlementsAdHoc.plist
>Any SDK   path/to/.../EntitlementsDistribution.plist
>Any SDK   path/to/.../EntitlementsDebug.plist
>Any SDK   path/to/.../EntitlementsDistribution.plist
>  RelWithDebInfo
>Any SDK   path/to/.../EntitlementsAdHoc.plist
>Any SDK   path/to/.../EntitlementsDistribution.plist
>Any SDK   path/to/.../EntitlementsDebug.plist
>Any SDK   path/to/.../EntitlementsDistribution.plist
>  Release
>Any SDK   path/to/.../EntitlementsAdHoc.plist
>Any SDK   path/to/.../EntitlementsDistribution.plist
>Any SDK   path/to/.../EntitlementsDebug.plist
>Any SDK   path/to/.../EntitlementsDistribution.plist
> 
> ...while I was hoping for...
> 
> Code Signing Entitlements
>  Debug path/to/.../EntitlementsDebug.plist
>  MinSizeRel path/to/.../EntitlementsDistribution.plist
>  RelWithDebInfo path/to/.../EntitlementsDistribution.plist
>  Release path/to/.../EntitlementsAdHoc.plist
> 
> Anyone knows what happening here?
> 
> Daniel
> 
> On Oct 13, 2011, at 2:52 PM, Michael Wild wrote:
> 
>> On 10/13/2011 02:26 PM, Daniel Dekkers wrote:
>>> Hi,
>>> 
>>> How can I separate settings for different configurations in Xcode.
>>> 
>>> As an example...
>>> 
>>> SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES 
>>> XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${IOS_CODE_SIGN_ENTITLEMENTS} )
>>> 
>>> ... sets the same entitlement file for all four configurations (Debug, 
>>> Release, MinSizeRel, RelWithDebInfo) to ${IOS_CODE_SIGN_ENTITLEMENTS}. 
>>> 
>>> But now i would like to use different different files for different 
>>> configurations, something like this:
>>> 
>>> SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES LINK_FLAG_DEBUG 
>>> XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${IOS_CODE_SIGN_ENTITLEMENTS_DEBUG} )
>>> SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES LINK_FLAG_RELEASE 
>>> XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${IOS_CODE_SIGN_ENTITLEMENTS_ADHOC} )
>>> SET

Re: [CMake] Separating SET_TARGET_PROPERTIES() for different configurations

2011-10-13 Thread Daniel Dekkers
Thanks Michael,

Just found it out myself as well (and yes, XCODE_ATTRIBUTE was the google 
entry).

SET_TARGET_PROPERTIES( ${RT_APP_NAME} PROPERTIES 
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS[variant=Debug] 
${RT_IOS_CODE_SIGN_ENTITLEMENTS_DEBUG} )
SET_TARGET_PROPERTIES( ${RT_APP_NAME} PROPERTIES 
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS[variant=Release] 
${RT_IOS_CODE_SIGN_ENTITLEMENTS_ADHOC} )
SET_TARGET_PROPERTIES( ${RT_APP_NAME} PROPERTIES 
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS[variant=RelWithDebInfo] 
${RT_IOS_CODE_SIGN_ENTITLEMENTS_DISTRIBUTION} )
SET_TARGET_PROPERTIES( ${RT_APP_NAME} PROPERTIES 
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS[variant=MinSizeRel] 
${RT_IOS_CODE_SIGN_ENTITLEMENTS_DISTRIBUTION} )

But now I get four "Any SDK" entries inside each of the four different 
configurations (16 in total), the list of "Any SDK"'s containing the different 
entitlement entries.

So...

Code Signing Entitlements
  Debug
Any SDK   path/to/.../EntitlementsAdHoc.plist
Any SDK   path/to/.../EntitlementsDistribution.plist
Any SDK   path/to/.../EntitlementsDebug.plist
Any SDK   path/to/.../EntitlementsDistribution.plist
  MinSizeRel
Any SDK   path/to/.../EntitlementsAdHoc.plist
Any SDK   path/to/.../EntitlementsDistribution.plist
Any SDK   path/to/.../EntitlementsDebug.plist
Any SDK   path/to/.../EntitlementsDistribution.plist
  RelWithDebInfo
Any SDK   path/to/.../EntitlementsAdHoc.plist
Any SDK   path/to/.../EntitlementsDistribution.plist
Any SDK   path/to/.../EntitlementsDebug.plist
Any SDK   path/to/.../EntitlementsDistribution.plist
  Release
Any SDK   path/to/.../EntitlementsAdHoc.plist
Any SDK   path/to/.../EntitlementsDistribution.plist
Any SDK   path/to/.../EntitlementsDebug.plist
Any SDK   path/to/.../EntitlementsDistribution.plist

...while I was hoping for...

Code Signing Entitlements
  Debug path/to/.../EntitlementsDebug.plist
  MinSizeRel path/to/.../EntitlementsDistribution.plist
  RelWithDebInfo path/to/.../EntitlementsDistribution.plist
  Release path/to/.../EntitlementsAdHoc.plist

Anyone knows what happening here?

Daniel

On Oct 13, 2011, at 2:52 PM, Michael Wild wrote:

> On 10/13/2011 02:26 PM, Daniel Dekkers wrote:
>> Hi,
>> 
>> How can I separate settings for different configurations in Xcode.
>> 
>> As an example...
>> 
>>  SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES 
>> XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${IOS_CODE_SIGN_ENTITLEMENTS} )
>> 
>> ... sets the same entitlement file for all four configurations (Debug, 
>> Release, MinSizeRel, RelWithDebInfo) to ${IOS_CODE_SIGN_ENTITLEMENTS}. 
>> 
>> But now i would like to use different different files for different 
>> configurations, something like this:
>> 
>>  SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES LINK_FLAG_DEBUG 
>> XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${IOS_CODE_SIGN_ENTITLEMENTS_DEBUG} )
>>  SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES LINK_FLAG_RELEASE 
>> XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${IOS_CODE_SIGN_ENTITLEMENTS_ADHOC} )
>>  SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES 
>> LINK_FLAG_MINSIZEREL XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS 
>> ${IOS_CODE_SIGN_ENTITLEMENTS_DISTRIBUTION} )
>>  SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES 
>> LINK_FLAG_RELWITHDEBINFO XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS 
>> ${IOS_CODE_SIGN_ENTITLEMENTS_DEBUG} )
>> 
>> But this syntax is not recognized.
>> 
>> Kind Regards, 
>> 
>> Daniel Dekkers
> 
> 
> You can use XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS[variant=Debug] etc.
> See
> http://stackoverflow.com/questions/1354542/how-to-set-an-xcode-attribute-in-cmake-for-a-specific-configuration.
> Wonder why this didn't make it into the documentation. But then,
> googling XCODE_ATTRIBUTE returned this find pretty high up in the search
> results...
> 
> 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


[CMake] Separating SET_TARGET_PROPERTIES() for different configurations

2011-10-13 Thread Daniel Dekkers
Hi,

How can I separate settings for different configurations in Xcode.

As an example...

SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES 
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${IOS_CODE_SIGN_ENTITLEMENTS} )

... sets the same entitlement file for all four configurations (Debug, Release, 
MinSizeRel, RelWithDebInfo) to ${IOS_CODE_SIGN_ENTITLEMENTS}. 

But now i would like to use different different files for different 
configurations, something like this:

SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES LINK_FLAG_DEBUG 
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${IOS_CODE_SIGN_ENTITLEMENTS_DEBUG} )
SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES LINK_FLAG_RELEASE 
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${IOS_CODE_SIGN_ENTITLEMENTS_ADHOC} )
SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES 
LINK_FLAG_MINSIZEREL XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS 
${IOS_CODE_SIGN_ENTITLEMENTS_DISTRIBUTION} )
SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES 
LINK_FLAG_RELWITHDEBINFO XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS 
${IOS_CODE_SIGN_ENTITLEMENTS_DEBUG} )

But this syntax is not recognized.

Kind Regards, 

Daniel Dekkers



--

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] Xcode resources for different projects in different directories.

2011-10-08 Thread Daniel Dekkers
Hi,

I think I've asked this earlier, but still no solution, so i'll try again.

I'm targeting Xcode (iOS) and would like to have multiple projects (and one 
library) in a single workspace. In the individual projects, I set...

SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES RESOURCE "${RSRC_FILES}" )

...to make Xcode aware of the resources (so Xcode will copy them to the bundle 
before building).

But.. all the resources of all the projects end up in /Resources, a top level 
Xcode folder, except for the Info.plist, that goes in a /Resources folder in 
the project itself. This (of course) gives problems because there are different 
files with the same names (icons) and I don't want all the resources of all the 
projects in all the bundles.

So, it would be nice of I could let CMake put the resources of an individual 
project in the /Resources directory of that individual project. But no idea how 
to do that.

Kind Regards,

Daniel Dekkers




--
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] Incorporating third party libraries

2011-10-04 Thread Daniel Dekkers

On Oct 4, 2011, at 4:24 PM, Clifford Yapp wrote:

> On Tue, Oct 4, 2011 at 7:20 AM, Daniel Dekkers  wrote:
> Hi,
> 
> Would really appreciate your advice on this.
> 
> We are planning to use and maybe distribute a library (let's call it OurLib) 
> that depends on third-party libraries, namely Boost, Glut, OpenGL, FreeType, 
> Bullet, PNG, ...
> 
> You could take a look at what BRL-CAD does for this situation:
> 
> http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk  (look for 
> adding the src/other subdirectory in CMakeLists.txt)
> http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/src/other/
> 
> macros used are defined in:
> 
> http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/misc/CMake/

Ok, thanks, will take a look.

> From a high level, our approach is to try to detect suitable installations of 
> libraries on the system.  If we find them, use them.  If not, build our local 
> copy. 

Ok. 
For me, in a perfect world, I would like to be able to do this for a top level 
CMakeLists.txt...

project(all)
add_subdirectory(lib0)
add_subdirectory(lib1)
...
add_subdirectory(app0)
add_subdirectory(app1)

... if I want to see and manipulate the sources of these libraries.
And if i don't, just use the binaries...

project(all)
find_package(lib0 ...)
find_package(lib1 ...)
...
add_directory(app0)
add_directory(app1)

And be "free" in that. So i could also do a local build of an individual 
library and just link directly to that binary.

> Currently our approach requires that each third-party library also have a 
> functional CMake build,

Yes. Most libraries we use have that, or are at least getting there. We've 
"investigated" somewhere around 8-10 libraries as of now. I get the impression 
that library developers are willing to provide a CMake build, probably because 
it helps them too, internally. But often the find_package(), is lacking. The 
library developers don't feel responsible for the find[Package].cmake script, 
they don't see it anyway because (of course) they are mostly looking at the 
source code of their own library. So,... Kitware, or someone else will write it 
instead, but only as a reaction to the latest version of the library, which 
might have changed in the meantime (which is the case with Bullet at this 
moment, for instance). So some libraries (like OpenSceneGraph) just provide 
their own long list of find[Package].cmake scripts, and redirect with 
set(CMAKE_MODULE_PATH ...) which (i think) is a pity, because everybody wants 
these scripts, shipped with the official CMake distribution. But I realize that 
this is a lot of work, because you have to communicate with all the individual 
library developers.

> but in principle you could try adding support for other systems with 
> ExternalProject_Add as well.  We found it simpler to just write CMake logic 
> where needed, since in theory we need all of our third-party deps to build in 
> every situation

Yes

> BRL-CAD itself needs to build in - rather than worry about whether the 
> third-party library has enough build systems defined to cover all those cases 
> (and figuring out how to trigger which one when) it proved simpler to write 
> the CMake logic for the library.  Eventually, we'd like to have upstream 
> adopt the CMake logic and we could just use their source archives unaltered, 
> but we're a ways away from that and some projects are pretty heavily invested 
> in Autotools.

Ok

> Cheers,
> CY

Thanks,
Daniel Dekkers

--
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] Incorporating third party libraries

2011-10-04 Thread Daniel Dekkers
Hi,

Would really appreciate your advice on this.

We are planning to use and maybe distribute a library (let's call it OurLib) 
that depends on third-party libraries, namely Boost, Glut, OpenGL, FreeType, 
Bullet, PNG, ... 
This library would be able to target Windows (Glut), Mac OS X (Glut) and iOS 
(OpenGL ES1 and ES2).

At the moment, (parts of) these third-party libraries are just added as sources 
to OurLib, which releases us of the burden of performing proper individual 
builds of the third-party libraries for the different platforms/architectures. 
Namely iOS is not very widely adopted yet, with the arm architecture and all.
This in-source approach works nicely but isn't the way to go, I guess. Apart 
from the problem of providing builds for the third-party libraries outside 
OurLib, we also have to incorporate them. The question how to do that:

1) In the CMakeLists.txt of the OurLib library itself use 
find_package()/find_library() to find the third-party libraries? This would 
imply that the user of the library would have to change these "[LIBNAME]_ROOT 
"or "[LIBNAME]_ROOT_PATH" kinds of variables in the CMakeLists.txt of the 
OurLib library itself to find the third-party libraries on their particular 
platform.

2) Insist on a "top level" user-dependent CMakeLists.txt that would perform 
find_package()/find_library() before diving into the application sources and 
library sources.

Something like:

project(all)
set(BOOST_ROOT path/to/boost)
find_package(Boost ...)
set(GLUT_ROOT_PATH path/to/glut)
find_package(GLUT ...)
...
add_subdirectory(MyApp) 
add_subdirectoy(OurLib)

That way, at least, people don't have to edit the distributed CMakeLists.txt of 
OurLib itself. And you have a central place to do find_package()/find_library() 
so users can use the libraries in their own applications as well (which is 
often the case).

3) Just leave it to the user to do the find_package()/find_library() in their 
own CMakeLists.txt of their individual app before diving into the source 
directory of OurLib, which would be called from the CMakeLists.txt of their own 
application.

4) Something different ;-)

Thanks,
Daniel Dekkers

--
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] CMake 2.8, Xcode generator and XIB files

2011-10-04 Thread Daniel Dekkers
I don't think you need the configure_file() command.

What happens now (if i understand correctly) is that:
1) a copy of Info.plist is made from CMAKE_CURRENT_SOURCE_DIR to 
CMAKE_CURRENT_BINARY_DIR
2) a copy of Info.plist is made from CMAKE_CURRENT_BINARY_DIR to 
path/to/build/CMakeFiles/[appname].dir

You should be able to just do...

set_target_properties( ${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST 
${CMAKE_CURRENT_SOURCE_DIR}/Info.plist )
set_target_properties(${this_target} PROPERTIES RESOURCE "${RESOURCE_FILES}")

To add the Info.plist from CMAKE_CURRENT_SOURCE_DIR directly to your project. 
Unless, you would do something interesting in configure_file(), besides just 
copying.

Don't know if you can send an image as attachment to the mailing list. You can 
try ;-)

Thanks,
Daniel

On Oct 3, 2011, at 10:11 PM, g...@novadsp.com wrote:

I've modified the cmakelists file to include:

#---
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Info.plist 
${CMAKE_CURRENT_BINARY_DIR}/Info.plist)

set_target_properties( ${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST 
${CMAKE_CURRENT_BINARY_DIR}/Info.plist )

set_target_properties(${this_target} PROPERTIES RESOURCE "${RESOURCE_FILES}")
#---

which seems OK with Cmake. Indeed files now seem to go into the correct Xcode 
folders. However there is still an oddity best demonstrated with a picture. 
Does this list accepts JPG/PNG attachments? Is this OK?

Thx++

Jerry

On 03/10/2011 15:49, Daniel Dekkers wrote:
>> set_target_properties(${this_target} PROPERTIES RESOURCE 
>> ${RESOURCE_FILES})< error here. wrong number of args
> 
> Maybe try "${RESOURCE_FILES)" (with quotes).
> That helps to get rid of the ; delimiters of CMake lists, if that is the 
> problem. And otherwise the quotes might "bundle" the contents of 
> RESOURCE_FILES to a single string value, because it now seems to interpret 
> them as different arguments. It works for me:
> 
> # Make sure these resources are labeled as such so they are treated correctly 
> (sometimes compiled and copied but at least copied to the bundle...)
> SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES RESOURCE "${ALL_RSRC_FILES}" )
> 
> 
> 
> 




--
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] CMake 2.8, Xcode generator and XIB files

2011-10-03 Thread Daniel Dekkers
Hi,

Let me know how it works out for you...
We will be writing an article about this subject (platform independence, OSX, 
iOS, Windows, mainly focussed on OpenGL/ES1/ES2) in the fall,
so we need all the feedback we can get ;-)

Thanks,
Daniel Dekkers

On Oct 2, 2011, at 6:27 PM, g...@novadsp.com wrote:

> Hi Daniel
> 
> On 02/10/2011 15:03, Daniel Dekkers wrote:
>> With...
>> 
>> SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST 
>> ${PLIST_TEMPLATE} )
>> 
>> ... we set a path to a Info.plist template (we actually got separate ones 
>> for iOS and OSX). Maybe you can call them what you want, haven't tried. 
>> "Info.plist.in" would be good. I'll try.
>> These templates look like normal property list files except that they can 
>> contain CMake variable names, something like this:
>> 
>> ...
>>  CFBundleDisplayName
>>  ${APP_NAME}
>> ...
>>  CFBundleIdentifier
>>  ${APP_IDENTIFIER}
>> ...
>> 
>> where ${APP_NAME} and ${APP_IDENTIFIER} are substituted by CMake 
>> automatically while a new Info.plist is generated in 
>> path/to/build//CMakeFiles/[APP_NAME].dir.
>> This file is included in the Xcode project, it will appear in the 
>> Application->Resources folder. Not in the top level Resources folder of the 
>> project.
>> 
>> I'm not exactly sure what triggers this CMake behavior, I guess "Xcode" 
>> generation always implies: "Info.plist" generation.
>> Or it's dependent on another setting (platform, architecture). Couldn't find 
>> that in the documentation.
>> But i was copying the Info.list myself (with ADD_CUSTOM_COMMAND) and that 
>> gave all kinds of problems, like code signing errors.
>> 
>> I think it is possible to *not* let CMake perform the substitutions and just 
>> copy the template, but I haven't got that working yet. That would be handy 
>> because for some values you would just want to keep the ${...} entries 
>> unchanged. Xcode uses the same notation for values that are substituted 
>> later on.
>> 
>> Also see
>> https://lists.secondlife.com/pipermail/sldev/2008-September/011839.html
>> 
> 
> Thanks for the detailed reply. I will try this.
> 
> 

--
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] CMake 2.8, Xcode generator and XIB files

2011-10-02 Thread Daniel Dekkers
With...

SET_TARGET_PROPERTIES( ${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST 
${PLIST_TEMPLATE} )

... we set a path to a Info.plist template (we actually got separate ones for 
iOS and OSX). Maybe you can call them what you want, haven't tried. 
"Info.plist.in" would be good. I'll try.
These templates look like normal property list files except that they can 
contain CMake variable names, something like this:

...
CFBundleDisplayName
${APP_NAME}
...
CFBundleIdentifier
${APP_IDENTIFIER}
...

where ${APP_NAME} and ${APP_IDENTIFIER} are substituted by CMake automatically 
while a new Info.plist is generated in 
path/to/build//CMakeFiles/[APP_NAME].dir. 
This file is included in the Xcode project, it will appear in the 
Application->Resources folder. Not in the top level Resources folder of the 
project.

I'm not exactly sure what triggers this CMake behavior, I guess "Xcode" 
generation always implies: "Info.plist" generation. 
Or it's dependent on another setting (platform, architecture). Couldn't find 
that in the documentation. 
But i was copying the Info.list myself (with ADD_CUSTOM_COMMAND) and that gave 
all kinds of problems, like code signing errors.

I think it is possible to *not* let CMake perform the substitutions and just 
copy the template, but I haven't got that working yet. That would be handy 
because for some values you would just want to keep the ${...} entries 
unchanged. Xcode uses the same notation for values that are substituted later 
on.

Also see
https://lists.secondlife.com/pipermail/sldev/2008-September/011839.html

Thanks,
Daniel Dekkers

On Oct 2, 2011, at 2:51 PM, g...@novadsp.com wrote:

> Hi Daniel, can you clarify this a bit? Do you have an example?
> 
> On 30/09/2011 15:23, Daniel Dekkers wrote:
>> Correction: not the Info.plist. That is treated differently because CMake 
>> generates its own for the project.
>> You can set a "template" Info.plist though where ${VARIABLE} entries are 
>> subsituted with (known) CMake variables.
>> 
>> On Sep 30, 2011, at 4:14 PM, Daniel Dekkers wrote:
>> 
> 
> Thx++
> 
> 

--
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] CMake 2.8, Xcode generator and XIB files

2011-09-30 Thread Daniel Dekkers
Correction: not the Info.plist. That is treated differently because CMake 
generates its own for the project. 
You can set a "template" Info.plist though where ${VARIABLE} entries are 
subsituted with (known) CMake variables.

On Sep 30, 2011, at 4:14 PM, Daniel Dekkers wrote:

> Hi Jerry,
> 
> I've been battling with .xibs for weeks. What I am finally doing now is not 
> trying to compile and add them to the bundle via CMake myself using custom 
> commands.
> I just add them as sources to ADD_EXECUTABLE(... ${RESOURCES}) and set
> SET_TARGET_PROPERTIES(... PROPERTIES RESOURCE ${RESOURCES}) to make Xcode 
> "aware" of them. They then appear in the top level /Resources folder and 
> Xcode will compile them and place them in the bundle. The same with icons, 
> splashscreens, Info.plist, Settings.bundle, etc.
> 
> Two problems with that..
> - You need Xcode. Although i haven't tried building from the command line in 
> any way.
> - If you have multiple projects, each with it's own resources, they tend to 
> all clump together in the top level /Resources folder. Not what you want. I 
> haven't found a way to seperate them into the individual projects yet. Don't 
> even know if that is possible with Xcode.
> 
> Thanks,
> Daniel Dekkers
> 
> On Sep 30, 2011, at 3:22 PM, g...@novadsp.com wrote:
> 
>> My CMake rules to convert a .XIB file to a .NIB file in the application 
>> bundle work for makefile builds.
>> 
>> However I cannot get the same result when using the Xcode generator. Does 
>> anyone have a working example for XCode 3.X or 4 they can share?
>> 
>> The cmakelists.txt script is
>> 
>> Message("We are generating for Xcode ${this_target}")
>> 
>> # Make sure the '.App' directory tree is correctly created before we build
>> # copy our plist and icon file into place
>> add_custom_command (TARGET ${this_target} PRE_BUILD
>>COMMAND mkdir -p 
>> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app
>>COMMAND mkdir -p 
>> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents
>>COMMAND mkdir -p 
>> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/MacOS
>>COMMAND mkdir -p 
>> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources
>>COMMAND mkdir -p 
>> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources/English.lproj
>>COMMAND cp -n ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist 
>> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents
>>COMMAND cp -n ${CMAKE_CURRENT_SOURCE_DIR}/WV.icns 
>> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources
>>)
>> 
>> # command to convert any existing IB .xib to .nib in the .APP folder
>> add_custom_command (TARGET ${this_target} POST_BUILD
>> COMMAND ${IBTOOL} --errors --warnings --notices 
>> --output-format human-readable-text
>> --compile  
>> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources/English.lproj/MainMenu.nib
>>  
>>${CMAKE_CURRENT_SOURCE_DIR}/MainMenu.xib
>>)
>> 
>> This appears to fail with at the first cp command ...
>> 
>> Thx++
>> 
>> Jerry
>> 
>> 
>> 
>> --
>> 
>> 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

--

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] CMake 2.8, Xcode generator and XIB files

2011-09-30 Thread Daniel Dekkers
Hi Jerry,

I've been battling with .xibs for weeks. What I am finally doing now is not 
trying to compile and add them to the bundle via CMake myself using custom 
commands.
I just add them as sources to ADD_EXECUTABLE(... ${RESOURCES}) and set
SET_TARGET_PROPERTIES(... PROPERTIES RESOURCE ${RESOURCES}) to make Xcode 
"aware" of them. They then appear in the top level /Resources folder and Xcode 
will compile them and place them in the bundle. The same with icons, 
splashscreens, Info.plist, Settings.bundle, etc.

Two problems with that..
- You need Xcode. Although i haven't tried building from the command line in 
any way.
- If you have multiple projects, each with it's own resources, they tend to all 
clump together in the top level /Resources folder. Not what you want. I haven't 
found a way to seperate them into the individual projects yet. Don't even know 
if that is possible with Xcode.

Thanks,
Daniel Dekkers

On Sep 30, 2011, at 3:22 PM, g...@novadsp.com wrote:

> My CMake rules to convert a .XIB file to a .NIB file in the application 
> bundle work for makefile builds.
> 
> However I cannot get the same result when using the Xcode generator. Does 
> anyone have a working example for XCode 3.X or 4 they can share?
> 
> The cmakelists.txt script is
> 
> Message("We are generating for Xcode ${this_target}")
> 
> # Make sure the '.App' directory tree is correctly created before we build
> # copy our plist and icon file into place
> add_custom_command (TARGET ${this_target} PRE_BUILD
> COMMAND mkdir -p 
> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app
> COMMAND mkdir -p 
> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents
> COMMAND mkdir -p 
> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/MacOS
> COMMAND mkdir -p 
> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources
> COMMAND mkdir -p 
> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources/English.lproj
> COMMAND cp -n ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist 
> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents
> COMMAND cp -n ${CMAKE_CURRENT_SOURCE_DIR}/WV.icns 
> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources
> )
> 
> # command to convert any existing IB .xib to .nib in the .APP folder
> add_custom_command (TARGET ${this_target} POST_BUILD
>  COMMAND ${IBTOOL} --errors --warnings --notices 
> --output-format human-readable-text
>  --compile  
> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/WebViewExample.app/Contents/Resources/English.lproj/MainMenu.nib
>  
> ${CMAKE_CURRENT_SOURCE_DIR}/MainMenu.xib
> )
> 
> This appears to fail with at the first cp command ...
> 
> Thx++
> 
> Jerry
> 
> 
> 
> --
> 
> 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] Proper resources placement in Xcode

2011-09-29 Thread Daniel Dekkers
Hi,

I'm targeting Xcode,  I have different apps and a single library the apps 
depend on.
The resources of the individual apps are added simply by appending them to 
ADD_EXECUTABLE(... ${RESOURCES}) in the CMakeLists.txt of the individual 
project.
After this, Xcode is made "aware" of them by setting 
SET_TARGET_PROPERTIES(${APP_NAME} PROPERTIES RESOURCE "${RESOURCES}").  This is 
needed so Xcode knows it has to copy them to the bundle (and sometimes compile 
them first, like with .xib files).

Now my problem is that all the resources of all the apps are inserted in a top 
level Xcode directory "Recources". And not in the "Resources" directory of the 
individual apps.
Does anyone know how i could achieve that?

Kind Regards,

Daniel Dekkers

--

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] CMake, iOS and .xib compilation

2011-09-23 Thread Daniel Dekkers
Hi David,

I'm looking at your iOSNavApp test for iOS.

A few comments as of now:

- universal -

NavApp3 is an iPhone build, if you run it on an iPad (or iPad simulator) it 
"emulates" an iPhone on screen. 
I've made my version of your test "universal" (as in.. iPad and iPhone) by just 
adding an extra target property: XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY '1,2'

- .xib compilation -

I finally understand why your .xib files are compiled correctly, while 
apparently just adding them to add_excutable(). 
It's the RESOURCE "${RESOURCES}" target property. That makes Xcode "resource 
aware".

- architectures -

You explicitly set the CMAKE_OSX_ARCHITECTURE to "armv6;armv7;i386", which 
makes sense. Older devices, newer devices and simulator.
And you set CMAKE_XCODE_EFFECTIVE_PLATFORMS to "-iphoneos;-iphonesimulator"

Which results in:

Architectures: armv6 armv7 i386
Build Active Architecture Only: No
Supported Platforms: iphonesimulator iphoneos
Valid Architectures: armv6 armv7

In my projects until now i've been using $(ARCHS_UNIVERSAL_IPHONE_OS) for 
CMAKE_OSX_ARCHITECTURES, ignoring the CMAKE_XCODE_EFFECTIVE_PLATFORMS resulting 
in:

Architectures: Optimized (armv7) 
Build Active Architecture Only: No
Supported Platforms: iphonesimulator iphoneos
Valid Architectures: armv6 armv7

And it still runs on both devices and simulators. Bit strange.

- artwork (icons/splashscreens/) -

Maybe the next step would be to add an icon.png? 

What are your plans with the iOSNavApp test?

Kind Regards, 
Daniel Dekkers

On Sep 21, 2011, at 7:30 PM, David Cole wrote:

> On Wed, Sep 21, 2011 at 12:41 PM, Daniel Dekkers  
> wrote:
>> Hi David,
>> 
>>> I have tested it manually using the Xcode generator. The point of this
>>> recent work was focused on getting "simulator" and "device" builds
>>> both working within the same Xcode project at the same time, and
>>> allowing the developer to switch back and forth between them in the
>>> Xcode UI.
>>> 
>>> There are *.xib files in this project, and they are included simply by
>>> adding them as source files to add_executable.
>> 
>> Ok, i've tried that and it works. But it seems I have to "label" the .xib 
>> files first...
>> 
>>SET_SOURCE_FILES_PROPERTIES(
>>${RSRC_IOS_XIB_FILES}
>>PROPERTIES
>>MACOSX_PACKAGE_LOCATION Resources
>>)
>> 
>> ... otherwise Xcode just seems to ignore the file (although it makes it 
>> visible in the IDE).
>> If i do "label" it, Xcode recognizes the file, compiles it and adds it to 
>> the bundle in the first steps of the build process.
>> So i deleted my own Cmake .xib compilation script.
>> 
> 
> Excellent -- good to know this was helpful.
> 
> 
>> About the simulator and device builds... much to my surprise my toolchain 
>> file for device works for the simulator as well (both iPad and iPhone).
>> 
>> It looks like this:
>> 
>>MESSAGE(STATUS "Parsing iphone-device toolchain file")
>>SET (CMAKE_SYSTEM_NAME Generic)
>>SET (CMAKE_SYSTEM_VERSION 1)
>>SET (CMAKE_SYSTEM_PROCESSOR arm)
>> 
>>SET (SDKVER "4.3")
>>SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
>>SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${SDKVER}.sdk")
>>SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
>>SET (CMAKE_OSX_ARCHITECTURES "$(ARCHS_UNIVERSAL_IPHONE_OS)") # Either 
>> "$(ARCHS_UNIVERSAL_IPHONE_OS)" or "arm6" "arm7"
>> 
>>SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
>>SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")
>> 
>>SET (CMAKE_FIND_ROOT_PATH "${IPHONE_SDKROOT}" 
>> "/opt/iphone-${SDK_VER}/" "/usr/local/iphone-${SDK_VER}/")
>>SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
>>SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
>>SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
>> 
>> I just include it at the moment. So i'm thinking to remove the 
>> simulator/device distinction altogether and just add these settings to the 
>> main CMakeLists.txt
>> Although i do like the concept of cross-compiling and toolchain files very 
>> much. With future android builds and all.
>> 
> 
> This is also good to know. I'd definitely recommend keeping that stuff
> in the toolchain file rather than putting it directly in the
> CMakeLists.txt file. One of these days I'm going to try out this
> cross-compiling toolchain thing for my own personal edification... :-)
> 
> Let us know if you run into any problems.
> 
> 
> Thanks,
> 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] CMake, iOS and .xib compilation

2011-09-21 Thread Daniel Dekkers
Hi David,

> I have tested it manually using the Xcode generator. The point of this
> recent work was focused on getting "simulator" and "device" builds
> both working within the same Xcode project at the same time, and
> allowing the developer to switch back and forth between them in the
> Xcode UI.
> 
> There are *.xib files in this project, and they are included simply by
> adding them as source files to add_executable.

Ok, i've tried that and it works. But it seems I have to "label" the .xib files 
first...

SET_SOURCE_FILES_PROPERTIES(
${RSRC_IOS_XIB_FILES}
PROPERTIES
MACOSX_PACKAGE_LOCATION Resources
)

... otherwise Xcode just seems to ignore the file (although it makes it visible 
in the IDE).
If i do "label" it, Xcode recognizes the file, compiles it and adds it to the 
bundle in the first steps of the build process.
So i deleted my own Cmake .xib compilation script.

About the simulator and device builds... much to my surprise my toolchain file 
for device works for the simulator as well (both iPad and iPhone).

It looks like this:

MESSAGE(STATUS "Parsing iphone-device toolchain file")
SET (CMAKE_SYSTEM_NAME Generic)
SET (CMAKE_SYSTEM_VERSION 1)
SET (CMAKE_SYSTEM_PROCESSOR arm)

SET (SDKVER "4.3")
SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${SDKVER}.sdk")
SET (CMAKE_OSX_SYSROOT "${SDKROOT}")
SET (CMAKE_OSX_ARCHITECTURES "$(ARCHS_UNIVERSAL_IPHONE_OS)") # Either 
"$(ARCHS_UNIVERSAL_IPHONE_OS)" or "arm6" "arm7"

SET (CMAKE_C_COMPILER "${DEVROOT}/usr/bin/gcc-4.2")
SET (CMAKE_CXX_COMPILER "${DEVROOT}/usr/bin/g++-4.2")

SET (CMAKE_FIND_ROOT_PATH "${IPHONE_SDKROOT}" "/opt/iphone-${SDK_VER}/" 
"/usr/local/iphone-${SDK_VER}/")
SET (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

I just include it at the moment. So i'm thinking to remove the simulator/device 
distinction altogether and just add these settings to the main CMakeLists.txt
Although i do like the concept of cross-compiling and toolchain files very 
much. With future android builds and all.

Kind Regards,

Daniel Dekkers



___
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] CMake, iOS and .xib compilation

2011-09-20 Thread Daniel Dekkers
Hi,

I'm really having a hard time creating a CMake setup for iOS.

After...
- the toolchain files for cross-compiling, 
- the Settings.bundle,
- the Info.plist file,
- the provisioning profiles, 
- the entitlements,
...the latest chapter consists of the Interface Builder .xib files.

An iOS application bundle needs a .nib file that is compiled from a .xib file 
and added to the application bundle. I've got a script for that:

# We need to compile the interface builder *.xib files to *.nib 
files to add to the bundle
# Make sure we can find the 'ibtool' program. If we can NOT 
find it we skip generation of this project
FIND_PROGRAM( IBTOOL ibtool HINTS "/usr/bin" 
"${OSX_DEVELOPER_ROOT}/usr/bin" )
if ( ${IBTOOL} STREQUAL "IBTOOL-NOTFOUND" )
MESSAGE( SEND_ERROR "ibtool can not be found" )
ENDIF()

# Compile the .xib files using the 'ibtool' program with the 
destination being the app package
FOREACH( xib ${RSRC_IOS_XIB_FILES} )
ADD_CUSTOM_COMMAND( TARGET ${APP_NAME} POST_BUILD
COMMAND ${IBTOOL} --errors --warnings --notices 
--output-format human-readable-text
--compile

${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RT_APP_NAME}.app/${xib}.nib # 
iOS uses a flat hierarchy, place directly under .app
${APP_ROOT}/rsrc/apple/ios/${xib}.xib
COMMENT "Compiling 
${APP_ROOT}/rsrc/apple/ios/${xib}.xib")
ENDFOREACH()

But once I use the script. I constantly receive a "A signed resource has been 
added, modified, or deleted." error when running on the device.
This makes some sense, because all the files in the bundle are codesigned and 
adding a new .nib file for every build might give signing problems.

But I'm running out of ideas how to fix this.
Any suggestions?
Or, more general... is there anyone else who is walking, or has walked, this 
CMake/iOS path?

Kind Regards,

Daniel Dekkers



___
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] Interface Builder xib to nib compilation for iOS

2011-09-18 Thread Daniel Dekkers
Hi,

I'm targeting iOS (device and simulator) and setting up CMake to add the 
different resources needed in the bundle.
The "xib" file is giving me some problems.
If I take no further action, the iPhone/iPad simulator run fails with the error:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', 
reason: 'Could not load NIB in bundle: 'NSBundle 
 
(loaded)' with name 'MainWindow''

A missing NIB file in the bundle. 
An example (http://www.vtk.org/Wiki/CMake:OSX_InterfaceBuilderFiles) shows that 
for OSX, you have to compile the xib files into nib files and add these to the 
bundle as a post-build step.
So my guess would be that something similar holds for iOS as well.
But my question is,... where do i add the compiled nib files?

I now do this in the CMakeLists.txt:

# We need to compile the interface builder *.xib files to *.nib files to add to 
the bundle
# Make sure we can find the 'ibtool' program. If we can NOT find it we skip 
generation of this project
FIND_PROGRAM( IBTOOL ibtool HINTS "/usr/bin" "${OSX_DEVELOPER_ROOT}/usr/bin" )
if ( ${IBTOOL} STREQUAL "IBTOOL-NOTFOUND" )
MESSAGE( SEND_ERROR "ibtool can not be found" )
ENDIF()

# Compile the .xib files using the 'ibtool' program with the destination being 
the app package
FOREACH( xib ${RSRC_IOS_XIB_FILES} )
ADD_CUSTOM_COMMAND( TARGET ${RT_APP_NAME} POST_BUILD
COMMAND ${IBTOOL} --errors --warnings --notices --output-format 
human-readable-text 
--compile 

${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RT_APP_NAME}.app/Contents/Resources/${xib}.nib
${RT_APP_ROOT}/rsrc/apple/ios/${xib}.xib
COMMENT "Compiling ${RT_APP_ROOT}/rsrc/apple/ios/${xib}.xib")
ENDFOREACH()

But i don't really trust the "destination" of the compilation step, especially 
for the simulator.
Has anyone got this working?

Kind Regards,

Daniel Dekkers



___
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] Xcode IDE hierarchy view on CMake projects

2011-09-12 Thread Daniel Dekkers
Hi,

I've managed to get working multi-platform/-architecture meta-builds for 
Windows, Mac OS X and iOS via CMake.
I get the following hierarchy shown in the XCode (4.0.2) IDE:

'MetaName'
  + Sources
+ ALL_BUILD
+ 'ProjectName_1'
  + Source Files
  + Resources
+ 'ProjectName_2'
  + Source Files
  + Resources
  ...
+ 'ProjectName_n'
  + Source Files
  + Resources
  + Resources
  + Products

I don't understand why the top level 'Sources' directory exists. A bit 
annoying, because it contains other data, like resources and CMake data files.
Furthermore, what is the role of 'Resources' on that same level, project 
independent resources?

In Visual Studio (2008) the hierarchy looks more logical:

Solution 'MetaName'
+ ALL_BUILD
+ 'ProjectName_1'
+ 'ProjectName_2'
...
+ 'ProjectName_n'

Is this common Xcode/CMake behavior or am I doing something wrong?

Kind Regards,
Daniel Dekkers


___
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] Adding "Settings.bundle" to an Xcode, iOS project

2011-09-07 Thread Daniel Dekkers
Hi,

I'm targeting iOS and wondering how to add a "Settings.bundle" directory to the 
project via CMake.
The "Settings.bundle" contains preferences for the app that can be set by the 
user in the settings pane of the iPhone/iPad device.
If i manually add it (right click, add files to "[appname]"...) in Xcode, it 
works fine, but i don't know the corresponding CMake command.

Kind Regards,

Daniel Dekkers
___
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