[CMake] Problem with including resource files for visual studio .NET when using 2.4.2

Neumann, Jan (SCR US) jan.neumann at siemens.com
Thu Jul 13 12:26:21 EDT 2006


Hi,
 
I have used CMake 2.2.3 for over a year with my projects and never had a
problem. Today I upgraded to 2.4.2, and the project files were generated
fine for Visual Studio 2003 .NET, but during compilation I am getting
very strange compilation errors where the compiler complains that the
binary .ico files in /res directory have unknown characters. 
 
e.g.:
 
Compiling...

VehicleDetectAppDoc.ico

\home\SRC\PedestrianDetection\PedDetectVDO\res\VehicleDetectAppDoc.ico(0
) : warning C4821: Unable to determine Unicode encoding type, please
save the file with signature (BOM)

\home\SRC\PedestrianDetection\PedDetectVDO\res\VehicleDetectAppDoc.ico(1
) : error C2018: unknown character '0x1'

\home\SRC\PedestrianDetection\PedDetectVDO\res\VehicleDetectAppDoc.ico(1
) : error C2018: unknown character '0x2'

 
 
I assume this come from the fact that I simply  include all the resource
files (both binary and text files)
 as input to the ADD_EXECUTABLE(...) command. This always worked fine in
2.2.3, but it seems that there are some settings that 2.4.2 generates
that make the compiler assume that all the resource files are text
files. I included a copy of my CMake file below
 
Could someone tell me what is the correct way to include the resource
files in my project via cmake, so that I am able to use 2.4.2. in the
future?
 
Thanks a lot,
 
Jan
 
-------------------------------------------------------------------
 
CMakeLists.txt: 
 
 
SET(PedDetectVDO_SRCS
FrameIndexDialog.cpp
MainFrm.cpp
VehicleDetectApp.cpp
VehicleDetectAppDoc.cpp
VehicleDetectAppView.cpp
../PedDetectConsole/PedDetectInterface.cpp
stdafx.cpp
)
 
## header files to be installed
FILE(GLOB PedDetectVDO_HEADER *.h)
 
SET(PedDetectVDO_RESOURCES
VehicleDetectApp.rc
res/VehicleDetectApp.ico
res/VehicleDetectApp.rc2
res/Toolbar.bmp
res/VehicleDetectApp.manifest
res/VehicleDetectAppDoc.ico
)
 
SET(PedDetectVDO_HEADER
${PedDetectVDO_HEADER}
../PedDetectConsole/PedDetectInterface.h
)
 
# add the necessary include directories
INCLUDE_DIRECTORIES(BEFORE ${PedDetectLib_INCLUDES} 
${PedestrianDetection_SOURCE_DIR}/PedDetectNIR
)
 
ADD_DEFINITIONS(-D_AFXDLL)
 
IF (VISUAL_IDE)
  ADD_EXECUTABLE(PedDetectVDO  WIN32
              ${PedDetectVDO_SRCS} 
              ${PedDetectVDO_HEADER}
              ${PedDetectVDO_RESOURCES})
ELSE (VISUAL_IDE)
  ADD_EXECUTABLE(PedDetectVDO  WIN32
              ${PedDetectVDO_SRCS})
ENDIF (VISUAL_IDE)
 
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG 
"${CMAKE_EXE_LINKER_FLAGS_DEBUG} 
/VERBOSE:LIB"
)
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE 
"${CMAKE_EXE_LINKER_FLAGS_RELEASE} 
/VERBOSE:LIB"
)
 
# set dependencies
TARGET_LINK_LIBRARIES(PedDetectVDO 
PedDetectLib PedDetectNIR vfw32
${IO_EXTERNAL_LIBS}
)
 
 
 

---------------------------------------

Jan Neumann, PhD
Member of Technical Staff

Siemens Corporate Research
755 College Rd East
Princeton, NJ 08540, USA

Phone: +1 (609) 734 3653
Cell: +1 (240) 274 2806
Fax: +1 (609) 734 6565 
Email: jan.neumann at siemens.com


 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20060713/8f5fd77d/attachment.htm


More information about the CMake mailing list