[cmake-developers] [CMake 0012413]: NMAKE generator: handling of target names with invalid nmake names (but valid otherwise) is missing

Mantis Bug Tracker mantis at public.kitware.com
Fri Aug 19 19:50:08 EDT 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=12413 
====================================================================== 
Reported By:                Mikhail Titov
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12413
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-08-19 19:50 EDT
Last Modified:              2011-08-19 19:50 EDT
====================================================================== 
Summary:                    NMAKE generator: handling of target names with
invalid nmake names (but valid otherwise) is missing
Description: 
nmake expects target name made of characters, digits, and underscore.
When I have + in the name of the target (I'd like to build
libxml++-2.34-vc90-d.dll), nmake fails to process build.make with the following
error:

C:\workspace\gtkmm.build>nmake -f
"libxml++-2.34.1\libxml++\CMakeFiles\libxml++-2.34.dir\build.make"

Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

libxml++-2.34.1\libxml++\CMakeFiles\libxml++-2.34.dir\build.make(1123) : fatal
error U1001: syntax error : illegal character '+' in macro
Stop.

It would be nice if CMake somehow took care of "smart" nmake target name
generation.

Steps to Reproduce: 
Here is the snippet from CMakeLists.txt

add_library(libxml++-${XMLMM_VERSION} SHARED ${XMLMM_SRCS} libxml++.def
../${EXTRA}/libxml++/libxml++.rc)
#set_target_properties(libxmlmm-${XMLMM_VERSION})

add_custom_command (OUTPUT libxml++.def
COMMAND ECHO Will be generated later > libxml++.def
)
add_custom_command(TARGET libxml++-${XMLMM_VERSION} PRE_LINK
COMMAND	gendef ${CMAKE_CURRENT_BINARY_DIR}/libxml++.def
libxml++-${XMLMM_VERSION}${POSTFIX}.dll
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/libxml++-${XMLMM_VERSION}.dir/*.obj
)

target_link_libraries(libxml++-${XMLMM_VERSION} xml2.lib
glibmm-${GLIBMM_VERSION} giomm-${GLIBMM_VERSION} sigc-${SIGC_VERSION})

install(TARGETS libxml++-${XMLMM_VERSION}
LIBRARY DESTINATION "lib"
ARCHIVE DESTINATION "lib"
RUNTIME DESTINATION "bin")



Additional Information: 
I ended up using OUTPUT_NAME property as a workaround:

set_target_properties(xmlpp-${XMLMM_VERSION} PROPERTIES OUTPUT_NAME
xml++-${XMLMM_VERSION})

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-08-19 19:50 Mikhail Titov  New Issue                                    
======================================================================




More information about the cmake-developers mailing list