Bug #1220

CURRENT_DATE function seems to fail on Windows

Added by J. Moringen over 11 years ago. Updated almost 11 years ago.

Status:ResolvedStart date:10/25/2012
Priority:LowDue date:
Assignee:J. Wienke% Done:

100%

Category:cmake
Target version:Robotics Service Bus - rsb-0.9

Description

V. Losing schrieb:

Beim generieren des VS-Projects für rsb selbst, kommt der Fehler dass die Variable "CURRENT_DATE" nicht gefunden werden kann

CMakeCache.txt Magnifier - Minimal cmake project to check the platform test (10.7 KB) J. Wienke, 11/04/2012 12:27 PM

Associated revisions

Revision b37b0d2a
Added by J. Wienke over 11 years ago

Fix implementation of the CMake function CURRENT_DATE for windows.

Shell-built-in functions cannot be called directly by CMake's
execute_process. Instead, cmd.exe needs to be called to execute the
built-in function.

refs #1220

Revision fc3516ba
Added by J. Wienke over 11 years ago

Backport: Fix implementation of the CMake function CURRENT_DATE for
windows.

Shell-built-in functions cannot be called directly by CMake's
execute_process. Instead, cmd.exe needs to be called to execute the
built-in function.

fixes #1220

Revision 207485ed
Added by J. Wienke over 11 years ago

Disable CURRENT_DATE support for windows.

There is no easy to implement way to get the current date on
windows. Make the warning a status message to not confuse users

refs #1220

Revision 6e82bb68
Added by J. Wienke over 11 years ago

Backport: Disable CURRENT_DATE support for windows.

There is no easy to implement way to get the current date on
windows. Make the warning a status message to not confuse users

refs #1220

Revision c43dda11
Added by J. Wienke almost 11 years ago

Add support for Windows in the cmake CURRENT_DATE function.

This uses a batch script calling the WMI host to acquire a parseable
date which is not localized by windows.

fixes #1220

History

#1 Updated by J. Wienke over 11 years ago

can someone please provide the cmake output indicating the failure?

#2 Updated by V. Losing over 11 years ago

Here is the cmake output:

CMake Warning at cmake/Modules/CurrentDate.cmake:42 (MESSAGE):
error calling date command
Call Stack (most recent call first):
CMakeLists.txt:30 (CURRENT_DATE)

#3 Updated by J. Wienke over 11 years ago

Do you have cygwin or something comparable installed which provides unix tools? Can you run a terminal please and show the output of ``date``, ``date -h`` and ``date /h``?

#4 Updated by V. Losing over 11 years ago

no i haven't installed cygwin or something compareable.
i've added a description link to the date.exe of windows
http://ss64.com/nt/date.html

when i just call "date" i'm requested to provide the current date.
"date /T" delivers the current date

#5 Updated by J. Wienke over 11 years ago

This is weird. Actually this is exactly what the macro should be doing. Depending on the operating system, different arguments should be chosen.

Could you please try the attached CMakeListst.txt to see if the test works well. Just put it somewhere and let cmake run on it. Afterwards, please paste the output of cmake to this issue.

#6 Updated by J. Wienke over 11 years ago

  • Status changed from New to In Progress

#7 Updated by J. Wienke over 11 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Applied in changeset rsc|commit:fc3516ba993c2f095ee3e55b51095a792009f6e6.

#8 Updated by J. Wienke over 11 years ago

  • Status changed from Resolved to In Progress

Narf, the date command on windows outputs the date in the local format and there is no way to tell it to use a fixed format.

#9 Updated by J. Wienke over 11 years ago

  • Priority changed from Normal to Low
  • % Done changed from 100 to 40

There is now at least a workaround for windows without a warning.

#10 Updated by J. Wienke almost 11 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 40 to 100

Applied in changeset rsc|commit:c43dda11ab8272b8404e72cdb64a67d49672b98a.

Also available in: Atom PDF