Bug #1678

CMake dependency parsing gets confused when package name is a variable

Added by J. Wienke over 10 years ago. Updated about 7 years ago.

Status:ResolvedStart date:12/09/2013
Priority:NormalDue date:
Assignee:J. Moringen% Done:

100%

Category:Project Analysis
Target version:0.9

Description

something like

find_package(${ext})

results in such a build job bash fragment:
${EXT}_DIR="$(find "/tmp/isy//WS2013/releases/precise" -type f -name "${ext}Config.cmake" -exec dirname {} \;)" 

If EXT and ext are not defined by accident somewhere on the ci server, this job will not work because variable must not start with an underscore.

Associated revisions

Revision 53160f1d
Added by J. Moringen about 8 years ago

Improved heuristics in src/analysis/cmake.lisp

refs #1678

  • src/analysis/cmake.lisp (header): updated copyright
    (set-version-scanner): fixed whitespace handling
    (set-variable-scanner): likewise
    (project-scanner): likewise
    (find-package-scanner): likewise
    (pkg-check-modules-scanner): likewise
    (%resolve-cmake-variables): renamed %resolve-cmake-{version ->
    variables}
    (analyze): adapted to other changes; signal continuable errors when
    names or versions cannot be resolved

History

#1 Updated by J. Moringen over 10 years ago

  • Target version set to 0.2

#2 Updated by J. Moringen almost 10 years ago

  • Target version changed from 0.2 to 0.3

#3 Updated by J. Moringen over 9 years ago

  • Target version changed from 0.3 to 0.4

#4 Updated by J. Moringen about 9 years ago

  • Target version changed from 0.4 to 0.5

#5 Updated by J. Moringen about 8 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 50

#6 Updated by J. Moringen over 7 years ago

  • Target version changed from 0.5 to 0.8

#7 Updated by J. Moringen over 7 years ago

  • Target version changed from 0.8 to 0.9

#8 Updated by J. Moringen about 7 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100

This works much better now.

In particular, cases in which the variable is defined with set(…) should work correctly, i.e. expand the variable reference to the assigned value.

What doesn't work are variables bound (e.g. by foreach) assigned by other means (e.g. string(…), list(…) or any command with a result variable).

Please report specific cases of variables not being expanded in separate, new issues.

Also available in: Atom PDF