CMake Windows codecheck error

Bug #535616 reported by Kiscsirke
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Low
Unassigned

Bug Description

This happens for me If I try to run cmake on Windows with codecheck, so for example with the default Debug build (though not with Release build). It is a regression from revision 4968. The error messages are like hundreds of these:

"CMake Error: Cannot open file for write: D:/prog/widelands/bzr/widelands/build_cmake/src/CMakeFiles/D:_prog_widelands_bzr_widelands_src_ai_ai_help_structs_cc_codecheck_stamp_.dir/build.make.tmp
CMake Error: : System Error: Invalid argument
CMake Error: Could not create D:/prog/widelands/bzr/widelands/build_cmake/src/CMakeFiles/D:_prog_widelands_bzr_widelands_src_ai_ai_help_structs_cc_codecheck_stamp_.dir/cmake_clean.cmake"

With some googling and stuff, I found the problem to be with line 37 (currently) in the src/CMakeLists.txt, this one:

"add_custom_target(${stamp} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/codecheck-stamps/${stamp})"

The same problem and a solution can be found here:
http://<email address hidden>/msg03178.html , although I don't understand fully, but for someone more into CMake it might make sense.

Revision history for this message
Timowi (timo-wingender) wrote :

The problem is the way how the string for the target is created. It takes the path and replaces "." and "/" by an underscore. This works fine under unix like systems but not with windows. The problem is the colon in the path. I fixed it by adding it to the regexp.

--- src/CMakeLists.txt
+++ src/CMakeLists.txt
@@ -24,7 +24,7 @@

 if (CMAKE_BUILD_TYPE STREQUAL Debug)
   foreach(sourcefile ${WL_SRCS} ${WL_TEST_SRCS})
- string(REGEX REPLACE "\\.|\\/" "_" sourcenoslash ${sourcefile})
+ string(REGEX REPLACE "\\.|\\/|:" "_" sourcenoslash ${sourcefile})
     get_filename_component(sourcename ${sourcefile} NAME)
     set(stamp ${sourcenoslash}_codecheck_stamp_)
     set(PREFIX_WL_SRCS ${PREFIX_WL_SRCS};${CMAKE_CURRENT_BINARY_DIR}/codecheck-stamps/${stamp})

Changed in widelands:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Kiscsirke (csirkeee) wrote :

Okay, now cmake has no problems running, and I can build, but make doesn't have a "codecheck" target, instead a separate make target for codechecking each file. I guess that's not the expected behaviour?

tags: added: buildsystem
removed: buildsytem
Revision history for this message
Jens Beyer (qcumber-some) wrote :

This was as expected, but on Trunk now a different solution has been found. Make codecheck now exists, but does not run automatically.
Setting this to "Fix committed".

Changed in widelands:
status: Confirmed → Fix Committed
Revision history for this message
SirVer (sirver) wrote :

Releasd in build15-rc1

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.