albertodemichelis / squirrel

Official repository for the programming language Squirrel
http://www.squirrel-lang.org
MIT License
895 stars 149 forks source link

cmake-3.19.1 is not compatible with squirrel's CMakeLists.txt #231

Closed trofi closed 3 years ago

trofi commented 3 years ago

It's a forward of https://bugs.gentoo.org/757615 bug report by Toralf Förster

$ cmake ..
-- The C compiler identification is Clang 11.0.0
-- The CXX compiler identification is Clang 11.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/lib/ccache/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/ccache/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
CMake Error: install(EXPORT "squirrel" ...) includes target "squirrel" more than once in the export set.
CMake Error in CMakeLists.txt:
  given target "squirrel" more than once.

CMake Generate step failed.  Build files cannot be regenerated correctly.

Looks like cmake is now stricter about export name collisions:

export(EXPORT squirrel
  NAMESPACE squirrel::
  FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/cmake/squirrel/squirrel-targets.cmake"
  )

...
  install(EXPORT squirrel
    NAMESPACE squirrel::
    DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/squirrel"
    FILE "squirrel-targets.cmake"
    COMPONENT Development
    )
trofi commented 3 years ago

cmake-3.19.2 compiles squirrel without problems. assuming a cmake-3.19.1 regression.