mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-31 15:46:16 +00:00
Cmake build: Correct creation of lyx_date.h because of
not defined behaviour cmake command copy_if_different in case, the destination is not present
This commit is contained in:
parent
75483b612c
commit
46e51018d5
@ -46,9 +46,24 @@ if(LYX_GITVERSION)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
configure_file(${TOP_CMAKE_PATH}/lyx_date.h.cmake ${TOP_BINARY_DIR}/lyx_date.tmp)
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${TOP_BINARY_DIR}/lyx_date.tmp ${TOP_BINARY_DIR}/lyx_date.h
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${TOP_BINARY_DIR}/lyx_date.tmp
|
||||
)
|
||||
if(NOT EXISTS ${TOP_BINARY_DIR}/lyx_date.h)
|
||||
configure_file(${TOP_CMAKE_PATH}/lyx_date.h.cmake ${TOP_BINARY_DIR}/lyx_date.h)
|
||||
else()
|
||||
configure_file(${TOP_CMAKE_PATH}/lyx_date.h.cmake ${TOP_BINARY_DIR}/lyx_date.tmp)
|
||||
message(STATUS "Created ${TOP_BINARY_DIR}/lyx_date.tmp")
|
||||
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${TOP_BINARY_DIR}/lyx_date.tmp ${TOP_BINARY_DIR}/lyx_date.h
|
||||
ERROR_VARIABLE copy_err
|
||||
)
|
||||
|
||||
if(copy_err)
|
||||
message(FATAL_ERROR "${CMAKE_COMMAND} -E ${copy_command} not working")
|
||||
endif()
|
||||
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${TOP_BINARY_DIR}/lyx_date.tmp
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user