fix paths for rosbuild

This commit is contained in:
Wim Meeussen 2012-11-08 21:54:05 +00:00
parent 2455ea74d7
commit 41c5e1f48c
2 changed files with 23 additions and 23 deletions

View File

@ -105,13 +105,13 @@ endmacro(_rosbuild_check_package_location)
# helper function to register check that results were generated (#580) # helper function to register check that results were generated (#580)
macro(_rosbuild_check_rostest_xml_result test_name test_file) macro(_rosbuild_check_rostest_xml_result test_name test_file)
add_custom_target(${test_name}_result add_custom_target(${test_name}_result
COMMAND ${rosunit_path}/bin/check_test_ran.py ${test_file} COMMAND ${rosunit_path}/scripts/check_test_ran.py ${test_file}
VERBATIM) VERBATIM)
# Redeclaration of target is to workaround bug in 2.4.6 # Redeclaration of target is to workaround bug in 2.4.6
if(CMAKE_MINOR_VERSION LESS 6) if(CMAKE_MINOR_VERSION LESS 6)
add_custom_target(test-results-run) add_custom_target(test-results-run)
endif(CMAKE_MINOR_VERSION LESS 6) endif(CMAKE_MINOR_VERSION LESS 6)
add_dependencies(test-results-run ${test_name}_result) add_dependencies(test-results-run ${test_name}_result)
endmacro(_rosbuild_check_rostest_xml_result test_name) endmacro(_rosbuild_check_rostest_xml_result test_name)
macro(_rosbuild_add_gtest exe) macro(_rosbuild_add_gtest exe)
@ -134,13 +134,13 @@ macro(_rosbuild_add_gtest exe)
# But don't depend on the gtest executable if rosbuild_test_nobuild is set, #3008 # But don't depend on the gtest executable if rosbuild_test_nobuild is set, #3008
if(NOT rosbuild_test_nobuild) if(NOT rosbuild_test_nobuild)
add_custom_target(test_${_testname} add_custom_target(test_${_testname}
COMMAND ${rosunit_path}/bin/rosunit --name=${_testname} --time-limit=${_gtest_TIMEOUT} ${EXECUTABLE_OUTPUT_PATH}/${exe} COMMAND ${rosunit_path}/../..//bin/rosunit --name=${_testname} --time-limit=${_gtest_TIMEOUT} ${EXECUTABLE_OUTPUT_PATH}/${exe}
DEPENDS ${EXECUTABLE_OUTPUT_PATH}/${exe} DEPENDS ${EXECUTABLE_OUTPUT_PATH}/${exe}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
VERBATIM) VERBATIM)
else(NOT rosbuild_test_nobuild) else(NOT rosbuild_test_nobuild)
add_custom_target(test_${_testname} add_custom_target(test_${_testname}
COMMAND ${rosunit_path}/bin/rosunit --name=${_testname} --time-limit=${_gtest_TIMEOUT} ${EXECUTABLE_OUTPUT_PATH}/${exe} COMMAND ${rosunit_path}/../..//bin/rosunit --name=${_testname} --time-limit=${_gtest_TIMEOUT} ${EXECUTABLE_OUTPUT_PATH}/${exe}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
VERBATIM) VERBATIM)
endif(NOT rosbuild_test_nobuild) endif(NOT rosbuild_test_nobuild)
@ -167,14 +167,14 @@ endmacro(_rosbuild_add_gtest)
# arguments as cmake doesn't know the name of the output file # arguments as cmake doesn't know the name of the output file
macro(_rosbuild_check_rostest_result test_name test_pkg test_file) macro(_rosbuild_check_rostest_result test_name test_pkg test_file)
add_custom_target(${test_name}_result add_custom_target(${test_name}_result
COMMAND ${rosunit_path}/bin/check_test_ran.py --rostest ${test_pkg} ${test_file} COMMAND ${rosunit_path}/scripts/check_test_ran.py --rostest ${test_pkg} ${test_file}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
VERBATIM) VERBATIM)
# Redeclaration of target is to workaround bug in 2.4.6 # Redeclaration of target is to workaround bug in 2.4.6
if(CMAKE_MINOR_VERSION LESS 6) if(CMAKE_MINOR_VERSION LESS 6)
add_custom_target(test-results-run) add_custom_target(test-results-run)
endif(CMAKE_MINOR_VERSION LESS 6) endif(CMAKE_MINOR_VERSION LESS 6)
add_dependencies(test-results-run ${test_name}_result) add_dependencies(test-results-run ${test_name}_result)
endmacro(_rosbuild_check_rostest_result test_name) endmacro(_rosbuild_check_rostest_result test_name)
macro(_rosbuild_add_rostest file) macro(_rosbuild_add_rostest file)
@ -207,7 +207,7 @@ macro(_rosbuild_add_rostest file)
# here through registration of a future test. Eventually, we should pass # here through registration of a future test. Eventually, we should pass
# in the overriding target (e.g., test-results vs. test-future-results). # in the overriding target (e.g., test-results vs. test-future-results).
# For now, we call _rosbuild_check_rostest_xml_result() in # For now, we call _rosbuild_check_rostest_xml_result() in
# rosbuild_add_rostest() # rosbuild_add_rostest()
# and rosbuild_add_rostest_future() instead. # and rosbuild_add_rostest_future() instead.
#_rosbuild_check_rostest_result(rostest_${_testname} ${PROJECT_NAME} ${file}) #_rosbuild_check_rostest_result(rostest_${_testname} ${PROJECT_NAME} ${file})
endmacro(_rosbuild_add_rostest) endmacro(_rosbuild_add_rostest)
@ -240,7 +240,7 @@ macro(_rosbuild_add_pyunit file)
# Create target for this test # Create target for this test
# We use rostest to call the executable to get process control, #1629 # We use rostest to call the executable to get process control, #1629
add_custom_target(pyunit_${_testname} add_custom_target(pyunit_${_testname}
COMMAND ${rosunit_path}/bin/rosunit --name=${_testname} --time-limit=${_pyunit_TIMEOUT} -- ${file} ${_covarg} COMMAND ${rosunit_path}/../..//bin/rosunit --name=${_testname} --time-limit=${_pyunit_TIMEOUT} -- ${file} ${_covarg}
DEPENDS ${file} DEPENDS ${file}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
VERBATIM) VERBATIM)
@ -272,13 +272,13 @@ macro(_rosbuild_add_roslaunch_check targetname file)
DEPENDS ${file} DEPENDS ${file}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
VERBATIM) VERBATIM)
# Make sure all test programs are built before running this test # Make sure all test programs are built before running this test
# but not if rosbuild_test_nobuild is set, #3008 # but not if rosbuild_test_nobuild is set, #3008
if(NOT rosbuild_test_nobuild) if(NOT rosbuild_test_nobuild)
add_dependencies(${targetname} tests) add_dependencies(${targetname} tests)
endif(NOT rosbuild_test_nobuild) endif(NOT rosbuild_test_nobuild)
endmacro(_rosbuild_add_roslaunch_check) endmacro(_rosbuild_add_roslaunch_check)
macro(_rosbuild_wget_and_build tarball tarball_url tarball_dir unpack_cmd configure_cmd make_cmd install_cmd) macro(_rosbuild_wget_and_build tarball tarball_url tarball_dir unpack_cmd configure_cmd make_cmd install_cmd)
@ -292,13 +292,13 @@ macro(_rosbuild_wget_and_build tarball tarball_url tarball_dir unpack_cmd config
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/${tarball} add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/${tarball}
COMMAND ${WGET_EXECUTABLE} ${tarball_url} -O ${tarball} COMMAND ${WGET_EXECUTABLE} ${tarball_url} -O ${tarball}
VERBATIM) VERBATIM)
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/${tarball_dir} add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/${tarball_dir}
COMMAND ${_unpack_cmd} ${tarball} COMMAND ${_unpack_cmd} ${tarball}
COMMAND touch ${tarball_dir} COMMAND touch ${tarball_dir}
DEPENDS ${PROJECT_BINARY_DIR}/${tarball} DEPENDS ${PROJECT_BINARY_DIR}/${tarball}
VERBATIM) VERBATIM)
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/installed add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/installed
COMMAND cmake -E chdir ${PROJECT_BINARY_DIR}/${tarball_dir} ${_configure_cmd} COMMAND cmake -E chdir ${PROJECT_BINARY_DIR}/${tarball_dir} ${_configure_cmd}
COMMAND cmake -E chdir ${PROJECT_BINARY_DIR}/${tarball_dir} ${_make_cmd} COMMAND cmake -E chdir ${PROJECT_BINARY_DIR}/${tarball_dir} ${_make_cmd}
@ -306,7 +306,7 @@ macro(_rosbuild_wget_and_build tarball tarball_url tarball_dir unpack_cmd config
COMMAND touch ${PROJECT_BINARY_DIR}/installed COMMAND touch ${PROJECT_BINARY_DIR}/installed
DEPENDS ${PROJECT_BINARY_DIR}/${tarball_dir} DEPENDS ${PROJECT_BINARY_DIR}/${tarball_dir}
VERBATIM) VERBATIM)
add_custom_target(fetch_and_build ALL add_custom_target(fetch_and_build ALL
DEPENDS ${PROJECT_BINARY_DIR}/installed) DEPENDS ${PROJECT_BINARY_DIR}/installed)
endmacro(_rosbuild_wget_and_build) endmacro(_rosbuild_wget_and_build)
@ -327,7 +327,7 @@ macro(_rosbuild_add_library lib libname type)
rosbuild_add_compile_flags(${lib} -fPIC) rosbuild_add_compile_flags(${lib} -fPIC)
endif() endif()
endif(${type} STREQUAL STATIC) endif(${type} STREQUAL STATIC)
# Add explicit dependency of each file on our manifest.xml and those of # Add explicit dependency of each file on our manifest.xml and those of
# our dependencies # our dependencies
get_target_property(_srclist ${lib} SOURCES) get_target_property(_srclist ${lib} SOURCES)
@ -338,7 +338,7 @@ macro(_rosbuild_add_library lib libname type)
message("[rosbuild] Couldn't find source file ${_src}; assuming that it is in ${CMAKE_CURRENT_SOURCE_DIR} and will be generated later") message("[rosbuild] Couldn't find source file ${_src}; assuming that it is in ${CMAKE_CURRENT_SOURCE_DIR} and will be generated later")
set(_file_name ${CMAKE_CURRENT_SOURCE_DIR}/${_src}) set(_file_name ${CMAKE_CURRENT_SOURCE_DIR}/${_src})
endif(NOT _file_name) endif(NOT _file_name)
add_file_dependencies(${_file_name} ${ROS_MANIFEST_LIST}) add_file_dependencies(${_file_name} ${ROS_MANIFEST_LIST})
endforeach(_src) endforeach(_src)
# Prevent deletion of existing lib of same name # Prevent deletion of existing lib of same name
@ -413,7 +413,7 @@ endmacro(_rosbuild_compare_manifests var _t)
# http://www.itk.org/Wiki/CMakeMacroParseArguments # http://www.itk.org/Wiki/CMakeMacroParseArguments
MACRO(PARSE_ARGUMENTS prefix arg_names option_names) MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
SET(DEFAULT_ARGS) SET(DEFAULT_ARGS)
FOREACH(arg_name ${arg_names}) FOREACH(arg_name ${arg_names})
SET(${prefix}_${arg_name}) SET(${prefix}_${arg_name})
ENDFOREACH(arg_name) ENDFOREACH(arg_name)
FOREACH(option ${option_names}) FOREACH(option ${option_names})
@ -422,16 +422,16 @@ MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
SET(current_arg_name DEFAULT_ARGS) SET(current_arg_name DEFAULT_ARGS)
SET(current_arg_list) SET(current_arg_list)
FOREACH(arg ${ARGN}) FOREACH(arg ${ARGN})
SET(larg_names ${arg_names}) SET(larg_names ${arg_names})
LIST(FIND larg_names "${arg}" is_arg_name) LIST(FIND larg_names "${arg}" is_arg_name)
IF (is_arg_name GREATER -1) IF (is_arg_name GREATER -1)
SET(${prefix}_${current_arg_name} ${current_arg_list}) SET(${prefix}_${current_arg_name} ${current_arg_list})
SET(current_arg_name ${arg}) SET(current_arg_name ${arg})
SET(current_arg_list) SET(current_arg_list)
ELSE (is_arg_name GREATER -1) ELSE (is_arg_name GREATER -1)
SET(loption_names ${option_names}) SET(loption_names ${option_names})
LIST(FIND loption_names "${arg}" is_option) LIST(FIND loption_names "${arg}" is_option)
IF (is_option GREATER -1) IF (is_option GREATER -1)
SET(${prefix}_${arg} TRUE) SET(${prefix}_${arg} TRUE)
ELSE (is_option GREATER -1) ELSE (is_option GREATER -1)

View File

@ -331,13 +331,13 @@ macro(rosbuild_init)
add_custom_target(test-results-run) add_custom_target(test-results-run)
add_custom_target(test-results add_custom_target(test-results
COMMAND ${rosunit_path}/bin/summarize_results.py --nodeps ${_project}) COMMAND ${rosunit_path}/scripts/summarize_results.py --nodeps ${_project})
add_dependencies(test-results test-results-run) add_dependencies(test-results test-results-run)
# Do we want coverage reporting (only matters for Python, because # Do we want coverage reporting (only matters for Python, because
# Bullseye already collects everything into a single file). # Bullseye already collects everything into a single file).
if("$ENV{ROS_TEST_COVERAGE}" STREQUAL "1") if("$ENV{ROS_TEST_COVERAGE}" STREQUAL "1")
add_custom_target(test-results-coverage add_custom_target(test-results-coverage
COMMAND ${rosunit_path}/bin/pycoverage_to_html.py COMMAND ${rosunit_path}/scripts/pycoverage_to_html.py
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
# Make tests run before collecting coverage results # Make tests run before collecting coverage results
add_dependencies(test-results-coverage test-results-run) add_dependencies(test-results-coverage test-results-run)