View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012413CMakeCMakepublic2011-08-19 19:502012-02-06 06:07
ReporterMikhail Titov 
Assigned ToBill Hoffman 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformWin32OSWindowsOS VersionXP
Product VersionCMake 2.8.5 
Target VersionCMake 2.8.6Fixed in VersionCMake 2.8.6 
Summary0012413: NMAKE generator: handling of target names with invalid nmake names (but valid otherwise) is missing
Descriptionnmake 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 ReproduceHere 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 InformationI ended up using OUTPUT_NAME property as a workaround:

set_target_properties(xmlpp-${XMLMM_VERSION} PROPERTIES OUTPUT_NAME xml++-${XMLMM_VERSION})
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0027267)
Bill Hoffman (manager)
2011-08-24 16:14

I have checked in a fix that should allow targets to have + in the name.

$ ssh git@cmake.org stage cmake merge -b next fix_nmake_var_plus
Fetching upstream next
Merge topic 'fix_nmake_var_plus' into next

281f51e Fix for bug 0012413, nmake did not handle targets with + in the name.

Pushing upstream next
To git@cmake.org:cmake.git

It is in the next branch of CMake git.
(0028506)
David Cole (manager)
2012-02-06 06:07

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2011-08-19 19:50 Mikhail Titov New Issue
2011-08-24 16:14 Bill Hoffman Note Added: 0027267
2011-08-24 16:14 Bill Hoffman Assigned To => Bill Hoffman
2011-08-24 16:14 Bill Hoffman Status new => assigned
2011-09-12 17:16 David Cole Status assigned => resolved
2011-09-12 17:16 David Cole Fixed in Version => CMake 2.8.6
2011-09-12 17:16 David Cole Resolution open => fixed
2011-09-12 17:16 David Cole Target Version => CMake 2.8.6
2012-02-06 06:07 David Cole Note Added: 0028506
2012-02-06 06:07 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team