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

Issues building nRF52 bluetooth mesh light switch example with CMake for Eclipse on windows.

I have issue while building the nrf5 bluetooth mesh light switch example using CMake on windows for Eclipse. I have run the following cmake command:

cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug -D_ECLIPSE_VERSION=4.5.2 ../ but it gives the error

g -D_ECLIPSE_VERSION=4.5.2 ../
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Found Eclipse version 4.5.2 ()
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/MinGW/bin/c++.exe
-- Check for working CXX compiler: C:/MinGW/bin/c++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:32 (set_target_link_options):
Unknown CMake command "set_target_link_options".


-- Configuring incomplete, errors occurred!
See also "D:/Developer/Raykor/nordic_mesh/nrf5_SDK_for_Mesh_v1.0.1_src/examples/
light_switch/client/build/CMakeFiles/CMakeOutput.log".
See also "D:/Developer/Raykor/nordic_mesh/nrf5_SDK_for_Mesh_v1.0.1_src/examples/
light_switch/client/build/CMakeFiles/CMakeError.log".

I am new to build project using cmake and i am not able find any reference about "set_target_link_options".

  • Hi,

    Looks like you're missing the parameter "-DTOOLCHAIN=gccarmemb":
    $ cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug -D_ECLIPSE_VERSION=4.5.2 -DTOOLCHAIN=gccarmemb ..

    This passed cmake generation at my end.

    Note that this relies on arm-none-eabi-* being in your $PATH, as described in the build directions for windows:  http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v1.0.1/md_doc_getting_started_how_to_windows_tools.html

    Cheers,

    Håkon

  • Is there need of install MinGW? Because I have installed MinGW it generates executable for c compiler but not for c++ compiler. So how to generate executable for c++ compiler?

    The following command

    cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug -D_ECLIPSE_VERSION=4.5.2 -DTOOLCHAIN=gccarmemb .. still generate the same error.

    -- The C compiler identification is GNU 6.3.0
    -- The CXX compiler identification is GNU 6.3.0
    -- Found Eclipse version 4.5.2 ()
    -- Check for working C compiler: C:/MinGW/bin/gcc.exe
    -- Check for working C compiler: C:/MinGW/bin/gcc.exe -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: C:/MinGW/bin/c++.exe
    -- Check for working CXX compiler: C:/MinGW/bin/c++.exe -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    CMake Error at CMakeLists.txt:32 (set_target_link_options):
    Unknown CMake command "set_target_link_options".


    CMake Warning (dev) in CMakeLists.txt:
    No cmake_minimum_required command is present. A line of code such as

    cmake_minimum_required(VERSION 3.9)

    should be added at the top of the file. The version specified may be lower
    if you wish to support older CMake versions for this project. For more
    information run "cmake --help-policy CMP0000".
    This warning is for project developers. Use -Wno-dev to suppress it.

    -- Configuring incomplete, errors occurred!
    See also "C:/Users/Pooja/Downloads/nrf5_SDK_for_Mesh_v1.0.1_src/examples/light_s
    witch/client/build/CMakeFiles/CMakeOutput.log".
    See also "C:/Users/Pooja/Downloads/nrf5_SDK_for_Mesh_v1.0.1_src/examples/light_s
    witch/client/build/CMakeFiles/CMakeError.log".

Related