[CMake] Problem with VS 7.0/7.1 generators

Jorge Rodriguez jrodriguez at providencesoftware.com
Thu Mar 17 09:44:31 EST 2005


Sorry, I simplified that line a bit in order to keep it spiffy and 
concise. Here's the full line:

SET_SOURCE_FILES_PROPERTIES(${SRCS} PROPERTIES COMPILE_FLAGS "-I. 
-I$${XVT_SOURCE_DIR}/include -DSTRICT -D_CTYPE_DISABLE_MACROS) 
${APPVER_FLAGS}")

The includes could be moved out into an INCLUDE_DIRECTORIES and the 
define compile flags into ADD_DEFINITIONS and that will probably work as 
a workaround.

I'll submit a bug.

William A. Hoffman wrote:

>This sounds like a bug, please put it in the bug tracker.
>However, there should be no reason to use COMPILE_FLAGS to
>set a -I path.  You can use the INCLUDE_DIRECTORIES command.
>However, -I. is not usually a good idea, as . can mean different
>things if you build in or out of source.   
>This should work in both cases:
>
>INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
>
>-Bill
>
>At 05:34 PM 3/16/2005, Jorge Rodriguez wrote:
>  
>
>>You're right -- with a simple test case it works as it should. There's something about this specific project that's causing it to work incorrectly, and it boils down to this line:
>>
>>SET_SOURCE_FILES_PROPERTIES(${SRCS} PROPERTIES COMPILE_FLAGS "-I.")
>>
>>The SRCS variable in my test case is just a single .rc file, but with that line commented out the .rc file is set to build as a resource and with that line included the .rc file is set to build as a c++ file. What do you think?
>>
>>William A. Hoffman wrote:
>>
>>    
>>
>>>That should work.  Is it possible you changed the defaults in VS7 to treat a .rc
>>>file like c++ to get syntax highlighting or something?   If you create a project
>>>without cmake and add an rc file does it have the same problem?   
>>>
>>>-Bill
>>>
>>>
>>>At 04:58 PM 3/16/2005, Jorge Rodriguez wrote:
>>>
>>>
>>>      
>>>
>>>>Ack, sorry! I intended to include the version number but forgot :/ I'm using cmake 2.0.5.
>>>>
>>>>William A. Hoffman wrote:
>>>>
>>>>  
>>>>
>>>>        
>>>>
>>>>>What version of cmake are you using?  Sounds like a bug, but cmake
>>>>>itself adds a .rc file to the build so I am bit surprised that it does
>>>>>not work??
>>>>>
>>>>>-Bill
>>>>>
>>>>>
>>>>>At 03:07 PM 3/16/2005, Jorge Rodriguez wrote:
>>>>>
>>>>>
>>>>>    
>>>>>
>>>>>          
>>>>>
>>>>>>I am converting a cross-platform library to cmake I have encountered some strange behavior from cmake's Visual Studio 7.0/7.1 generators. In the CMakeLists.txt, the .def and .rc are included in the list of sources like so:
>>>>>>
>>>>>>SET( BASE_SRCS ${BASE_SRCS} win32/${XN_BA_DEF} win32/${XN_BA_VER_RC} )
>>>>>>
>>>>>>ADD_LIBRARY(${XN_BA_DLL} SHARED ${BASE_SRCS})
>>>>>>
>>>>>>A project generated with the nmake generator or the 6.0 generator works fine, but when the 7.0/7.1 project files are built they emit strange errors and fail because Visual Studio is trying to compile the .def and .rc as with the C++ compiler. You can get it to build correctly by setting the .rc to compile with the resource compiler tool and excluding the .def from the build, but shouldn't cmake do this automatically? Am I doing something wrong?
>>>>>>_______________________________________________
>>>>>>CMake mailing list
>>>>>>CMake at cmake.org
>>>>>>http://www.cmake.org/mailman/listinfo/cmake
>>>>>>
>>>>>>      
>>>>>>            
>>>>>>
>>>>>    
>>>>>          
>>>>>
>>>>_______________________________________________
>>>>CMake mailing list
>>>>CMake at cmake.org
>>>>http://www.cmake.org/mailman/listinfo/cmake
>>>>  
>>>>        
>>>>
>>>      
>>>
>>_______________________________________________
>>CMake mailing list
>>CMake at cmake.org
>>http://www.cmake.org/mailman/listinfo/cmake
>>    
>>
>
>  
>



More information about the CMake mailing list