[CMake] custom command and differences between VS2005 and VS2010

walter.schwarz at dzbank.de walter.schwarz at dzbank.de
Wed Feb 22 02:48:54 EST 2012


Hi Aaron,

thank you very much für your analysis. we are currently using cmake, ver 
2.8.2.

the effect disappears with cmake 2.8.7. so we have to go for an upgrade.

/thanks again and best regards    Walter



Von:    aaron.meadows at thomsonreuters.com
An:     walter.schwarz at dzbank.de, cmake at cmake.org
Datum:  21.02.2012 14:48
Betreff:        RE: [CMake] custom command and differences between VS2005 
and VS2010




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:

 

[IMAGE]

 

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.[attachment "image001.png" deleted by Walter 
Schwarz/CT/Frankfurt/DZ BANK] 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120222/5d0d8f9c/attachment-0001.htm>


More information about the CMake mailing list