Search code examples
openglcmakemapboxmapbox-glicu

Mapbox GL Native doesn't build ubuntu18


I'm trying to build Mapbox GL Native using cmake .. so I cloned the repository from GitHub:

$ git clone https://github.com/mapbox/mapbox-gl-native.git
$ cd mapbox-gl-native
$ mkdir build && cd build
$ cmake ./

then it returns this with the erros:

CMake Error at node_modules/@mapbox/cmake-node-module/module.cmake:126 (add_library):
  Target "mbgl-node.abi-64" links to target "OpenGL::OpenGL" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  platform/node/CMakeLists.txt:9 (add_node_module)


CMake Error at node_modules/@mapbox/cmake-node-module/module.cmake:126 (add_library):
  Target "mbgl-node.abi-64" links to target "OpenGL::OpenGL" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  platform/node/CMakeLists.txt:9 (add_node_module)


CMake Error at node_modules/@mapbox/cmake-node-module/module.cmake:126 (add_library):
  Target "mbgl-node.abi-57" links to target "OpenGL::OpenGL" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  platform/node/CMakeLists.txt:9 (add_node_module)

I need heeeelp, I've been here trying to fix this but I don't know what could be the problem..

Thanks guys!


Solution

  • If your OpenGL library path installation is defined in your ENV path, you want to set up your CMAKE_PREFIX_PATH to your OpenGL installation path (you could set it in your top level CMakeList.txt).