@@ -658,19 +658,18 @@ glue_source_definitions(Nabla _NBL_SOURCE_DEFINITIONS_)
658
658
set (_NBL_DEFINE_FILE_WRAPPER_ ${CMAKE_CURRENT_BINARY_DIR} /include/define.h )
659
659
write_source_definitions ("${_NBL_DEFINE_FILE_WRAPPER_} " "${_NBL_SOURCE_DEFINITIONS_} " )
660
660
661
- add_custom_target (CheckGit COMMAND ${CMAKE_COMMAND}
662
- -DWORKING_DIRECTORY:PATH=${NBL_ROOT_PATH}
663
- -DGIT_EXECUTABLE:PATH=${GIT_EXECUTABLE}
664
- -DINPUT_FILE:PATH= "${NBL_ROOT_PATH} /src/nbl/git_info.cpp.in"
665
- -DOUTPUT_FILE:PATH= "${CMAKE_CURRENT_BINARY_DIR} /src/nbl/git_info.cpp"
666
- -P ${NBL_ROOT_PATH} /cmake/scripts/nbl/gitInfo.cmake
667
- BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR} /src/nbl/git_info.cpp
661
+ # generate git info
662
+ execute_process ( COMMAND ${GIT_EXECUTABLE} log -1 --format=%H
663
+ WORKING_DIRECTORY ${NBL_ROOT_PATH}
664
+ OUTPUT_VARIABLE NBL_GIT_COMMIT_HASH
665
+ OUTPUT_STRIP_TRAILING_WHITESPACE
668
666
)
669
-
670
- set (INPUT_FILE "${NBL_ROOT_PATH} /src/nbl/git_info.cpp.in" )
671
- set (OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR} /src/nbl/git_info.cpp" )
672
- set (WORKING_DIRECTORY ${NBL_ROOT_PATH} )
673
- include ("${NBL_ROOT_PATH} /cmake/scripts/nbl/gitInfo.cmake" )
667
+ execute_process ( COMMAND ${GIT_EXECUTABLE} log -1 --format=%h
668
+ WORKING_DIRECTORY ${NBL_ROOT_PATH}
669
+ OUTPUT_VARIABLE NBL_GIT_COMMIT_SHORT_HASH
670
+ OUTPUT_STRIP_TRAILING_WHITESPACE
671
+ )
672
+ configure_file ("${NBL_ROOT_PATH} /src/nbl/git_info.cpp.in" "${CMAKE_CURRENT_BINARY_DIR} /src/nbl/git_info.cpp" )
674
673
675
674
#on MSVC it won't compile without this option!
676
675
if (MSVC )
0 commit comments