This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

pc-ble-driver build up error on windows

Hi,

I want to build up a test software to test our product.

I find out pc-ble-driver that might be conformed our requirement and follow up below link to set up environment on windows 10

https://github.com/NordicSemiconductor/pc-ble-driver

And, I use visual studio 2019 to set up.

But, I encounter a issue in chapter Compiling pc-ble-driver from source step 2.

2. CMake Select the Visual Studio compiler to use according to this article: Build C/C++ code on the command line

$ cmake -G Ninja ..

Command line display error message as below:

-- NRF_BLE_DRIVER_VERSION not specified, setting it to 0.0.0
-- Architecture not set, using native 32-bit toolchain.
CMake Error at test/CMakeLists.txt:18 (find_package):
  Could not find a package configuration file provided by "Catch2" with any
  of the following names:

    Catch2Config.cmake
    catch2-config.cmake

  Add the installation prefix of "Catch2" to CMAKE_PREFIX_PATH or set
  "Catch2_DIR" to a directory containing one of the above files.  If "Catch2"
  provides a separate development package or SDK, be sure it has been
  installed.

I change CMakeLists.txt in pc-ble-driver-master\test folder.

From

find_package(spdlog CONFIG REQUIRED)

To

if(NOT TARGET spdlog)
    # Stand-alone build
    set(SPDLOG_DIR "C:\\dev\\spdlog")
    find_package(spdlog CONFIG REQUIRED)
endif()

After changed, it still display same error message.

Kindly guide me through the problem.

Thank you.

  • Hi Susheel,

    Thank you for your reply.

    I try to add environment variables in system variables of windows GUI, and add it directly in command line console. In command line, it displays as below:

    D:\Delta\BLE\HCI\pc-ble-driver-master\test>cmake -DBOOST_ROOT=C:\boost\boost_1_68_0 -DBOOST_LIBRARYDIR=C:\boost\boost_1_68_0\stage\lib
    CMake Warning:
      No source or binary directory provided.  Both will be assumed to be the
      same as the current working directory, but note that this warning will
      become a fatal error in future CMake releases.
    
    
    CMake Warning (dev) in CMakeLists.txt:
      No project() command is present.  The top-level CMakeLists.txt file must
      contain a literal, direct call to the project() command.  Add a line of
      code such as
    
        project(ProjectName)
    
      near the top of the file, but after cmake_minimum_required().
    
      CMake is pretending there is a "project(Project)" command on the first
      line.
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.17763.
    CMake Error at CMakeLists.txt:16 (find_package):
      Could not find a package configuration file provided by "spdlog" with any
      of the following names:
    
        spdlogConfig.cmake
        spdlog-config.cmake
    
      Add the installation prefix of "spdlog" to CMAKE_PREFIX_PATH or set
      "spdlog_DIR" to a directory containing one of the above files.  If "spdlog"
      provides a separate development package or SDK, be sure it has been
      installed.

    In CMakeLists.txt file of text folder, the line 16 is find_package(spdlog CONFIG REQUIRED).

    But, above this message, I get there is no source and projectName warning message which project name should I add in CMakeLists.txt?

    Thank you.

  • Hi Ben,
    You need to point to a valid build directory in your command line

    "cmake -DBOOST_ROOT=C:\boost\boost_1_68_0 -DBOOST_LIBRARYDIR=C:\boost\boost_1_68_0\stage\lib " there's no ".." in the end of your command.
    My colleague Håkon Alseth noticed it.
  • Hi Susheel,

    I try to follow below link to install spdlog and set up environment variables:

    https://github.com/gabime/spdlog 

    But, it appears some error for finding makefile.

    C:\dev\spdlog-1.x\build>cmake .. && make -j
    -- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.17763.
    -- Build spdlog: 1.7.0
    -- Build type: Release
    -- Generating example(s)
    -- Generating install
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/dev/spdlog-1.x/build
    make: *** No targets specified and no makefile found.  Stop.

    System environment variables by using windows GUI.

    C:\dev\spdlog-1.x\build & C:\dev\spdlog-1.x in path

    I return the build folder and add ".." end of my command to let it return to upper layer path.

    D:\Delta\BLE\HCI\pc-ble-driver-master\build>cmake -DBOOST_ROOT=C:\boost\boost_1_68_0 -DBOOST_LIBRARYDIR=C:\boost\boost_1_68_0\stage\lib ..
    -- NRF_BLE_DRIVER_VERSION not specified, setting it to 0.0.0
    CMake Warning at C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake:116 (message):
      Unable to determine target architecture, continuing without vcpkg.
    Call Stack (most recent call first):
      build/CMakeFiles/3.18.2/CMakeSystem.cmake:6 (include)
      CMakeLists.txt:25 (project)
    
    
    -- Architecture not set, using native 64-bit toolchain.
    -- Building with build type: .
    CMake Error at C:/dev/spdlog-1.x/build/spdlogConfig.cmake:15 (include):
      include could not find load file:
    
        C:/dev/spdlog-1.x/build/spdlogConfigTargets.cmake
    Call Stack (most recent call first):
      test/CMakeLists.txt:14 (find_package)
    
    
    CMake Error at test/CMakeLists.txt:16 (find_package):
      Could not find a package configuration file provided by "Catch2" with any
      of the following names:
    
        Catch2Config.cmake
        catch2-config.cmake
    
      Add the installation prefix of "Catch2" to CMAKE_PREFIX_PATH or set
      "Catch2_DIR" to a directory containing one of the above files.  If "Catch2"
      provides a separate development package or SDK, be sure it has been
      installed.
    It looks like catch2 can't be found that does mean the previous step of 

    vcpkg install asio catch2 spdlog not working?

    Thank you.
  • I am not so familiar with the spdlog, but it seems like it has some environment variables missing as it cannot find the minimal files it needs to function.

Related