Skip to content

Installing nmos cpp with source code yields an error #434

Description

@gl0522
  1. 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 CMakeLists.txt:16 (enable_language):
Language 'CXX' is currently being enabled. Recursive call not allowed.

-- Configuring incomplete, errors occurred!
See also "/home/gule/nmos-cpp/Development/CMakeFiles/CMakeOutput.log".

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

# the injection point may be used to configure conan, but that requires CMake 3.24 or higher
# so avoid confusion and reject invocations which attempt to use it on lower versions
# see https://cmake.org/cmake/help/v3.24/variable/CMAKE_PROJECT_TOP_LEVEL_INCLUDES.html
# the alternative is to run conan install first instead
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/Development/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
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)

Can you give me some advice?

Activity

  1. jonathan-r-thorpe commented on Feb 13, 2025

    @jonathan-r-thorpe
    Contributor

    It seems that CMake is not finding the conan_provider.cmake file.

    You could verify that it is in the file system; it should be found in the Development\third_party\cmake directory.

    Then make sure that CMake is being run from the correct directory as per the Getting Started instructions:

    cd <home-dir>/nmos-cpp/Development
    mkdir build
    cd build
    cmake .. \
      -DCMAKE_BUILD_TYPE:STRING="<Debug-or-Release>" \
      -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES:STRING="third_party/cmake/conan_provider.cmake"
    make
  2. gl0522 commented on Feb 21, 2025

    @gl0522
    Author
    Thank you very much for your suggestion
    
    According to your suggestion 
    
    > cd <home-dir>/nmos-cpp/Development
    > mkdir build
    > cd build
    > cmake .. \
    >   -DCMAKE_BUILD_TYPE:STRING="<Debug-or-Release>" \
    >   -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES:STRING="third_party/cmake/conan_provider.cmake"
    > make
    
    

    Use the following instructions to perform compilation, but the result is as follows

    CMake Error: CMAKE_PROJECT_TOP_LEVEL_INCLUDES file does not exist: third_party/cmake/conan_provider.cmake
    CMake Error at CMakeLists.txt:30 (enable_language):
      Language 'CXX' is currently being enabled.  Recursive call not allowed.
    
    
    -- Configuring incomplete, errors occurred!
    See also "/home/gule/nmos-cpp/Development/CMakeFiles/CMakeOutput.log".
    
    

    But there is indeed conad_vider.cmake in the Development/cmake folder

     Here are the contents of the cmake folder
    
    

    gule@gule-VirtualBox:/nmos-cpp/Development/cmake$ ls
    CMakeRegexEscape.cmake NmosCppCompileSettings.cmake NmosCppExports.cmake NmosCppRegistry.cmake
    conan_provider.cmake nmos-cpp-config.cmake.in NmosCppLibraries.cmake NmosCppTest.cmake
    NmosCppCommon.cmake NmosCppDependencies.cmake NmosCppNode.cmake
    gule@gule-VirtualBox:
    /nmos-cpp/Development/cmake$ pwd
    /home/gule/nmos-cpp/Development/cmake

    Image

    What a headache inducing problem

  3. jonathan-r-thorpe commented on Feb 21, 2025

    @jonathan-r-thorpe
    Contributor

    The location of your conan_provider.cmake file is incorrect for some reason.

    CMake expects it to be in the relative location third_party/cmake/conan_provider.cmake which you'll see from the error message you're getting.

    The absolute location for you would therefore be ~/nmos-cpp/Development/third_party/cmake/conan_provider.cmake and not in ~/nmos-cpp/Development/cmake/conan_provider.cmake where you seem to have it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions