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
 
  ItemGroup
ClInclude Include=..\..\HeaderOnlyTest\test.xml /
ClCompile Include=..\..\HeaderOnlyTest\main.c  /
  /ItemGroup
 
 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-20 Thread Brad King
On 06/19/2012 04:27 PM, Daniel Dekkers wrote:
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
 PROJECT(HeaderOnlyTest)
 SET(SOURCE_FILE main.c)
 SET(RESOURCE_FILE test.xml)
 SET_SOURCE_FILES_PROPERTIES(${RESOURCE_FILE} PROPERTIES HEADER_FILE_ONLY
 TRUE) 
 ADD_EXECUTABLE(HeaderOnlyTest ${SOURCE_FILE} ${RESOURCE_FILE})
 SET_TARGET_PROPERTIES(HeaderOnlyTest PROPERTIES RESOURCE ${RESOURCE_FILE})
 
 With the VS2010 generator, test.xml is included.

With CMake 2.8.8 I get no test.xml at all in the project file.
If I eliminate the RESOURCE property then I get test.xml with
type ClInclude in the .vcxproj file, and it does not build.

Please attach your resulting HeaderOnlyTest.vcxproj and the
CMakeCache.txt from the 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
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 d.dekk...@cthrough.nl
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-19 Thread Brad King
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 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 Brad King
On 06/19/2012 11:28 AM, Daniel Dekkers wrote:
 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.

I just tried 2.8.8 and it works fine for me.  Please provide a
minimal source tarball with CMakeLists.txt and source files
that reproduces the problem.  Also specify the exact output
of cmake --version and the exact command line you use to
run 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 Brad King
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
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-13 Thread Petr Kmoch
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 d.dekk...@cthrough.nl 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-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 d.dekk...@cthrough.nl
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-13 Thread Michael Wild
On 06/13/2012 12:13 PM, 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

You can use configure_file with COPYONLY in the CMakeLists.txt files,
but then, you'll have to reconfigure every time one of them changes.

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


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

2012-06-13 Thread Tim Hutton
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 d.dekk...@cthrough.nl 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 d.dekk...@cthrough.nl
 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



-- 
Tim Hutton - http://www.sq3.org.uk - http://profiles.google.com/tim.hutton/
--

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
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 d.dekk...@cthrough.nl 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 
 d.dekk...@cthrough.nl
 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



--
Tim Hutton - http://www.sq3.org.uk - http://profiles.google.com/tim.hutton/

--

Powered by www.kitware.com

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

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

2012-06-13 Thread Petr Kmoch
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 d.dekk...@cthrough.nl 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.txt
 (see the section copy installation files to build folder)

 On 13 June 2012 11:13, Daniel Dekkers d.dekk...@cthrough.nl 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
 d.dekk...@cthrough.nl
 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

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 d.dekk...@cthrough.nl
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 d.dekk...@cthrough.nl 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 
 d.dekk...@cthrough.nl
 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

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

2012-06-12 Thread Bill Hoffman

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


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