[brlcad-commits] SF.net SVN: brlcad:[49450] brlcad/trunk
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <sta...@us...> - 2012-02-16 16:06:43
|
Revision: 49450 http://brlcad.svn.sourceforge.net/brlcad/?rev=49450&view=rev Author: starseeker Date: 2012-02-16 16:06:31 +0000 (Thu, 16 Feb 2012) Log Message: ----------- Clean-up and polish - distcheck target can now be pointed to distcheck-full or distcheck-std per user arg, don't re-create targets if CREATE_DISTCHECK is called multiple times with the same name, ws, other minor tweaks. Modified Paths: -------------- brlcad/trunk/CMakeLists.txt brlcad/trunk/misc/CMake/Distcheck.cmake Modified: brlcad/trunk/CMakeLists.txt =================================================================== --- brlcad/trunk/CMakeLists.txt 2012-02-16 15:59:55 UTC (rev 49449) +++ brlcad/trunk/CMakeLists.txt 2012-02-16 16:06:31 UTC (rev 49450) @@ -2053,10 +2053,13 @@ DISTCLEAN(${CMAKE_BINARY_DIR}/Makefile) DISTCLEAN(${CMAKE_BINARY_DIR}/include/brlcad_config.h.in) -# Define a distcheck target. This performs a variety of tests to determine -# whether BRL-CAD is in a distribution ready state. +# Define a distcheck target. This performs a variety of tests to determine +# whether BRL-CAD is in a distribution ready state. Default to the standard +# set of tests - Debug and Release build configurations include(${BRLCAD_CMAKE_DIR}/Distcheck.cmake) -DEFINE_DISTCHECK_TARGET() +# Define some custom distcheck targets for distcheck-full (not run by default) +CREATE_DISTCHECK(no_tk "-DCMAKE_BUILD_TYPE=Debug -DBRLCAD_ENABLE_TK=OFF") +DEFINE_DISTCHECK_TARGET(STD) # Mark various miscellaneous things as advanced that we don't want in our # default view Modified: brlcad/trunk/misc/CMake/Distcheck.cmake =================================================================== --- brlcad/trunk/misc/CMake/Distcheck.cmake 2012-02-16 15:59:55 UTC (rev 49449) +++ brlcad/trunk/misc/CMake/Distcheck.cmake 2012-02-16 16:06:31 UTC (rev 49450) @@ -1,65 +1,99 @@ -# Each config (Debug, Release, Tk disable, etc. etc.) is set up as an -# individual distcheck target (distcheck-debug, distcheck-release, etc.) and then toplevel distcheck -# and distcheck-full targets +# Distribution checking is the process of verifying that a source repository +# is in a valid, working state. This file defines the top level macros that +# set up and control the process. The distcheck targets need +# to have values substituted prior to inclusion in order to produce a command +# that will execute in parallel when using Make, so the distcheck target template +# is set up as a cmake.in file - configure_file and include are used to generate +# and source the final target definition for each case. -if("${CMAKE_VERBOSE_DISTCHECK}" STREQUAL "") - set(CMAKE_VERBOSE_DISTCHECK OFF) -endif("${CMAKE_VERBOSE_DISTCHECK}" STREQUAL "") +if(NOT IS_SUBBUILD) + if("${CMAKE_VERBOSE_DISTCHECK}" STREQUAL "") + set(CMAKE_VERBOSE_DISTCHECK OFF) + endif("${CMAKE_VERBOSE_DISTCHECK}" STREQUAL "") -macro(CREATE_DISTCHECK TARGET_SUFFIX CMAKE_OPTS) - # Need to set these locally so configure_file will pick them up... - SET(TARGET_SUFFIX ${TARGET_SUFFIX}) - SET(CMAKE_OPTS ${CMAKE_OPTS}) + find_program(CPACK_EXEC cpack) + mark_as_advanced(CPACK_EXEC) - # Determine how to trigger the build in the distcheck target - if("${CMAKE_GENERATOR}" MATCHES "Make" AND ("${cmake_generator}" MATCHES "Make" OR NOT cmake_generator)) - if(NOT CMAKE_VERBOSE_DISTCHECK) - set(TARGET_REDIRECT " >> distcheck_${TARGET_SUFFIX}.log ") - endif(NOT CMAKE_VERBOSE_DISTCHECK) - set(DISTCHECK_BUILD_CMD "${CMAKE_COMMAND} -E chdir distcheck-${TARGET_SUFFIX}/build $(MAKE) ${TARGET_REDIRECT}") - else("${CMAKE_GENERATOR}" MATCHES "Make" AND ("${cmake_generator}" MATCHES "Make" OR NOT cmake_generator)) - set(DISTCHECK_BUILD_CMD "COMMAND ${CMAKE_COMMAND} -E build distcheck-${TARGET_SUFFIX}/build") - set(TARGET_REDIRECT "") - endif("${CMAKE_GENERATOR}" MATCHES "Make" AND ("${cmake_generator}" MATCHES "Make" OR NOT cmake_generator)) + # We'll always want the repo and source distcheck targets defined - they are contants + # for distcheck regardless of the bulid configurations used. - # Based on the build command, generate a distcheck target definition from the template - configure_file(${BRLCAD_CMAKE_DIR}/distcheck_target.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/distcheck_target_${TARGET_SUFFIX}.cmake @ONLY) - include(${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/distcheck_target_${TARGET_SUFFIX}.cmake) + # Set up the script that will be used to verify the source archives + configure_file(${BRLCAD_CMAKE_DIR}/distcheck_repo_verify.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/distcheck_repo_verify.cmake @ONLY) - # Keep track of the distcheck targets - set(distcheck_targets ${distcheck_targets} distcheck-${TARGET_SUFFIX}) -endmacro(CREATE_DISTCHECK) + # Define the repository verification build target + add_custom_target(distcheck-repo-verify + COMMAND ${CMAKE_COMMAND} -E echo "*** Check files in Source Repository against files specified in Build Logic ***" + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/distcheck_repo_verify.cmake) -macro(DEFINE_DISTCHECK_TARGET) - if(NOT IS_SUBBUILD) - find_program(CPACK_EXEC cpack) - mark_as_advanced(CPACK_EXEC) + # Define the source archive creation target - should only happen once repository is verified + add_custom_target(distcheck-source-archives + COMMAND ${CMAKE_COMMAND} -E echo "*** Create source tgz, tbz2 and zip archives from toplevel archive ***" + COMMAND ${CPACK_EXEC} --config ${CMAKE_CURRENT_BINARY_DIR}/CPackSourceConfig.cmake + DEPENDS distcheck-repo-verify) - # Set up the script that will be used to verify the source archives - configure_file(${BRLCAD_CMAKE_DIR}/distcheck_repo_verify.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/distcheck_repo_verify.cmake @ONLY) + # Utility macro for defining individual distcheck targets + macro(CREATE_DISTCHECK TARGET_SUFFIX CMAKE_OPTS) + # If we've already got a particular distcheck target, don't try to create it again. + get_target_property(not_in_all distcheck-${TARGET_SUFFIX} EXCLUDE_FROM_ALL) + if(NOT not_in_all) + # Need to set these locally so configure_file will pick them up... + SET(TARGET_SUFFIX ${TARGET_SUFFIX}) + SET(CMAKE_OPTS ${CMAKE_OPTS}) - add_custom_target(distcheck-repo-verify - COMMAND ${CMAKE_COMMAND} -E echo "*** Check files in Source Repository against files specified in Build Logic ***" - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/distcheck_repo_verify.cmake) + # Determine how to trigger the build in the distcheck target + if("${CMAKE_GENERATOR}" MATCHES "Make" AND ("${cmake_generator}" MATCHES "Make" OR NOT cmake_generator)) + if(NOT CMAKE_VERBOSE_DISTCHECK) + set(TARGET_REDIRECT " >> distcheck_${TARGET_SUFFIX}.log ") + endif(NOT CMAKE_VERBOSE_DISTCHECK) + set(DISTCHECK_BUILD_CMD "${CMAKE_COMMAND} -E chdir distcheck-${TARGET_SUFFIX}/build $(MAKE) ${TARGET_REDIRECT}") + else("${CMAKE_GENERATOR}" MATCHES "Make" AND ("${cmake_generator}" MATCHES "Make" OR NOT cmake_generator)) + set(DISTCHECK_BUILD_CMD "COMMAND ${CMAKE_COMMAND} -E build distcheck-${TARGET_SUFFIX}/build") + set(TARGET_REDIRECT "") + endif("${CMAKE_GENERATOR}" MATCHES "Make" AND ("${cmake_generator}" MATCHES "Make" OR NOT cmake_generator)) - add_custom_target(distcheck-source-archives - COMMAND ${CMAKE_COMMAND} -E echo "*** Create source tgz, tbz2 and zip archives from toplevel archive ***" - COMMAND ${CPACK_EXEC} --config ${CMAKE_CURRENT_BINARY_DIR}/CPackSourceConfig.cmake - DEPENDS distcheck-repo-verify) + # Based on the build command, generate a distcheck target definition from the template + configure_file(${BRLCAD_CMAKE_DIR}/distcheck_target.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/distcheck_target_${TARGET_SUFFIX}.cmake @ONLY) + include(${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/distcheck_target_${TARGET_SUFFIX}.cmake) + # Keep track of the distcheck targets + set(distcheck_targets ${distcheck_targets} distcheck-${TARGET_SUFFIX}) + else(NOT not_in_all) + message(WARNING "Distcheck target distcheck-${TARGET_SUFFIX} already defined, skipping...") + endif(NOT not_in_all) + endmacro(CREATE_DISTCHECK) - CREATE_DISTCHECK(debug "-DCMAKE_BUILD_TYPE=Debug") - CREATE_DISTCHECK(release "-DCMAKE_BUILD_TYPE=Release") + # Top level macro for defining the common "standard" cases and lets a CMake build select either + # the standard Debug + Release or all defined distchecks as the build that is triggered by the + # distcheck target - pass either STD or FULL as an argument to select one or the other. Default + # if not argument is supplied is STD. + macro(DEFINE_DISTCHECK_TARGET) + if(${ARGC} EQUAL 1) + string(TOUPPER ${ARGV0} ARGV0_UPPER) + if(${ARGV0_UPPER} STREQUAL "STD" OR ${ARGV0_UPPER} STREQUAL "STANDARD") + set(full_distcheck 0) + endif(${ARGV0_UPPER} STREQUAL "STD" OR ${ARGV0_UPPER} STREQUAL "STANDARD") + if(${ARGV0_UPPER} STREQUAL "FULL") + set(full_distcheck 1) + endif(${ARGV0_UPPER} STREQUAL "FULL") + endif(${ARGC} EQUAL 1) - add_custom_target(distcheck - # The source repository verification script is responsible for generating this file - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/distcheck_message - DEPENDS distcheck-debug distcheck-release) + CREATE_DISTCHECK(debug "-DCMAKE_BUILD_TYPE=Debug") + CREATE_DISTCHECK(release "-DCMAKE_BUILD_TYPE=Release") - add_custom_target(distcheck-full - # The source repository verification script is responsible for generating this file - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/distcheck_message - DEPENDS ${distcheck_targets}) + add_custom_target(distcheck-std + # The source repository verification script is responsible for generating this file + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/distcheck_message + DEPENDS distcheck-debug distcheck-release) - endif(NOT IS_SUBBUILD) -endmacro(DEFINE_DISTCHECK_TARGET) + add_custom_target(distcheck-full + # The source repository verification script is responsible for generating this file + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/distcheck_message + DEPENDS ${distcheck_targets}) + + if(full_distcheck) + add_custom_target(distcheck DEPENDS distcheck-full) + else(full_distcheck) + add_custom_target(distcheck DEPENDS distcheck-std) + endif(full_distcheck) + endmacro(DEFINE_DISTCHECK_TARGET) +endif(NOT IS_SUBBUILD) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |