Hello,
I’m trying to cross compile a project from my windows machine to an ARM Linux one.
This project already exists, I just set up a CMake structure in order to get the full control of my build system. The compilation steps works quite well, but when I reach the link step, I don’t understand why the command generated by CMake isn’t how I want to.
Here are some technical infos :
1 - I have a FindMyLib1.cmake which set IMPORTED_LOCATION_RELEASE to the relative path of myLib1.a
1 bis - the same for myLib2 (which is also linked to myLib)
2 - In my top CMake, I call find_package(MyLib) which works like a charm (because I can print the path of myLib)
3 - In my project Cmake, I call the target_link_libraries(myProject PRIVATE $<$<C_COMPILER_ID:GNU>:MyLib1>
$<$<C_COMPILER_ID:GNU>:MyLib2>
$<$<C_COMPILER_ID:GNU>:stdc++>)
And I hope that the command would be : >gcc.exe [compiler parameters] @CMakeFiles/MyProject.dir/objects1.rsp -o MyProject.elf -LMyLib1Path -lmyLib1 -LMyLib2Path -lmyLib2 -lstdc++
Instead, the command line generated is : >gcc.exe [compiler parameters @CMakeFiles/MyProject.dir/objects1.rsp -o MyProject.elf MyLib1Path/myLib1.a MyLib2Path/myLib2.a-lstdc++
And this line doesn’t work I have a lot of linking errors for the methods of myLib2 which uses linked method to myLib1
Do you have any suggestion on what I am doing wrong ?
Thank you.