@@ -17,10 +17,9 @@ if(GIT_DIR)
1717
1818 # Generate commit ID header file in source dir if we are in a git repository
1919 add_custom_command (
20- OUTPUT include /ocre/commit_id.h
21- COMMAND sh -c "mkdir -p ${CMAKE_CURRENT_BINARY_DIR} /include/ocre"
22- COMMAND sh -c "echo '/* Auto-generated file. DO NOT EDIT */' > ${CMAKE_CURRENT_BINARY_DIR} /include/ocre/commit_id.h"
23- COMMAND sh -c "echo \" #define GIT_COMMIT_ID \\\" $(git describe --always --abbrev=0 --dirty)\\\"\" >> ${CMAKE_CURRENT_BINARY_DIR} /include/ocre/commit_id.h"
20+ OUTPUT include /commit_id.h
21+ COMMAND sh -c "echo '/* Auto-generated file. DO NOT EDIT */' > ${CMAKE_CURRENT_BINARY_DIR} /include/commit_id.h"
22+ COMMAND sh -c "echo \" #define GIT_COMMIT_ID \\\" $(git describe --always --abbrev=0 --dirty)\\\"\" >> ${CMAKE_CURRENT_BINARY_DIR} /include/commit_id.h"
2423 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
2524 VERBATIM
2625 DEPENDS always_rebuild
@@ -31,9 +30,9 @@ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ocre)
3130
3231# Generate build info header file in binary dir for every build
3332add_custom_command (
34- OUTPUT include /ocre/ build_info.h
35- COMMAND sh -c "echo \" #define OCRE_BUILD_HOST_INFO \\\" $ENV{USER} @ $(uname -a)\\\"\" > include/ocre/ build_info.h"
36- COMMAND sh -c "echo \" #define OCRE_BUILD_DATE \\\" $(date +'%Y-%m-%d %H:%M:%S %Z')\\\"\" >> include/ocre/ build_info.h"
33+ OUTPUT include /build_info.h
34+ COMMAND sh -c "echo \" #define OCRE_BUILD_HOST_INFO \\\" $ENV{USER} @ $(uname -a)\\\"\" > include/build_info.h"
35+ COMMAND sh -c "echo \" #define OCRE_BUILD_DATE \\\" $(date +'%Y-%m-%d %H:%M:%S %Z')\\\"\" >> include/build_info.h"
3736 VERBATIM
3837 DEPENDS always_rebuild
3938)
@@ -50,12 +49,13 @@ add_library(OcreCommon)
5049target_sources (OcreCommon
5150 PRIVATE
5251 common.c
53- include /ocre/ build_info.h
54- include /ocre/ commit_id.h
52+ include /build_info.h
53+ include /commit_id.h
5554)
5655
5756target_include_directories (OcreCommon
57+ PRIVATE
58+ ${CMAKE_CURRENT_BINARY_DIR} /include
5859 PUBLIC
5960 include
60- ${CMAKE_CURRENT_BINARY_DIR} /include
6161)
0 commit comments