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: [email protected] [mailto:[email protected]] On Behalf
Of [email protected]
Sent: Monday, February 20, 2012 5:37 AM
To: [email protected]
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.

<<image001.png>>

--

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

Reply via email to