---------- Forwarded message ---------- From: Kevin Burge <kevin.bu...@systemware.com> Date: Thu, Oct 29, 2009 at 10:41 AM Subject: Re: [CMake] Does 2.8.0 rc4 not have the ZERO_CHECK fix? To: John Drescher <dresche...@gmail.com>
I had a possibly related problem according to Bill Hoffman (windows frequently rebuilding targets). I just switched back from 2.9 20091027 to 2.8 and it started building one of the targets unnecessarily, but, I did not clean anything, I only re-ran cmake. I just confirmed - if I "touch" my CMakeLists.txt in the root of my tree, when I next run nmake it starts rebuilding my targets with 2.8.0 rc4. Now trying 2.9 20091027 the same exact way, to see if it does the same thing. It is doing the same thing. :( I misreported that 20091027 fixed my problem. Here's what I'm doing, building in "bld" source is in "src". * I remove all files in "bld" * I run: %HOMEDRIVE%\Progra~1\cmake2~1.9\bin\cmake -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX=C:/home/kevin/work/run/all -DSWI_BUILD_XDS=ON -G "NMake Makefiles" ../src * I run nmake * I hit-ctrl C after it builds up to the 5th target or so (the first 3 are downloads, the next 2 are external builds via a custom external build script somewhat adapted from ExternalProject) * if I rerun nmake at this point, it starts building where it should (on the fifth target) * I open src\CMakeLists.txt add a byte, save, remove the byte, save. * I run nmake again, then it starts building all the targets again (after it reconfigures itself). cmake is not in my path, and I've "sanitized" my PATH variable so it basically only finds perl, ruby, VS2005, and windows system dirs (a requirement for my build). I've attached my Download script that mimics ExternalProject to some degree (I do not do the touch ".....-done"). The first three targets are defined via (basically): set (stamp_dir ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-stamp) sw_add_external_library (${PROJECT_NAME} "${SWI_URL_PREFIX}/tsmapi/${_file}" # URL of file to download ${stamp_dir} ) The second two are built by custom targets/commands also. Anyways, maybe I'm just doing something wrong with my custom targets. But, since it works fine on other platforms, it makes me think something is broken on windows. For the download code, that "reconfigure" step is even deleting my stamp_dir altogether. I have no idea why. I thought it might be because I wasn't explicitly creating it. But adding a make directory to the steps didn't help. Thanks, Kevin John Drescher wrote: On Thu, Oct 29, 2009 at 9:45 AM, Kevin Burge <kevin.bu...@systemware.com> wrote: Thanks, The fix for that is in 2.8.0 rc4. Are you still having this bug? John -- John M. Drescher
# NOTE: DOWNLOAD with LOG is broken (causes timeout reached error) # LOG log if (AIX OR Solaris) # 280rc* crashes on these platforms using internal tar set (SWI_USE_INTERNAL_TAR "false" CACHE BOOL "Use internal tar") else (AIX OR Solaris) set (SWI_USE_INTERNAL_TAR "true" CACHE BOOL "Use internal tar" FORCE) endif (AIX OR Solaris) if (NOT SWI_USE_INTERNAL_TAR) if (AIX) find_program(tar_EXECUTABLE gtar) elseif (UNIX) find_program(tar_EXECUTABLE tar) endif (AIX) if (tar_EXECUTABLE MATCHES NOTFOUND) message(FATAL_ERROR "suitable tar executable not found") endif (tar_EXECUTABLE MATCHES NOTFOUND) endif (NOT SWI_USE_INTERNAL_TAR) # # simple script to download a file from a URL and copy to the current # binary directory # function (sw_write_download_script _script _url) get_filename_component (filename "${_url}" NAME) set (dst "${SWI_DOWNLOAD_DIR}/${filename}") file(WRITE ${_script} " if (EXISTS ${dst}) message(STATUS \"warning: ${dst} already exists!\") else (EXISTS ${dst}) file ( DOWNLOAD ${_url} ${dst} STATUS status ) # TIMEOUT 30 # cmake280rc3 has a bug where it's using a double for timeout and passing to # long function. This is fixed in next release candidate. # list(GET status 0 status_code) list(GET status 1 status_string) if(NOT status_code EQUAL 0) message(FATAL_ERROR \"error: downloading '${_url}' status_code: \${status_code} status_string: \${status_string} log: \${log}\" ) endif(NOT status_code EQUAL 0) endif (EXISTS ${dst}) file(COPY ${dst} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) ") endfunction (sw_write_download_script _script _url) # # simple script to extract a file and delete it after successful # extraction # function (sw_write_extract_script _script _file _tarflags) if (SWI_USE_INTERNAL_TAR) file(WRITE ${_script} " execute_process ( COMMAND ${CMAKE_COMMAND} -E tar ${_tarflags} ${_file} RESULT_VARIABLE status OUTPUT_VARIABLE output ERROR_VARIABLE output ) if(NOT status EQUAL 0) message(FATAL_ERROR \"error: extracting '${_file}' status: \${status} output: \${output}\" ) endif(NOT status EQUAL 0) file(REMOVE ${_file}) ") else (SWI_USE_INTERNAL_TAR) file(WRITE ${_script} " execute_process ( COMMAND ${tar_EXECUTABLE} ${_tarflags} ${_file} RESULT_VARIABLE status OUTPUT_VARIABLE output ERROR_VARIABLE output ) if(NOT status EQUAL 0) message(FATAL_ERROR \"error: extracting '${_file}' status: \${status} output: \${output}\" ) endif(NOT status EQUAL 0) file(REMOVE ${_file}) ") endif (SWI_USE_INTERNAL_TAR) endfunction (sw_write_extract_script _script _file) # # define an external library to be downloaded and extracted # function (sw_add_external_library _name _url _stamp_dir) set (complete ${CMAKE_CURRENT_BINARY_DIR}/${_name}-complete) set (urlinfo ${_stamp_dir}/${_name}-urlinfo.txt) set (download ${_stamp_dir}/${_name}-download) set (extract ${_stamp_dir}/${_name}-extract) set (args ${ARGN}) get_filename_component(filename "${_url}" NAME) if (args) set (post_script ${args}) set (post ${_stamp_dir}/${_name}-post) set (final ${post}) else () set (final ${extract}) endif () add_custom_target (${_name} ALL DEPENDS ${complete}) add_custom_command ( OUTPUT ${complete} COMMENT "" COMMAND ${CMAKE_COMMAND} -E touch ${complete} DEPENDS ${final} VERBATIM ) # complete target add_custom_command (APPEND OUTPUT ${complete} DEPENDS ${download} ) # download target set(repository "external project URL") set(module "${_url}") set(tag "") configure_file( "${CMAKE_ROOT}/Modules/RepositoryInfo.txt.in" "${urlinfo}" @ONLY ) # create the download script sw_write_download_script (${_stamp_dir}/download-${_name}.cmake "${_url}") add_custom_command ( OUTPUT ${download} COMMENT "Downloading '${_url}'" COMMAND ${CMAKE_COMMAND} -P ${_stamp_dir}/download-${_name}.cmake COMMAND ${CMAKE_COMMAND} -E touch ${download} DEPENDS ${urlinfo} ) # extract target sw_write_extract_script (${_stamp_dir}/extract-${_name}.cmake ${filename} xzf) add_custom_command ( OUTPUT ${extract} COMMENT "Extracting '${filename}'" COMMAND ${CMAKE_COMMAND} -P ${_stamp_dir}/extract-${_name}.cmake COMMAND ${CMAKE_COMMAND} -E touch ${extract} DEPENDS ${download} ) if (args) add_custom_command ( OUTPUT ${post} COMMENT "Post-extracting '${filename}'" COMMAND ${CMAKE_COMMAND} -P ${post_script} COMMAND ${CMAKE_COMMAND} -E touch ${post} DEPENDS ${extract} ) endif (args) endfunction (sw_add_external_library _name _url _stamp_dir)
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake