Merge lp:~shevonar/widelands/fix-cmake-codecheck into lp:widelands

Proposed by Shevonar
Status: Merged
Merged at revision: 5987
Proposed branch: lp:~shevonar/widelands/fix-cmake-codecheck
Merge into: lp:widelands
Diff against target: 41 lines (+16/-7)
2 files modified
src/CMakeLists.txt (+1/-1)
src/CodeCheck.cmake (+15/-6)
To merge this branch: bzr merge lp:~shevonar/widelands/fix-cmake-codecheck
Reviewer Review Type Date Requested Status
SirVer Needs Fixing
Review via email: mp+76662@code.launchpad.net

Description of the change

This solved my codecheck problem :) For those who don't know what I mean: CodeCheck didn't report any issues on my Windows 7 64bit System with MinGW and MSYS. The problem was that a python script is not an executable file. So I changed the CodeCheck.cmake to call python and start the script instead of calling the script.
Hopefully it didn't break codecheck for anyone else, so please run a test before merging. If it does make problems I'll rework it to only use the changes on Windows.
Thanks for your efforts!

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

Very nice catch! however, to make sure that the ways do not change on other systems (where the codecheck works) I would strongly suggest only running this on windows. Can you rework it?

review: Needs Fixing
Revision history for this message
Shevonar (shevonar) wrote :

Done!

Revision history for this message
SirVer (sirver) wrote :

And merged in r5987. Thanks for your work! :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/CMakeLists.txt'
2--- src/CMakeLists.txt 2011-05-09 06:50:23 +0000
3+++ src/CMakeLists.txt 2011-09-23 08:52:25 +0000
4@@ -76,7 +76,7 @@
5 set(stamp ${sourcename}_)
6 add_custom_command(
7 OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/codecheck_${sourcenoslash}"
8- COMMAND ${CMAKE_COMMAND} -DWL_SOURCE_CHECKER=${CMAKE_SOURCE_DIR}/cmake/codecheck/CodeCheck.py -Dsourcefile=${sourcefile} -DCMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -Dstamp=codecheck_${sourcenoslash} -P ${CMAKE_SOURCE_DIR}/src/CodeCheck.cmake
9+ COMMAND ${CMAKE_COMMAND} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DWL_SOURCE_CHECKER=${CMAKE_SOURCE_DIR}/cmake/codecheck/CodeCheck.py -Dsourcefile=${sourcefile} -DCMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -Dstamp=codecheck_${sourcenoslash} -P ${CMAKE_SOURCE_DIR}/src/CodeCheck.cmake
10 DEPENDS ${sourcefile}
11 COMMENT "Checking ${sourcewithoutpath} with CodeCheck"
12 )
13
14=== modified file 'src/CodeCheck.cmake'
15--- src/CodeCheck.cmake 2010-03-30 23:40:49 +0000
16+++ src/CodeCheck.cmake 2011-09-23 08:52:25 +0000
17@@ -1,9 +1,18 @@
18-execute_process(
19- COMMAND "${WL_SOURCE_CHECKER}" -c "${sourcefile}"
20- OUTPUT_VARIABLE checkresult
21-# OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/codecheck-stamps/${stamp}
22- OUTPUT_STRIP_TRAILING_WHITESPACE
23-)
24+if (WIN32)
25+ execute_process(
26+ COMMAND "${PYTHON_EXECUTABLE}" "${WL_SOURCE_CHECKER}" -c "${sourcefile}"
27+ OUTPUT_VARIABLE checkresult
28+# OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/codecheck-stamps/${stamp}
29+ OUTPUT_STRIP_TRAILING_WHITESPACE
30+ )
31+else (WIN32)
32+ execute_process(
33+ COMMAND "${WL_SOURCE_CHECKER}" -c "${sourcefile}"
34+ OUTPUT_VARIABLE checkresult
35+# OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/codecheck-stamps/${stamp}
36+ OUTPUT_STRIP_TRAILING_WHITESPACE
37+ )
38+endif (WIN32)
39
40 if (checkresult STREQUAL "")
41 execute_process(

Subscribers

People subscribed via source and target branches

to status/vote changes: