Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cmake] Make CMake aware of textfiles that configure the build #9876

Merged
merged 1 commit into from Jun 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions project/cmake/scripts/common/AddonHelpers.cmake
Expand Up @@ -67,6 +67,7 @@ macro (build_addon target prefix libs)

# if there's an addon.xml.in we need to generate the addon.xml
if(EXISTS ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in)
set(PLATFORM ${CORE_SYSTEM_NAME})

file(READ ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in addon_file)
Expand Down
8 changes: 7 additions & 1 deletion project/cmake/scripts/common/HandleDepends.cmake
Expand Up @@ -10,6 +10,7 @@ function(add_addon_depends addon searchpath)
list(APPEND cmake_input_files ${cmake_input_files2})

foreach(file ${cmake_input_files})
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${file})
if(NOT (file MATCHES CMakeLists.txt OR
file MATCHES install.txt OR
file MATCHES noinstall.txt OR
Expand Down Expand Up @@ -45,6 +46,7 @@ function(add_addon_depends addon searchpath)

# check if there are any library specific flags that need to be passed on
if(EXISTS ${dir}/flags.txt)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/flags.txt)
file(STRINGS ${dir}/flags.txt extraflags)
separate_arguments(extraflags)
message(STATUS "${id} extraflags: ${extraflags}")
Expand Down Expand Up @@ -77,9 +79,10 @@ function(add_addon_depends addon searchpath)
# if there's a CMakeLists.txt use it to prepare the build
set(PATCH_FILE ${BUILD_DIR}/${id}/tmp/patch.cmake)
if(EXISTS ${dir}/CMakeLists.txt)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/CMakeLists.txt)
file(APPEND ${PATCH_FILE}
"file(COPY ${dir}/CMakeLists.txt
DESTINATION ${BUILD_DIR}/${id}/src/${id})\n")
DESTINATION ${BUILD_DIR}/${id}/src/${id})\n")
endif()

# check if we have patches to apply
Expand All @@ -104,6 +107,7 @@ function(add_addon_depends addon searchpath)
endif()
endif()

set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${patch})
file(APPEND ${PATCH_FILE}
"execute_process(COMMAND ${PATCH_PROGRAM} -p1 -i \"${patch}\")\n")
endforeach()
Expand All @@ -125,6 +129,7 @@ function(add_addon_depends addon searchpath)

# check if there's a deps.txt containing dependencies on other libraries
if(EXISTS ${dir}/deps.txt)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/deps.txt)
file(STRINGS ${dir}/deps.txt deps)
message(STATUS "${id} depends: ${deps}")
else()
Expand All @@ -133,6 +138,7 @@ function(add_addon_depends addon searchpath)

if(CROSS_AUTOCONF AND AUTOCONF_FILES)
foreach(afile ${AUTOCONF_FILES})
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${afile})
file(APPEND ${PATCH_FILE}
"message(STATUS \"AUTOCONF: copying ${afile} to ${BUILD_DIR}/${id}/src/${id}\")\n
file(COPY ${afile} DESTINATION ${BUILD_DIR}/${id}/src/${id})\n")
Expand Down
2 changes: 2 additions & 0 deletions project/cmake/scripts/common/Macros.cmake
Expand Up @@ -235,6 +235,7 @@ function(core_file_read_filtered result filepattern)
if(VERBOSE)
message(STATUS "core_file_read_filtered - filename: ${filename}")
endif()
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${filename})
file(STRINGS ${filename} fstrings REGEX "^[^#//]")
foreach(fstring ${fstrings})
string(REGEX REPLACE "^(.*)#(.*)" "\\1" fstring ${fstring})
Expand Down Expand Up @@ -293,6 +294,7 @@ macro(core_add_optional_subdirs_from_filelist pattern)
if(VERBOSE)
message(STATUS "core_add_optional_subdirs_from_filelist - reading file: ${filename}")
endif()
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${filename})
file(STRINGS ${filename} fstrings REGEX "^[^#//]")
foreach(line ${fstrings})
string(REPLACE " " ";" line "${line}")
Expand Down