Skip to content

Commit

Permalink
cmake: Introduce regen variable that will control camkes-gen.cmake …
Browse files Browse the repository at this point in the history
…regeneration

This is currently a semantic preserving change that introduces a redundant variable
called `regen`. The purpose of this change is purely to perform the code indentation
prior to introducing the code that will control whether the regeneration happens or not.
  • Loading branch information
Adrian Danis authored and Adrian Danis committed Mar 23, 2018
1 parent bd2f375 commit e2e2290
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions camkes.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -548,21 +548,25 @@ function(GenerateCAmkESRootserver)
--makefile-dependencies "${deps_file}"
${CAMKES_FLAGS}
)
execute_process(
# First delete the data structure cache directory as this is a new build
COMMAND
${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_BINARY_DIRECTOR}/camkes_pickle"
COMMAND ${camkes_invocation}
RESULT_VARIABLE camkes_gen_error
OUTPUT_VARIABLE camkes_output
ERROR_VARIABLE camkes_output
)
if (camkes_gen_error)
message(FATAL_ERROR "Failed to generate camkes-gen.cmake: ${camkes_output}")
# We need to determine if we actually need to regenerate. We start by assuming that we do
set(regen TRUE)
if (regen)
execute_process(
# First delete the data structure cache directory as this is a new build
COMMAND
${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_BINARY_DIRECTOR}/camkes_pickle"
COMMAND ${camkes_invocation}
RESULT_VARIABLE camkes_gen_error
OUTPUT_VARIABLE camkes_output
ERROR_VARIABLE camkes_output
)
if (camkes_gen_error)
message(FATAL_ERROR "Failed to generate camkes-gen.cmake: ${camkes_output}")
endif()
# Add dependencies
MakefileDepsToList("${deps_file}" deps)
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${deps}")
endif()
# Add dependencies
MakefileDepsToList("${deps_file}" deps)
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${deps}")
# We set a property to indicate that we have done execute_process (which happens during the
# generation phase. This just allows us to do some debugging and detect cases where options
# are changed *after* this point that would have affected the execute_process
Expand Down

0 comments on commit e2e2290

Please sign in to comment.