The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=14933 
====================================================================== 
Reported By:                Mathäus Mendel
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14933
Category:                   (No Category)
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-05-24 15:29 EDT
Last Modified:              2014-05-24 15:29 EDT
====================================================================== 
Summary:                    CMake set wrong flags to RC compiler
Description: 
The Microsoft Resource Compiler fails to compile any resource file that have an
#include directive. Generating the following error:

fatal error RC1015: cannot open include file '<filename>.h'.

Where <filename> is any file you may include.

Steps to Reproduce: 
On the CMakeLists.txt, add the following instruction:

add_definitions(-WX) # treat warnings as errors.

And create a target with a .rc file on it's source list.

Additional Information: 
CMake is passing the CXX/C compiler flags to the Resource Compiler, which it
should not.

On Modules/Platform/Windows-MSVC.cmake:59 

# make sure to enable languages after setting configuration types
enable_language(RC)
set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")

The MSVC compiler flag -WX will tell the Resource compiler to "ignore the
INCLUDE env variable and warn on invalid code page", thus, breaking the build.

My recommendation is to remove the <FLAGS> from the directive, since all the
compiler flags are meaningless to the Resource compiler, and/or create a new one
that will directly reflect the user intention to change the RC compiler
behavior, like <RC_FLAGS>.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-05-24 15:29 Mathäus Mendel New Issue                                    
2014-05-24 15:29 Mathäus Mendel File Added: cmake-rc-bug.zip                   

======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to