SlicerExecutionModel icon indicating copy to clipboard operation
SlicerExecutionModel copied to clipboard

Add support for CMake function target_compile_features

Open fbudin69500 opened this issue 9 years ago • 1 comments

When compiling a target that has specific C++ requirements, one can use the new CMake function target_compile_features() [1].

There is currently no way of passing these requirements to SEMMacroBuildCLI, and the targets created in the macro are not exposed to the user. It would be great to either be able:

  1. to pass the requirements to the CMake macro or
  2. to expose the list of targets created by the macro.

Note: Both solutions are not mutually exclusive and even if 1) is implemented, 2) might still be useful in certain corner cases.

[1] https://cmake.org/cmake/help/v3.6/command/target_compile_features.html

fbudin69500 avatar Sep 26 '16 17:09 fbudin69500

Thanks for creating the report.

My first idea would be to extend the SEMMacroBuildCLI API to accept an optional multi value parameters named COMPILE_FEATURES.

They could be listed doing something like this:

SEMMacroBuildCLI(
  NAME ${MODULE_NAME}
  LOGO_HEADER ${Slicer_SOURCE_DIR}/Resources/ITKLogo.h
  TARGET_LIBRARIES ${ITK_LIBRARIES}
  COMPILE_FEATURES
    PRIVATE cxx_digit_separators cxx_generic_lambdas
    PUBLIC cxx_alias_templates
  )

If there are features we could generally expect to be available for all CLI, a variable named SlicerExecutionModel_REQUIRED_COMPILE_FEATURES could also be hardcoded in the SlicerExecutionModel project ...

jcfr avatar Sep 26 '16 17:09 jcfr