Bug 56616 - CMakeLists.txt failed to support nmake
Summary: CMakeLists.txt failed to support nmake
Status: CLOSED FIXED
Alias: None
Product: APR
Classification: Unclassified
Component: APR-util (show other bugs)
Version: 1.5.3
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-12 11:08 UTC by Chuck Liu
Modified: 2014-09-20 12:35 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chuck Liu 2014-06-12 11:08:38 UTC
I use cmake to generate "NMake Makefiles".
But it failed to build with below error:
H:\work\apr-util-1.5.3\libaprutil.rc(56) : error RC2104 : undefined keyword or key name: apr_dbd_odbc\

The problem is the excessive \ & ".
It should be change to:

  IF(MSVC)
  SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_FLAGS "-DDLL_NAME=\"apr_crypto_openssl\"")
  ELSE()
  SET_TARGET_PROPERTIES(apr_crypto_openssl-1 PROPERTIES COMPILE_FLAGS "-DDLL_NAME=\"\\\"apr_crypto_openssl\\\"\"")
  ENDIF()

  IF(MSVC)
  SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_FLAGS "-DDLL_NAME=\"apr_dbd_odbc\"")
  ELSE()
  SET_TARGET_PROPERTIES(apr_dbd_odbc-1 PROPERTIES COMPILE_FLAGS "-DDLL_NAME=\"\\\"apr_dbd_odbc\\\"\"")
  ENDIF()

  IF(MSVC)
  SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_FLAGS "-DDLL_NAME=\"apr_ldap\"")
  ELSE()
  SET_TARGET_PROPERTIES(apr_ldap-1 PROPERTIES COMPILE_FLAGS "-DDLL_NAME=\"\\\"apr_ldap\\\"\"")
  ENDIF()


This is the method used by CMakeLists.txt in httpd.
Comment 1 Jeff Trawick 2014-06-12 14:02:33 UTC
I encountered this recently with cmake 2.8.<recent> but I don't have a permanent fix yet.  I think that it needs different logic for 2.8.<earlier> and NMake Makefiles, but I'll verify.  

What version of cmake are you using?

Thanks!
Comment 2 Chuck Liu 2014-06-12 14:34:49 UTC
cmake-2.8.12.2

(In reply to Jeff Trawick from comment #1)
> I encountered this recently with cmake 2.8.<recent> but I don't have a
> permanent fix yet.  I think that it needs different logic for 2.8.<earlier>
> and NMake Makefiles, but I'll verify.  
> 
> What version of cmake are you using?
> 
> Thanks!
Comment 3 Chuck Liu 2014-06-12 14:37:09 UTC
BTW. Please also take a look at the same bug with httpd.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56615

(In reply to Jeff Trawick from comment #1)
> I encountered this recently with cmake 2.8.<recent> but I don't have a
> permanent fix yet.  I think that it needs different logic for 2.8.<earlier>
> and NMake Makefiles, but I'll verify.  
> 
> What version of cmake are you using?
> 
> Thanks!
Comment 4 Jeff Trawick 2014-09-16 01:41:20 UTC
This was fixed previously with

http://svn.apache.org/viewvc?view=revision&revision=1543401

I had forgotten about that in June when you posted this report.

A new apr-util 1.5.x release with the fix is expected to be available soon.
Comment 5 Jeff Trawick 2014-09-20 12:35:09 UTC
The fix is in APR-util 1.5.4, which will be announced in a couple of days.