Skip to content

CMake 3.19 errors

I have just noticed that Homebrew has updated the CMake formula on their side (therefore, under the hood and outside our control) to CMake 3.19, and that causes a previously unseen error on our GeoModel side:

➜  build_viz cmake -DCMAKE_INSTALL_PREFIX=../install -DGEOMODEL_BUILD_VISUALIZATION=1 ../GeoModel/
-- -----
-- Building with type: Release
-- Using C++ standard: 17
-- -----
-- SetupJSON - Found 'nlohmann_json' at: /usr/local/lib/cmake/nlohmann_json
-- Building GeoModelVisualization as part of the root GeoModel project.
-- Found Coin3D: /usr/local/lib/libCoin.dylib
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework
-- -----
-- Building the following 4 packages: GeoModelCore, GeoModelIO, GeoModelTools, GeoModelVisualization
-- -----
-- Configuring done
CMake Error: install(EXPORT "GeoModelCore-export" ...) includes target "GeoGenericFunctions" more than once in the export set.
CMake Error: install(EXPORT "GeoModelIO-export" ...) includes target "GeoModelDBManager" more than once in the export set.
CMake Error: install(EXPORT "GeoModelTools-export" ...) includes target "GeoModelXMLParser" more than once in the export set.
CMake Error in GeoModelCore/CMakeLists.txt:
  given target "GeoGenericFunctions" more than once.

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

From a quick search on the web, it seems that the problem is related to CMake 3.19. Also, before updating Homebrew I could happily compile GeoModel with the previously installed version, 3.18.1.