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

CMake: Do not include test targets in PCLConfig.cmake #2458

Merged

Conversation

SergioRAgostinho
Copy link
Member

Fixes #2429.

PCLConfig.cmake before the change

# ------------------------------------------------------------------------------------
# Helper to use PCL from outside project
#
# target_link_libraries(my_fabulous_target PCL_XXX_LIBRARIES) where XXX is the
# upper cased xxx from :
# 
# - common
# - kdtree
# - octree
# - search
# - tests_common
# - tests_kdtree
# - tests_octree
# - tests_search
#
# PCL_INCLUDE_DIRS is filled with PCL and available 3rdparty headers
# PCL_LIBRARY_DIRS is filled with PCL components libraries install directory and
# 3rdparty libraries paths
#
#                                   www.pointclouds.org
#------------------------------------------------------------------------------------

After the proposed patch

# ------------------------------------------------------------------------------------
# Helper to use PCL from outside project
#
# target_link_libraries(my_fabulous_target PCL_XXX_LIBRARIES) where XXX is the
# upper cased xxx from :
# 
# - common
# - kdtree
# - octree
# - search
#
# PCL_INCLUDE_DIRS is filled with PCL and available 3rdparty headers
# PCL_LIBRARY_DIRS is filled with PCL components libraries install directory and
# 3rdparty libraries paths
#
#                                   www.pointclouds.org
#------------------------------------------------------------------------------------

@taketwo
Copy link
Member

taketwo commented Sep 27, 2018

Thanks, works for me. Though I needed to think a bit to understand the logic. Would something like this be more clear?

string(REGEX MATCH "^tests_" _is_test ${_ss})
if(_status AND NOT _is_test)
   ...

@SergioRAgostinho
Copy link
Member Author

Your proposal is indeed much clearer and you get the feeling of what is happening just from looking at code. I changed it accordingly.

@taketwo taketwo merged commit bec4bf1 into PointCloudLibrary:master Sep 28, 2018
@SergioRAgostinho SergioRAgostinho deleted the pclconfig-test-targets branch September 28, 2018 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants