Revision: 69946 http://sourceforge.net/p/brlcad/code/69946 Author: starseeker Date: 2017-07-15 21:18:40 +0000 (Sat, 15 Jul 2017) Log Message: ----------- Looks like distclean can be a function
Modified Paths: -------------- brlcad/trunk/CMakeLists.txt brlcad/trunk/db/nist/CMakeLists.txt brlcad/trunk/misc/CMake/BRLCAD_Util.cmake Modified: brlcad/trunk/CMakeLists.txt =================================================================== --- brlcad/trunk/CMakeLists.txt 2017-07-15 20:40:37 UTC (rev 69945) +++ brlcad/trunk/CMakeLists.txt 2017-07-15 21:18:40 UTC (rev 69946) @@ -84,11 +84,11 @@ # in-source-dir configuration. Not recommended, but we'll try to # recover if it happens. define_property(GLOBAL PROPERTY CMAKE_DISTCLEAN_TARGET_LIST BRIEF_DOCS "All CMake generated files" FULL_DOCS "List of all files generated by CMake") -macro(DISTCLEAN) +function(distclean) foreach(item ${ARGN}) set_property(GLOBAL APPEND PROPERTY CMAKE_DISTCLEAN_TARGET_LIST "${item}") endforeach(item ${ARGN}) -endmacro(DISTCLEAN) +endfunction(distclean) # Used a variation on Fraser's approach for capturing command line args from # http://stackoverflow.com/questions/10205986/how-to-capture-cmake-command-line-arguments Modified: brlcad/trunk/db/nist/CMakeLists.txt =================================================================== --- brlcad/trunk/db/nist/CMakeLists.txt 2017-07-15 20:40:37 UTC (rev 69945) +++ brlcad/trunk/db/nist/CMakeLists.txt 2017-07-15 21:18:40 UTC (rev 69946) @@ -65,7 +65,6 @@ # We know enough - write the script generate_cmd_script(3dm-g "${script_file}" OLOG "${log_file}" ELOG "${log_file}" CARGS "${CMD_ARGS}") - DISTCLEAN(${script_file}) # Define the target add_custom_command( @@ -85,7 +84,6 @@ # Cleanup set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BUILD_DIR_SCRIPT}/${output_file};${log_file}") - DISTCLEAN(${log_file}) endfunction(ADD_NIST_3DM_TARGET rhino_model folder) Modified: brlcad/trunk/misc/CMake/BRLCAD_Util.cmake =================================================================== --- brlcad/trunk/misc/CMake/BRLCAD_Util.cmake 2017-07-15 20:40:37 UTC (rev 69945) +++ brlcad/trunk/misc/CMake/BRLCAD_Util.cmake 2017-07-15 21:18:40 UTC (rev 69946) @@ -296,6 +296,13 @@ file(APPEND "${script_file}" " message(FATAL_ERROR \"\${CBDIR}/${BIN_DIR}/${cmd_exe}${EXE_EXT} failure: \${CR}\\n\${CO}\\n\${CE}\")\n") file(APPEND "${script_file}" "endif(CR)\n") + # If we are doing distclean, let CMake know to remove the script and log files + if(COMMAND distclean) + set(distclean_files "${script_file}" "${GCS_OLOG}" "${GCS_ELOG}") + list(REMOVE_DUPLICATES distclean_files) + distclean(${distclean_files}) + endif(COMMAND distclean) + endfunction(generate_cmd_script) # Local Variables: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits