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

Conversation

k-okada
Copy link
Member

@k-okada k-okada commented Jun 24, 2018

…_nodelet_exec_name

I have asked personal question from a @sanketrahul about 'target with same name already exists. This will occur only when you use catkin_make, catkin build users do not encounter this error, because it is isolated build so that current cmake target will not collide with another packages's target.

�[0m�[31m�[1mCMake Error�[0m at /opt/ros/kinetic/share/jsk_topic_tools/cmake/nodelet.cmake:26 (add_executable):
�[0m  add_executable cannot create target "pointcloud_to_pcd" because another
�[0m  target with the same name already exists.  The existing target is an
�[0m  executable created in source directory
�[0m  "/home/baxter2/pcl_ros_ws/src/perception_pcl/pcl_ros".  See documentation
�[0m  for policy CMP0002 for more details.
�[0m�[36m�[4mCall Stack (most recent call first):�[0m
�[0m  jsk_recognition/jsk_pcl_ros_utils/CMakeLists.txt:102 (jsk_nodelet)

https://gist.github.com/sanketrahul/1223fa186110499f4ef01533f928b6d9

@iory
Copy link
Member

iory commented Jul 24, 2018

@k-okada
I checked build failed when we use cakin_build command in jsk_common.
Also, I checked ```build succeeded`` by applyging this patch in kinetic.

@iory
Copy link
Member

iory commented Jul 24, 2018

@k-okada
I did not understand the meaning of this commit.
d70ebff
Please teach me.

@k-okada
Copy link
Member Author

k-okada commented Jul 26, 2018

@iory d70ebff is merged commit including a9f4f52 0397a78 0f99a57 ...

@k-okada k-okada merged commit 798828a into jsk-ros-pkg:master Jul 26, 2018
@k-okada k-okada deleted the fix_duplicates_target branch July 26, 2018 00:51
@iory
Copy link
Member

iory commented Jul 26, 2018

I see. Thank you!

furushchev added a commit to furushchev/jsk_recognition that referenced this pull request Aug 1, 2018
furushchev added a commit to furushchev/jsk_recognition that referenced this pull request Aug 1, 2018
@furushchev furushchev added this to the 2.2.8 milestone Aug 1, 2018
@@ -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})
Copy link
Member

@furushchev furushchev Aug 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants