Sysprogs forums › Forums › VisualGDB › cmake not building corretly when used outside of my visualGDB project
- This topic has 4 replies, 2 voices, and was last updated 11 months ago by Nakame.
-
AuthorPosts
-
October 11, 2023 at 08:25 #34814NakameParticipant
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 2i 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.October 11, 2023 at 10:35 #34817supportKeymasterHi,
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.
October 12, 2023 at 00:08 #34825NakameParticipanthello !
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.October 12, 2023 at 08:57 #34831supportKeymasterSorry, 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 🙂
October 12, 2023 at 09:09 #34832NakameParticipantI understand and i kinda saw it comming 🙂
I’ll find a way ! Thank you for trying anyway !
-
AuthorPosts
- You must be logged in to reply to this topic.