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

"Threads::Threads" alias not found. #1502

Open
blowekamp opened this issue Dec 19, 2019 · 5 comments
Open

"Threads::Threads" alias not found. #1502

blowekamp opened this issue Dec 19, 2019 · 5 comments
Labels
Milestone

Comments

@blowekamp
Copy link
Member

@blowekamp blowekamp commented Dec 19, 2019

Description

When configuring SimpleITK against a build tree of ITK I get the following configuration error:

CMake Error at Testing/Unit/CMakeLists.txt:94 (add_executable):
Target "SimpleITKUnitTestDriver5" links to target "Threads::Threads" but
the target was not found. Perhaps a find_package() call is missing for an
IMPORTED target, or an ALIAS target is missing?

This appears to be coming from the update to google test with this line:
https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/ThirdParty/GoogleTest/src/itkgoogletest/googletest/cmake/internal_utils.cmake#L187

This is causing the following to be generated in ITKTargets.cmake:

Import target "GTest::GTest" for configuration "Release"

set_property(TARGET GTest::GTest APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(GTest::GTest PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "Threads::Threads"
IMPORTED_LOCATION_RELEASE "/scratch/blowekamp/ITK/lib/libitkgtest-5.1.a"
)

The Threads::Threads alias is part of CMake's FindThreads.

@blowekamp blowekamp added the type:Bug label Dec 19, 2019
@blowekamp blowekamp added this to the ITK v4.13.3 milestone Dec 19, 2019
@dzenanz

This comment has been minimized.

Copy link
Member

@dzenanz dzenanz commented Dec 19, 2019

Why is this part of 4.13.3 milestone? Google test was updated in master.

@blowekamp blowekamp modified the milestones: ITK v4.13.3, ITK v5.1rc02 Dec 19, 2019
@blowekamp

This comment has been minimized.

Copy link
Member Author

@blowekamp blowekamp commented Dec 19, 2019

Corrected to the next RC, hopefully it can be addressed by then.

@blowekamp

This comment has been minimized.

Copy link
Member Author

@blowekamp blowekamp commented Dec 19, 2019

The easiest thing to do would be just to set "gtest_disable_pthreads" to ON. A proper CMake exporting which combine the old variables of ITK-style with the newer target properties used here in Google test would be error prone for myself and would require a CMake guru to do it properly.

@dzenanz

This comment has been minimized.

Copy link
Member

@dzenanz dzenanz commented Dec 19, 2019

set "gtest_disable_pthreads" to ON

Sounds good. Why does GTest even want pthreads?

@blowekamp

This comment has been minimized.

Copy link
Member Author

@blowekamp blowekamp commented Dec 19, 2019

I know it's used here for "death tests":
https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#death-tests

So we are not using that.

blowekamp added a commit to blowekamp/ITK that referenced this issue Dec 19, 2019
Removes Threads::Threads form exported libraries dependencies, to
simply exports.

Addresses InsightSoftwareConsortium#1502.
@blowekamp blowekamp mentioned this issue Dec 19, 2019
8 of 8 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.