When gtest is not available, the target test_socket is not created by catkin_add_gtest (it provides a warning that gtest
was not found and does not add the test). Trying to set the target properties then leads to a configuration error. Making this block conditional on the existence of the target fixes the configuration error.
When gtest is not available, the target test_socket is not created by catkin_add_gtest (it provides a warning that gtest was not found and does not add the test). Trying to set the target properties then leads to a configuration error. Making this block conditional on the existence of the target fixes the configuration error.