Alex, Please see https://github.com/STEllAR-GROUP/hpx/pull/2540 for a possible fix. As it turns out we simply did not properly change all uses of target_link_libraries(), but only a few.
Thanks for reporting! Regards Hartmut --------------- http://boost-spirit.com http://stellar.cct.lsu.edu > -----Original Message----- > From: [email protected] [mailto:hpx-users- > [email protected]] On Behalf Of Alexander Neundorf > Sent: Wednesday, March 15, 2017 4:40 PM > To: [email protected] > Subject: [hpx-users] linking/cmake problem > > Hi, > > I'm building hpx without cuda, and in examples/qt/, tools/ and > tools/inspect/ > cmake errors out with the following error: > > CMake Error at examples/qt/CMakeLists.txt:26 (target_link_libraries): > Policy CMP0023 is not set: Plain and keyword target_link_libraries > signatures cannot be mixed. Run "cmake --help-policy CMP0023" for > policy > details. Use the cmake_policy command to set the policy and suppress > this > warning. > > The keyword signature for target_link_libraries has already been used > with > the target "qt_exe". All uses of target_link_libraries with a target > must > be either all-keyword or all-plain. > > The uses of the keyword signature are here: > > * cmake/HPX_SetupTarget.cmake:202 (target_link_libraries) > > > This happens AFAICT because in HPX_SetupTarget.cmake there is the > following > code: > if(NOT HPX_WITH_CUDA) # Cuda needs plain target_link_libraries() > signature > target_link_libraries(${target} PUBLIC ${hpx_libs} > ${target_DEPENDENCIES}) > else() > target_link_libraries(${target} ${hpx_libs} ${target_DEPENDENCIES}) > endif() > > i.e. without CUDA the "PUBLIC" signature of target_link_libraries() is > used. > Now in the mentioned directories target_link_libraries() is used without > PUBLIC/PRIVATE/INTERFACE keywords. > This is (by default) not allowed (see here > https://cmake.org/cmake/help/v3.8/ > policy/CMP0023.html ). > > I could make it work for me by adding "PRIVATE" (or "PUBLIC") to the > respective target_link_libraries() calls, e.g. in examples/qt/. > But I guess this will break then in the other case, when building with > CUDA. > > The "PUBLIC" was added last November without much explanation: > https://github.com/STEllAR-GROUP/hpx/commit/ > fb1fc68ea82a4623b5644f15f1d508fa9733f442 > > In src/CMakeLists.txt this is handled by duplicating the whole > target_link_libraries()-calls in an if(WITH_CUDA) branch. > > I see the following options to make it always work: > > 1. add something like hpx_target_link_libraries(), which wraps > target_link_libraries() and contains this if(WITH_CUDA) - maybe a bit > overkill > ? > > 2. set a HPX_TLL_KEYWORD variable at the top level and use that then > everywhere in the target_link_libraries() calls: > set( HPX_TLL_KEYWORD) > if (NOT HPX_WITH_CUDA) > set(HPX_TLL_KEYWORD PUBLIC) > endif() > > 3. add the if(WITH_CUDA) in the three CMakeLists.txt which have a problem > right now. > > 4. remove the "PUBLIC" from hpx_setup_target(). > But I guess there was a reason why it was added ? > > 5. add PUBLIC also with CUDA, but I guess there is a reason it is not > there ? > > I think my favourite is option 2, add a keyword-variable. > > Alex > > _______________________________________________ > hpx-users mailing list > [email protected] > https://mail.cct.lsu.edu/mailman/listinfo/hpx-users _______________________________________________ hpx-users mailing list [email protected] https://mail.cct.lsu.edu/mailman/listinfo/hpx-users
