-
Notifications
You must be signed in to change notification settings - Fork 201
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
Use proper boost target name #637
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,6 +182,15 @@ target_include_directories( | |
$<$<BOOL:${UFE_FOUND}>:${UFE_INCLUDE_DIR}> | ||
) | ||
|
||
# There were bugs in both cmake and findboost with the boost version string. So in | ||
# order to support all boost and cmake versions, we check how the boost version is | ||
# defined and create our version comparison string. | ||
if(${Boost_VERSION} MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$") | ||
set(boost_1_70_0_ver_string "1.70.0") | ||
else() | ||
set(boost_1_70_0_ver_string "107000") | ||
endif() | ||
|
||
target_link_libraries(${LIBRARY_NAME} | ||
AL_EventSystem | ||
AL_USDMayaUtils | ||
|
@@ -201,7 +210,7 @@ target_link_libraries(${LIBRARY_NAME} | |
usdImagingGL | ||
vt | ||
Boost::python | ||
$<IF:$<BOOL:${IS_WINDOWS}>,Boost::thread,${Boost_THREAD_LIBRARY}> | ||
$<IF:$<VERSION_GREATER_EQUAL:${Boost_VERSION},${boost_1_70_0_ver_string}>,Boost::thread,${Boost_THREAD_LIBRARY}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are 1.70.0 or greater use the Boost::thread, otherwise use Boost_THREAD_LIBRARY. Note: in 1.70.0, Boost_THREAD_LIBRARY is not set because we are setting boost_root to the USD location so it uses the boost config cmake files there. I would like to use Boost::thread all the time, but that causes a problem with v1.66.0 on the Mac in that it brings in Boost::chrono, but we don't have that. |
||
$<$<BOOL:${IS_WINDOWS}>:Boost::chrono> | ||
$<$<BOOL:${IS_WINDOWS}>:Boost::date_time> | ||
$<$<BOOL:${NEED_BOOST_FILESYSTEM}>:Boost::filesystem> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
USD uses a different version of boost on Windows (1.70.0) and Linux/Mac, python 2 (1.66.0) and python 3 (1.70.0). Because of this the Boost_VERSION string has a different format between the two versions. And Boost_VERSION_STRING is not always set. There is also a fix in cmake 3.15, but we support 3.13-3.17.
So in order to work around all of this I detect the format of the boost version and set a string for 1.70.0 to compare against.