I have a simple problem with the linking of libraries with CMake (I don't know CMake very well). My configuration is the following :
project/src/CMakeLists.txt (with all .cpp and .h files)
project/support/linux/gmp/include/gmp.h
project/support/linux/gmp/include/gmpxx.h
project/support/linux/gmp/include/libgmp.a
project/support/linux/gmp/include/libgmpxx.a
How to include the library gmp in the process of compilation ? (I am lost between FIND_PACKAGE, INCLUDE_DIRECTORIES, TARGET_LINK_LIBRARIES, ADD_LIBRARY ... commands)
Thank you very much.
CMake is not so hard to understand.
First Step
Use find_package to locate the libary.
Second step
Use include_directories to include the libary header files.
Third Step
Use target_link_libraries to link your binary against the libary.