Brad, thanks. It could be applied more easily. I have a question: - I am afraid the keyword INTERFACE &c. might require (CMP0022 NEW). Should I put cmake_policy() conditionally? cmake_policy(SET CMP0022 NEW) or (VERSION 2.8.12)
2014-02-24 22:31 GMT+09:00 Brad King <[email protected]>: > On 02/23/2014 08:14 PM, NAKAMURA Takumi wrote: >> >> Argyrios, I'd be happy if this feature worked as optional. >> >> Brad, any good idea? >> Could I twiddle cmake_minimum_required and cmake_policy explicitly there? > > You can leave > > cmake_minimum_required(VERSION 2.8.8) > > alone and make the new keyword arguments conditional with variables: > > if(NOT CMAKE_VERSION VERSION_LESS 2.8.12) > set(cmake_2_8_12_INTERFACE INTERFACE) > set(cmake_2_8_12_PRIVATE PRIVATE) > else() > set(cmake_2_8_12_INTERFACE) > set(cmake_2_8_12_PRIVATE) > endif() > > Then use them like this: > > target_link_libraries(${name} ${cmake_2_8_12_INTERFACE} ${ARG_LINK_LIBS}) > > On older versions the call will turn into > > target_link_libraries(${name} ${ARG_LINK_LIBS}) > > and on 2.8.12 and above it will become > > target_link_libraries(${name} INTERFACE ${ARG_LINK_LIBS}) > > The "cmake_2_8_12_" prefix is just to call attention to the code > to remember to simplify it when 2.8.12 or later becomes required. > Any variable names could be used, of course. > > -Brad > _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
