I installed the library bcm2835
on my pc. To compile a program in c I must type:
gcc -o my_program my_program.c -l rt -l bcm2835
Now I must compile another program that use the same libraries with cmake
. I have never used this.
What must I add to the bottom of "cmakelists.txt"?
I have tried:
TARGET_LINK_LIBRARIES(my_program rt)
TARGET_LINK_LIBRARIES(my_program bcm2835)
but that doesn't work.
Here and here and here are some examples and since CMake has good documentation you should read more about the commands here.
And cmakelists.txt files should be named CMakeLists.txt