Skip to content

Easy to forget checking FIPS_IMPORT in a "dual use" project (import vs top-level) #230

@kaffeewolf

Description

@kaffeewolf

When an imported project already contains a .fips-imports.cmake it will cause the libraries referenced by that project to be added twice, causing cmake to fail

Proof of concept:
fips-import.zip

  • fips-import-broken imports fips-import which imports fips-glew.
  • running fips gen in fips-import-broken with a clean fips-import project succeeds
  • running fips gen in the fips-import and then again in fips-import-broken fails with
CMake Error at D:/devel/fipstest/fips/cmake/fips.cmake:299 (add_library):
  add_library cannot create target "glew" because another target with the
  same name already exists.  The existing target is a static library created
  in source directory "D:/devel/fipstest/fips-glew".  See documentation for
  policy CMP0002 for more details.
Call Stack (most recent call first):
  D:/devel/fipstest/fips-glew/CMakeLists.txt:17 (fips_end_lib)

Note: the urls in the fips-imports projects are obviously wrong, but it doesnt matter as they are already present in the folder structure.

CMake version 3.14.1, python 3.6 and 3.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions