Commit 7aba87b7 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Workaround a cmake bug that was only visible on a newly installed Philip's machine.

CMake 2.8.4 crashed on this line
 IF(something AND IS_DIRECTORY(something_else))
when both  "something" and "something_else" were empty.

Changing the line slightly (using cascading "IF" instead)  solved the crash.
parent 73f78f77
...@@ -304,20 +304,24 @@ ENDFUNCTION() ...@@ -304,20 +304,24 @@ ENDFUNCTION()
FUNCTION(TRAVERSE_DIRECTORIES dir topdir file prefix) FUNCTION(TRAVERSE_DIRECTORIES dir topdir file prefix)
FILE(RELATIVE_PATH rel ${topdir} ${dir}) FILE(RELATIVE_PATH rel ${topdir} ${dir})
IF(rel AND IS_DIRECTORY "${f}") IF(rel)
IF (IS_DIRECTORY "${f}")
MAKE_WIX_IDENTIFIER("${rel}" id) MAKE_WIX_IDENTIFIER("${rel}" id)
GET_FILENAME_COMPONENT(name ${dir} NAME) GET_FILENAME_COMPONENT(name ${dir} NAME)
FILE(APPEND ${file} "${prefix}<Directory Id='D.${id}' Name='${name}'>\n") FILE(APPEND ${file} "${prefix}<Directory Id='D.${id}' Name='${name}'>\n")
ENDIF() ENDIF()
ENDIF()
FILE(GLOB all_files ${dir}/*) FILE(GLOB all_files ${dir}/*)
FOREACH(f ${all_files}) FOREACH(f ${all_files})
IF(IS_DIRECTORY ${f}) IF(IS_DIRECTORY ${f})
TRAVERSE_DIRECTORIES(${f} ${topdir} ${file} "${prefix} ") TRAVERSE_DIRECTORIES(${f} ${topdir} ${file} "${prefix} ")
ENDIF() ENDIF()
ENDFOREACH() ENDFOREACH()
IF(rel AND IS_DIRECTORY "${f}") IF(rel)
IF(IS_DIRECTORY "${f}")
FILE(APPEND ${file} "${prefix}</Directory>\n") FILE(APPEND ${file} "${prefix}</Directory>\n")
ENDIF() ENDIF()
ENDIF()
ENDFUNCTION() ENDFUNCTION()
SET(CPACK_WIX_COMPONENTS) SET(CPACK_WIX_COMPONENTS)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment