Skip to content

Using cmake to build nmos cpp error #17766

Open
@gl0522

Description

What is your question?

Hi!

  • When compiling the nmos-cpp source code using cmake .. on Ubuntu 22.04 system, the following error occurs:
CMake Error: CMAKE_PROJECT_TOP_LEVEL_INCLUDES file does not exist: third_party/cmake/conan_provider.cmake
CMake Error at Development/third_party/cmake/conan_provider.cmake:590 (cmake_language):
  cmake_language Dependency providers can only be set as part of the first
  call to project().  More specifically,
  cmake_language(SET_DEPENDENCY_PROVIDER) can only be called while the first
  project() command processes files listed in
  CMAKE_PROJECT_TOP_LEVEL_INCLUDES.
Call Stack (most recent call first):
  CMakeLists.txt:25 (include)
`

`The configuration of the cmake configuration file CMakeLists.txt is as follows:``


project(nmos-cpp)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/Development/cmake")

set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES "${CMAKE_BINARY_DIR}/third_party/cmake/conan_provider.cmake")

#if(CMAKE_PROJECT_TOP_LEVEL_INCLUDES)
#  cmake_minimum_required(VERSION 3.24 FATAL_ERROR)
#    else()
#       cmake_minimum_required(VERSION 3.17 FATAL_ERROR)
#    endif()
    #cmake_minimum_required(VERSION 3.17 FATAL_ERROR)
# project name
if(CMAKE_PROJECT_TOP_LEVEL_INCLUDES)
        #Include the specified file for Conan configuration or other setup
                        include(${CMAKE_PROJECT_TOP_LEVEL_INCLUDES})
                endif()

#project(nmos-cpp)

enable_language(CXX)
# enable or disable the example applications
set(NMOS_CPP_BUILD_EXAMPLES ON CACHE BOOL "Build example applications")

# enable or disable the unit test suite
set(NMOS_CPP_BUILD_TESTS ON CACHE BOOL "Build test suite application")

# enable or disable the LLDP support library (lldp)
# and its additional dependencies
set(NMOS_CPP_BUILD_LLDP OFF CACHE BOOL "Build LLDP support library")
mark_as_advanced(FORCE NMOS_CPP_BUILD_LLDP)

# common config
include(${CMAKE_SOURCE_DIR}/Development/cmake/NmosCppCommon.cmake)

# nmos-cpp dependencies
include(${CMAKE_SOURCE_DIR}/Development/cmake/NmosCppDependencies.cmake)

# nmos-cpp libraries
include(${CMAKE_SOURCE_DIR}/Development/cmake/NmosCppLibraries.cmake)

if(NMOS_CPP_BUILD_EXAMPLES)
    # nmos-cpp-node executable
    include(${CMAKE_SOURCE_DIR}/Development/cmake/NmosCppNode.cmake)

    # nmos-cpp-registry executable
    include(${CMAKE_SOURCE_DIR}/Development/cmake/NmosCppRegistry.cmake)
endif()

if(NMOS_CPP_BUILD_TESTS)
    # nmos-cpp-test executable
    include(${CMAKE_SOURCE_DIR}/Development/cmake/NmosCppTest.cmake)
endif()

# export the config-file package
include(${CMAKE_SOURCE_DIR}/Development/cmake/NmosCppExports.cmake)


Do you have any advise?

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions