Skip to content

Commit 33c1b71

Browse files
author
Daniele Giunchi
committed
move configuration macro inside qa in order to
have an independent project
1 parent 264a4c4 commit 33c1b71

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

CMake/mafUtilities.cmake

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -33,35 +33,3 @@ MACRO (mafDependentOption option doc default depends force)
3333
SET(${option} ${force})
3434
ENDIF(${option}_AVAILABLE)
3535
ENDMACRO()
36-
37-
macro(configure_files srcDir destDir)
38-
message(STATUS "Configuring directory ${destDir}")
39-
make_directory(${destDir})
40-
41-
file(GLOB templateFiles RELATIVE ${srcDir} ${srcDir}/*)
42-
foreach(templateFile ${templateFiles})
43-
set(srcTemplatePath ${srcDir}/${templateFile})
44-
if(NOT IS_DIRECTORY ${srcTemplatePath})
45-
message(STATUS "Configuring file ${templateFile}")
46-
set(originalName ${templateFile})
47-
STRING(REGEX REPLACE ".in$" "" templateFile ${originalName})
48-
set(result 0)
49-
STRING(COMPARE EQUAL ${templateFile} ${originalName} result)
50-
if(NOT result)
51-
configure_file(
52-
${srcTemplatePath}
53-
${destDir}/${templateFile}
54-
@ONLY)
55-
else(NOT result)
56-
configure_file(
57-
${srcTemplatePath}
58-
${destDir}/${templateFile}
59-
COPYONLY)
60-
endif(NOT result)
61-
else(NOT IS_DIRECTORY ${srcTemplatePath})
62-
set(nextDir ${destDir}/${templateFile})
63-
make_directory(${nextDir})
64-
configure_files(${srcTemplatePath} ${nextDir})
65-
endif(NOT IS_DIRECTORY ${srcTemplatePath})
66-
endforeach(templateFile)
67-
endmacro(configure_files)

src/mafQA/qa/CMakeLists.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,34 @@
1+
macro(configure_files srcDir destDir)
2+
message(STATUS "Configuring directory ${destDir}")
3+
make_directory(${destDir})
4+
5+
file(GLOB templateFiles RELATIVE ${srcDir} ${srcDir}/*)
6+
foreach(templateFile ${templateFiles})
7+
set(srcTemplatePath ${srcDir}/${templateFile})
8+
if(NOT IS_DIRECTORY ${srcTemplatePath})
9+
message(STATUS "Configuring file ${templateFile}")
10+
set(originalName ${templateFile})
11+
STRING(REGEX REPLACE ".in$" "" templateFile ${originalName})
12+
set(result 0)
13+
STRING(COMPARE EQUAL ${templateFile} ${originalName} result)
14+
if(NOT result)
15+
configure_file(
16+
${srcTemplatePath}
17+
${destDir}/${templateFile}
18+
@ONLY)
19+
else(NOT result)
20+
configure_file(
21+
${srcTemplatePath}
22+
${destDir}/${templateFile}
23+
COPYONLY)
24+
endif(NOT result)
25+
else(NOT IS_DIRECTORY ${srcTemplatePath})
26+
set(nextDir ${destDir}/${templateFile})
27+
make_directory(${nextDir})
28+
configure_files(${srcTemplatePath} ${nextDir})
29+
endif(NOT IS_DIRECTORY ${srcTemplatePath})
30+
endforeach(templateFile)
31+
endmacro(configure_files)
32+
133
get_filename_component(CUR_ABSOLUTE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
234
configure_files("${CUR_ABSOLUTE_DIR}" "${MAF_BINARY_DIR}/qa")

0 commit comments

Comments
 (0)