[CMake] Dependency weirdness
Phil Smith
phil at voltage.com
Sat Aug 23 13:17:31 EDT 2014
A while ago, folks on this list kindly helped me through adding dependency checking for assembler macros with the cross-compiler we use (summary: if module foo.asm uses macro bar.mac, we wanted foo.asm picked up by CMake if bar.mac changed).
I recently realized this was no longer working. I had the old version's source path, and verified that it still worked there, and then that the CMakeLists had not changed in any substantive way.
Some more tinkering led me to try a "This can't possible matter/work" scenario:
The old, working path was named C:\SVN\zFPE4.3.0
The new, broken path was named C:\SVN\zFPE510
I did various renames (4.3.0==>430 and 510==>5.1.0), clean builds,.mac changes, and CMAKEs. The results:
- If the periods are in the filename, the dependency checking works
- If no period, it doesn't work
But the dependency code in CMakeLists is:
foreach(entry ${ZPROTECT_ASM_DEPENDENCIES})
# Convert each entry into a new list
string(REPLACE "," ";" entry ${entry})
# Get the source filename from the list
list(GET entry 0 file)
# And remove it so we can now traverse the list
list(REMOVE_AT entry 0)
# Now traverse the list and set each dependency
foreach(temp ${entry})
# Note hard-coded path; MUST be full path, cannot be relative (CMake restriction)
set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/zprotect/asm/${file} APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/zprotect/asm/${temp})
endforeach(temp ${entry})
endforeach(entry ${ZPROTECT_ASM_DEPENDENCIES}
I see no periods here...I see commas, but no periods. And I'd've expected it to be more likely that the presence of periods would upset it than their absence!
I added a diagnostic MESSAGE in the code and reran it.
Good:
-- set_property(SOURCE C:/SVN/zFPE5.1.0/src/zprotect/asm/VSHVOLT.asm APPEND PROPERTY OBJECT_DEPENDS C:/SVN/zFPE5.1.0/src/zprotect/asm/VSHVOLTX.mac)
Bad:
-- set_property(SOURCE C:/SVN/zFPE510/src/zprotect/asm/VSHVOLT.asm APPEND PROPERTY OBJECT_DEPENDS C:/SVN/zFPE510/src/zprotect/asm/VSHVOLTX.mac)
Those are identical other than the periods in the directory name, as expected! Any ideas?
cmake --version says:
cmake version 2.8.1
I know this is old but there are reasons. In any case, seems like an odd bug. Is the period perhaps some regex confusion kicking in?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140823/7b23c47d/attachment.html>
More information about the CMake
mailing list