Skip to content

CMakeLists.txt using $<IF:...> syntax when not supported by that version of CMake #1892

@dneto0

Description

@dneto0

Example of a broken build when using CMake 3.7:

https://source.cloud.google.com/results/invocations/c18bbd62-5117-4837-8aaa-5665b8e1b3ee/log

Excerpt:

-- Google Mock found - building tests
-- Configuring done
CMake Error:
  Error evaluating generator expression:
    $<IF:$<CONFIG:Debug>,gmockd,gmock>
  Expression did not evaluate to a known generator expression
CMake Error:
  Error evaluating generator expression:
    $<IF:$<CONFIG:Debug>,gmock_maind,gmock_main>
  Expression did not evaluate to a known generator expression

The $IF:... syntax was introduced in CMake 3.8.
Insteda of $IF:expr,A,B we can use $expr:A$&lt;$NOT:expr:B> construction instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions