dev-cafe / autocmake

CMake plugin composer.
http://autocmake.org
BSD 3-Clause "New" or "Revised" License
42 stars 18 forks source link

Fix CMAKE_CURRENT_LIST_DIR variable setting for CMake 2.8.2. (and lower) in the entire autocmake #158

Closed miroi closed 8 years ago

miroi commented 8 years ago

Hi,

this error below happens only on distante Jenkins buildup server, and I can not decode it properly.

Maybe one should provide https://github.com/scisoft/autocmake/blob/master/modules/git_info/git_info_sub.cmake with some if-checkings to be sure that hurting git command is not performed....

Any help ?

Scanning dependencies of target git_info
[  2%] Generating git_info.h
CMake Error: Error processing file:git_info_sub.cmake
make[2]: *** [git_info.h] Error 1
make[1]: *** [CMakeFiles/git_info.dir/all] Error 2
make: *** [all] Error 2
Build step 'Execute shell' marked build as failure
Finished: FAILURE
bast commented 8 years ago

I cannot see either what the problem here is.

miroi commented 8 years ago

Hmmm...

the Jenkins is senstive to the error exit from the execute_process(...).

Somehow we should tell CMake's execute_process(es) so that they do not flush out any stderr, rather some informative message.

Will check on CMake manual what options do we have. At least I would check if ${GIT_EXECUTABLE} is defined to be able to perform command.

miroi commented 8 years ago

Aaaah, this change, https://github.com/scisoft/autocmake/blob/master/modules/git_info/git_info.cmake#L16 , has not come into DIRAC, as I see https://gitlab.com/dirac/dirac/blob/master/cmake/downloaded/autocmake_git_info.cmake .

Closing this issue and waiting to transfer this workaround into DIRAC.

miroi commented 8 years ago

Hi Rado,

there is another occurence of undefined variable for CMake 2.8.2, see https://github.com/scisoft/autocmake/blob/master/modules/git_info/git_info_sub.cmake#L49

Would you agree with the patch again ? Or should I ask admin to upgrade devel,umb.sk system for Jenkins ?

The path would be

get_filename_component(CMAKE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)

without prior checking of CMAKE_CURRENT_LIST_DIR because it may be set "ad-hoc" in other parts of code through the same workaround.

bast commented 8 years ago

Yeah it's fine.

miroi commented 8 years ago

Good, Rado. I hope I will completely "cure" the CMAKE_CURRENT_LIST_DIR variable in the entire automake for CMake 2.8.2.