[CMake] Visual Studio "clean" won't delete things

Tyler Roscoe tyler at cryptio.net
Wed Apr 22 14:19:51 EDT 2009


Each of my CMake projects deposits its results in a results directory. I
set this up like this:



# Set up results dir.
add_custom_command(
    COMMENT "Creating results dir ${${PROJECT_NAME}_RESULTS}"
    OUTPUT ${${PROJECT_NAME}_RESULTS}
    COMMAND ${CMAKE_COMMAND} -E make_directory ${${PROJECT_NAME}_RESULTS}
)
add_custom_target(
    ${PROJECT_NAME}_results
    DEPENDS ${${PROJECT_NAME}_RESULTS}
)


The directory is created correctly on both Windows (Vista 64, Visual
Studio 2005) and Linux (gmake).

On Linux, when I do "make clean", it correctly deletes the results
directory and all of its contents.

On Windows, I get this error:



1>------ Clean started: Project: SV.h, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'SV.h', configuration 'Debug|Win32'
1>SV.h : error PRJ0008 : Could not delete file 'c:\demo2\sdk\trunk\internalheaders\sv\_results'.
1>Make sure that the file is not open by another process and is not write-protected.
1>SV.h - 1 error(s), 0 warning(s)


The directory is not write-protected (permissions look normal and I can
delete it just fine by hand) and AFAICT it is not in use by another
process (unless Visual Studio is somehow holding onto it, but that seems
inane even for Visual Studio). 

Am I doing something wrong? What other things can I look at to determine
the source of this problem?

Thanks,
tyler


More information about the CMake mailing list