[cmake-developers] [CMake 0012871]: add_definitions adds flags to RC_DEFINES
Mantis Bug Tracker
mantis at public.kitware.com
Tue Jan 10 09:53:43 EST 2012
The following issue has been SUBMITTED.
======================================================================
http://www.cmake.org/Bug/view.php?id=12871
======================================================================
Reported By: Sam Morris
Assigned To:
======================================================================
Project: CMake
Issue ID: 12871
Category: CMake
Reproducibility: always
Severity: major
Priority: normal
Status: new
======================================================================
Date Submitted: 2012-01-10 09:53 EST
Last Modified: 2012-01-10 09:53 EST
======================================================================
Summary: add_definitions adds flags to RC_DEFINES
Description:
The attached project tries to create an executable from a C++ file and a Windows
resource script:
CMakeLists.txt contains:
project(restest)
add_definitions(-msse)
add_executable(a a.cpp a_res.rc)
The build fails because -msse ends up in RC_DEFINES, which is passed to windres
to compile the resource script.
Steps to Reproduce:
$ make VERBOSE=1
/usr/bin/cmake -H/home/sam/src/cmake/rc -B/home/sam/src/cmake/rc/build
--check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/sam/src/cmake/rc/build/CMakeFiles
/home/sam/src/cmake/rc/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/sam/src/cmake/rc/build'
make -f CMakeFiles/a.dir/build.make CMakeFiles/a.dir/depend
make[2]: Entering directory `/home/sam/src/cmake/rc/build'
cd /home/sam/src/cmake/rc/build && /usr/bin/cmake -E cmake_depends "Unix
Makefiles" /home/sam/src/cmake/rc /home/sam/src/cmake/rc
/home/sam/src/cmake/rc/build /home/sam/src/cmake/rc/build
/home/sam/src/cmake/rc/build/CMakeFiles/a.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/sam/src/cmake/rc/build'
make -f CMakeFiles/a.dir/build.make CMakeFiles/a.dir/build
make[2]: Entering directory `/home/sam/src/cmake/rc/build'
/usr/bin/cmake -E cmake_progress_report /home/sam/src/cmake/rc/build/CMakeFiles
2
[ 50%] Building RC object CMakeFiles/a.dir/a_res.res
/usr/bin/i686-w64-mingw32-windres -O coff -msse
/home/sam/src/cmake/rc/a_res.rc CMakeFiles/a.dir/a_res.res
/usr/bin/i686-w64-mingw32-windres: invalid option -- 'm'
Usage: /usr/bin/i686-w64-mingw32-windres [option(s)] [input-file] [output-file]
The options are:
-i --input=<file> Name input file
-o --output=<file> Name output file
-J --input-format=<format> Specify input format
-O --output-format=<format> Specify output format
-F --target=<target> Specify COFF target
--preprocessor=<program> Program to use to preprocess rc file
--preprocessor-arg=<arg> Additional preprocessor argument
-I --include-dir=<dir> Include directory when preprocessing rc file
-D --define <sym>[=<val>] Define SYM when preprocessing rc file
-U --undefine <sym> Undefine SYM when preprocessing rc file
-v --verbose Verbose - tells you what it's doing
-c --codepage=<codepage> Specify default codepage
-l --language=<val> Set language when reading rc file
--use-temp-file Use a temporary file instead of popen to read
the preprocessor output
--no-use-temp-file Use popen (default)
-r Ignored for compatibility with rc
@<file> Read options from <file>
-h --help Print this help message
-V --version Print version information
FORMAT is one of rc, res, or coff, and is deduced from the file name
extension if not specified. A single file name is an input file.
No input-file is stdin, default rc. No output-file is stdout, default rc.
/usr/bin/i686-w64-mingw32-windres: supported targets: pe-i386 pei-i386
elf32-i386 elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary
ihex
make[2]: *** [CMakeFiles/a.dir/a_res.res] Error 1
make[2]: Leaving directory `/home/sam/src/cmake/rc/build'
make[1]: *** [CMakeFiles/a.dir/all] Error 2
make[1]: Leaving directory `/home/sam/src/cmake/rc/build'
make: *** [all] Error 2
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2012-01-10 09:53 Sam Morris New Issue
2012-01-10 09:53 Sam Morris File Added: rc.tar.gz
======================================================================
More information about the cmake-developers
mailing list