cmake not building corretly when used outside of my visualGDB project

Sysprogs forums Forums VisualGDB cmake not building corretly when used outside of my visualGDB project

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #34814
    Nakame
    Participant

    Hello !

    First of all i will admit that i am not very knowledgable on how cmake work so i apologise if this is a stupid problem …

     

    I have 2 visualGDB projects that compile on my windows machine and send the binary on the target machine ( rasperry pi ) . One is a static library and the other is an application for testing said library using google test. When i compile from visual studio everything work as expected.

    However now i need to build it from cmake directly on the target machine ( to setup automatic testing ).  To do that i use the command : cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/

    no errors so far, but when i try to follow it with “make”, i get the output :

    [ 12%] Building CXX object googletest/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
    [ 16%] Linking CXX static library ../../lib/libgtest_main.a
    [ 16%] Built target gtest_main
    make[2]: *** No rule to make target ‘..//CMakeFiles/Serlib.dir/depend’. Stop.
    make[1]: *** [CMakeFiles/Makefile2:296: ../CMakeFiles/Serlib.dir/all] Error 2
    make: *** [Makefile:130: all] Error 2

    i have joined the cmake file from both the Serlib ( the library ) project and the SerlibUnitTest project. Thank you in advance for the precious help you provide

     

    VisualGDB has been an awesome piece of software and i love it !

    Attachments:
    You must be logged in to view attached files.
    #34817
    support
    Keymaster

    Hi,

    The easiest way to get it working would be to use exactly the same CMake command line that is used by VisualGDB. You can export it into a batch file (together with the relevant environment) as shown here.

    #34825
    Nakame
    Participant

    hello !

    Thanks for your response ! Unfortunatly after i exported the command line it is rather obvious that it will not work for building directly on the target machine ( it use the toolchain to build ). I will start following some cmake tutorials to try and understand what is going wrong but as of now i am at a loss.

    I joined the batch file to this post so you can have a look. If you have a quick fix i would be very grateful, otherwise i guess i got to learn to use cmake xD .

     

    anyway thank you for taking the time to help !

    Attachments:
    You must be logged in to view attached files.
    #34831
    support
    Keymaster

    Sorry, there is no quick fix. If you would like to port a CMake-based project to run outside VisualGDB, you will have to learn CMake. If you do not wish to do it, just keep using VisualGDB so that it will handle it for you 🙂

    #34832
    Nakame
    Participant

    I understand and i kinda saw it comming 🙂

     

    I’ll find a way ! Thank you for trying anyway !

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.