smanders / externpro

build external projects with cmake
MIT License
13 stars 12 forks source link

coverage target(s) only created once #331

Closed smanders closed 2 years ago

smanders commented 2 years ago

we have a project that ends up calling xpSetFlagsGccDebug() twice and a check should be added so the custom targets in this macro are only created once see discussion https://isrhub.usurf.usu.edu/jcoppin/TestPlugins/pull/1#discussion_r96501

CMake Error at /opt/extern/externpro-21.05-gcc731-64-Linux/share/cmake/xpfunmac.cmake:2147 (add_custom_target):
  add_custom_target cannot create target "coverage" because another target
  with the same name already exists.  The existing target is a custom target
  created in source directory "/bpvol/SDKSuper".  See documentation for
  policy CMP0002 for more details.
Call Stack (most recent call first):
  /opt/extern/externpro-21.05-gcc731-64-Linux/share/cmake/xpfunmac.cmake:2184 (xpSetFlagsGccDebug)
  /opt/extern/externpro-21.05-gcc731-64-Linux/share/cmake/xpfunmac.cmake:2238 (xpSetFlagsGcc)
  SDKLibraries/make/toplevel.cmake:11 (xpSetFlags)
  SDKLibraries/CMakeLists.txt:6 (include)
smanders commented 2 years ago

completed with commit referenced above