[CMake] custom command and differences between VS2005 and VS2010

aaron.meadows at thomsonreuters.com aaron.meadows at thomsonreuters.com
Tue Feb 21 08:48:02 EST 2012


I tried this out with VS 2010 SP0 Win64.  Here's my CMakeLists:

 

cmake_minimum_required(VERSION 2.8)

 

project(Test CXX)

 

file(WRITE foo.h "//Some Foo Header ")

file(WRITE foo.cpp "int main(int argc, char** argv) { return 0; }\n")

file(WRITE foo.txt "This is the foo text file (simulated config)")

 

set( etc_hdrs foo.h)

 

set( etc_srcs foo.cpp foo.txt)

 

add_custom_target( etc SOURCES ${etc_hdrs} ${etc_srcs} )

 

For me, the resulting VS Solution has the text file as a member of the
project:

 

 

 

Also ended up with an item named 'etc', which seems wrong.. not sure why
that would have happened.  I'm using CMake 2.8.7 on Windows 7.  I wonder
if there is something else that is a problem.  What version of CMake are
you using?

 

 

 

Aaron Meadows

 

From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf
Of walter.schwarz at dzbank.de
Sent: Monday, February 20, 2012 5:37 AM
To: cmake at cmake.org
Subject: [CMake] custom command and differences between VS2005 and
VS2010

 

our project contains a directory with config files. to make the config
files (and other externally supplied header files) visible in the visual
studio solution, the custom command shown below was specified in the
directory. 

this worked well with the generator for Visual Studio 2005. it doesn't
any more with the generator for visual studio 2010. 

- is this intentional or is it a bug? 
- what can i do to fix this? 

/regards   Walter Schwarz 


# Targets: none - placeholder for Murex headers 
#
------------------------------------------------------------------------
---- 
# Library: none 
#
------------------------------------------------------------------------
---- 

set( etc_hdrs 
      ${FLEX_INCLUDE_DIRS}/mdtypes.h 
      ... list shortened ... 
) 

set( etc_srcs FlexModelConfig.cfg configFile.txt ) 

include_directories( 
        ${FLEX_INCLUDE_DIRS} 
) 

add_custom_target( etc SOURCES ${etc_hdrs} ${etc_srcs} ) 


This email was sent to you by Thomson Reuters, the global news and information company. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120221/03bd0460/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 11546 bytes
Desc: image001.png
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120221/03bd0460/attachment-0001.png>


More information about the CMake mailing list