If you are dealing with find_library
find_library(LIBRARY_NAME PATHS "/usr/lib/x86_64-linux-gnu" NO_DEFAULT_PATH) where
PATHS denotes the exact path to libsNO_DEFAULT_PATH means cmake will not search elsewhere
check lib values ββand include paths with message(status, ${LIBRARY_NAME})
If you are dealing with find_package :
This is a little more complicated than the previous example, but it is essentially the same.
For each package, you need to run find_package for:
- Create a file called
Find<Packagename>.cmake , e. If you are looking for cppunit, you need to create FindCPPUNIT.cmake . In this file, you will need to run find_path to include the include and find_library files in the lib files, for example, in the section "If you are dealing with find_library ".
find_path (CPPUNIT_INCLUDE_DIR PATHS) / usr / include / x86_64-linux-gnu "NO_DEFAULT_PATH)
find_library (CPPUNIT_LIBRARY PATHS) / usr / lib / x86_64-linux-gnu "NO_DEFAULT_PATH)
And then you should add the file path to CMAKE_MODULE_PATH.
Asalle
source share