The traditional way of finding libraries is to use find_package. It is often necessary to provide a FindLIBNAME. For LAPACK, CMake already ships with one. For atlas you will have to provide one yourself.
You use them like this:
find_package(LAPACK)
if(LAPACK_FOUND)
target_compile_options(my_exe_target ${LAPACK_LINKER_FLAGS})
target_link_library(my_exe_target ${LAPACK_LIBRARIES})
else()
# panick
endif()
Usually find_package would also export the include directory, but this doesn't seem to be the case for FindLAPACK
, which is really strange. You might want to provide a version that doesn't suck, like this one.