Skip to content

Commit

Permalink
Make MAF files dependencies of CMakeLists (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethouris authored and rndi committed Jun 22, 2018
1 parent a306d36 commit 96c97d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 3 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,9 @@ endmacro()
if ( ENABLE_CXX11 )

# Make a virtual library of all shared app files
MafRead(apps/support.maf
SOURCES SOURCES_support_indir
MafReadDir(apps support.maf
SOURCES SOURCES_support
)
adddirname(apps "${SOURCES_support_indir}" SOURCES_support)

# A special trick that makes the shared application sources
# to be compiled once for all applications. Maybe this virtual
Expand Down Expand Up @@ -733,8 +732,7 @@ if ( ENABLE_CXX11 )
#
# For testing applications, every application has its exclusive
# list of source files in its own Manifest file.
MafRead(testing/${name}.maf SOURCES SOURCES_app_indir)
adddirname(testing "${SOURCES_app_indir}" SOURCES_app)
MafReadDir(testing ${name}.maf SOURCES SOURCES_app)
srt_add_program(${name} ${SOURCES_app})
endmacro()

Expand Down
8 changes: 8 additions & 0 deletions scripts/haiUtil.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ macro(srt_install_symlink filepath sympath)
install(CODE "message(\"-- Created symlink: ${sympath} -> ${filepath}\")")
endmacro(srt_install_symlink)

# LEGACY. PLEASE DON'T USE ANYMORE.
MACRO(MafRead maffile)
message(WARNING "MafRead is deprecated. Please use MafReadDir instead")
# ARGN contains the extra "section-variable" pairs
# If empty, return nothing
set (MAFREAD_TAGS
Expand Down Expand Up @@ -149,6 +151,12 @@ MACRO(MafReadDir directory maffile)
STRING(REGEX REPLACE ";" "\\\\;" MAFREAD_CONTENTS "${MAFREAD_CONTENTS}")
STRING(REGEX REPLACE "\n" ";" MAFREAD_CONTENTS "${MAFREAD_CONTENTS}")

# Once correctly read, declare this file as dependency of the build file.
# Normally you should use cmake_configure_depends(), but this is
# available only since 3.0 version.
configure_file(${directory}/${maffile} dummy_${maffile}.cmake.out)
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/dummy_${maffile}.cmake.out)

#message("DEBUG: MAF FILE CONTENTS: ${MAFREAD_CONTENTS}")
#message("DEBUG: PASSED VARIABLES:")
#foreach(DEBUG_VAR ${MAFREAD_TAGS})
Expand Down

0 comments on commit 96c97d6

Please sign in to comment.