← Back to team overview

widelands-dev team mailing list archive

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

 

Shevonar has proposed merging lp:~shevonar/widelands/fix-cmake-codecheck into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~shevonar/widelands/fix-cmake-codecheck/+merge/76662

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!
-- 
https://code.launchpad.net/~shevonar/widelands/fix-cmake-codecheck/+merge/76662
Your team Widelands Developers is requested to review the proposed merge of lp:~shevonar/widelands/fix-cmake-codecheck into lp:widelands.
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt	2011-05-09 06:50:23 +0000
+++ src/CMakeLists.txt	2011-09-22 23:39:26 +0000
@@ -76,7 +76,7 @@
     set(stamp ${sourcename}_)
     add_custom_command(
       OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/codecheck_${sourcenoslash}"
-      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
+      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
       DEPENDS ${sourcefile}
       COMMENT "Checking ${sourcewithoutpath} with CodeCheck"
     )

=== modified file 'src/CodeCheck.cmake'
--- src/CodeCheck.cmake	2010-03-30 23:40:49 +0000
+++ src/CodeCheck.cmake	2011-09-22 23:39:26 +0000
@@ -1,5 +1,5 @@
 execute_process(
-  COMMAND "${WL_SOURCE_CHECKER}" -c "${sourcefile}"
+  COMMAND "${PYTHON_EXECUTABLE}" "${WL_SOURCE_CHECKER}" -c "${sourcefile}"
   OUTPUT_VARIABLE checkresult
 #  OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/codecheck-stamps/${stamp}
   OUTPUT_STRIP_TRAILING_WHITESPACE