NonValidTarget1.cmake 506 B

1234567891011121314151617
  1. set(genexvar $<COMPILE_FEATURES:cxx_final>)
  2. if (HAVE_FINAL)
  3. set(expected_result 1)
  4. else()
  5. set(expected_result 0)
  6. endif()
  7. add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file${expected_result}.cpp"
  8. COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp"
  9. )
  10. add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp")
  11. if (HAVE_FINAL)
  12. target_compile_features(empty PRIVATE cxx_final)
  13. endif()