Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsk_topic_tools/cmake/nodelet.cmake: add random prefix before _single… #1586

Merged
merged 2 commits into from Jul 26, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -4,7 +4,8 @@ macro(jsk_nodelet _nodelet_cpp _nodelet_class
_single_nodelet_exec_name _CODE_PARAM_NAME)
list(APPEND ${_CODE_PARAM_NAME} ${_nodelet_cpp})
set(NODELET ${_nodelet_class})
set(DEFAULT_NODE_NAME ${_single_nodelet_exec_name})
string(RANDOM __NODENAME_PREFIX)
set(DEFAULT_NODE_NAME JSK_NODELET_${__NODENAME_PREFIX}_${_single_nodelet_exec_name})

This comment has been minimized.

Copy link
@furushchev

furushchev Aug 2, 2018

Contributor

@k-okada Is there any rationale that you randomized the prefix?
I wonder any target may miss caches in the case of catkin build --force-cmake.
How about changing __NODENAME_PREFIX to, for example, just PROJECT_NAME?

This comment has been minimized.

Copy link
@k-okada

k-okada Aug 2, 2018

Author Member

@furushchev thank you for feedback, yes PROJECT_NAME would be better #1591

if(${USE_ROSBUILD})
rosbuild_find_ros_package(jsk_topic_tools)
set(_jsk_topic_tools_SOURCE_DIR ${jsk_topic_tools_PACKAGE_PATH})
@@ -19,19 +20,20 @@ macro(jsk_nodelet _nodelet_cpp _nodelet_class
endif(${USE_ROSBUILD})
configure_file(
${_jsk_topic_tools_SOURCE_DIR}/cmake/single_nodelet_exec.cpp.in
${_single_nodelet_exec_name}.cpp)
${DEFAULT_NODE_NAME}.cpp)
if(${USE_ROSBUILD})
rosbuild_add_executable(${_single_nodelet_exec_name} build/${_single_nodelet_exec_name}.cpp)
rosbuild_add_executable(${DEFAULT_NODE_NAME} build/${DEFAULT_NODE_NAME}.cpp)
else(${USE_ROSBUILD})
add_executable(${_single_nodelet_exec_name} ${_single_nodelet_exec_name}.cpp)
add_executable(${DEFAULT_NODE_NAME} ${DEFAULT_NODE_NAME}.cpp)
find_package(Boost QUIET REQUIRED COMPONENTS program_options)
target_link_libraries(${_single_nodelet_exec_name} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
target_link_libraries(${DEFAULT_NODE_NAME} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
endif(${USE_ROSBUILD})
set_target_properties(${DEFAULT_NODE_NAME} PROPERTIES OUTPUT_NAME ${_single_nodelet_exec_name})
if (${ARGC} GREATER 4)
list(APPEND ${ARGV4} ${_single_nodelet_exec_name})
list(APPEND ${ARGV4} ${DEFAULT_NODE_NAME})
endif(${ARGC} GREATER 4)
if(NOT ${USE_ROSBUILD})
install(TARGETS ${_single_nodelet_exec_name}
install(TARGETS ${DEFAULT_NODE_NAME}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.