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

Fix problem with Googletest's LIBRARY_OUTPUT_DIRECTORY #1135

Merged
merged 1 commit into from
Apr 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions cmake/test/gtest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -382,15 +382,23 @@ if(FORCE_GTEST_GMOCK_FROM_SOURCE OR (NOT GMOCK_FOUND AND NOT GTEST_FOUND))
if(base_dir)
# overwrite CMake install command to skip install rules for gtest targets
# which have been added in version 1.8.0
# Googletest 1.10 has a INSTALL_GTEST option that we can override,
# so we do that, too.
option(INSTALL_GTEST "This option must be turned OFF" OFF)
_use_custom_install()
set(_CATKIN_SKIP_INSTALL_RULES TRUE)
add_subdirectory(${base_dir} ${gtest_lib_dir})
set(_CATKIN_SKIP_INSTALL_RULES FALSE)
# Fix output directories, which conflict with Python's setup.py
set_target_properties(${gtest_libs} ${gtest_main_libs}
PROPERTIES EXCLUDE_FROM_ALL 1)
PROPERTIES EXCLUDE_FROM_ALL 1
LIBRARY_OUTPUT_DIRECTORY ${gtest_lib_dir}/lib
ARCHIVE_OUTPUT_DIRECTORY ${gtest_lib_dir}/lib)
if(gmock_found)
set_target_properties(${gmock_libs} ${gmock_main_libs}
PROPERTIES EXCLUDE_FROM_ALL 1)
PROPERTIES EXCLUDE_FROM_ALL 1
LIBRARY_OUTPUT_DIRECTORY ${gtest_lib_dir}/lib
ARCHIVE_OUTPUT_DIRECTORY ${gtest_lib_dir}/lib)
endif()
endif()

Expand Down