I'm new to cmake.
I've installed gsl library with conda.
I first used find_package(gsl REQUIRED)
but
cmake didn't find neither "Findgsl.cmake" nor "gslConfig.cmake".
So I tried to use find_library()
and find_path()
:
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
set(CMAKE_CXX_STANDARD 11)
project(projTEST)
find_library(GSL_LIBRARY gsl "/home/albator/miniconda3/envs/test/lib/" REQUIRED)
find_path(GSL_INCLUDE_DIR gsl "/home/albator/miniconda3/envs/test/include/")
message(STATUS "gsl include dirs: " ${GSL_INCLUDE_DIR})
message(STATUS "gsl lib dirs: " ${GSL_LIBRARY})
set(SRCS
main.cpp)
set(HDRS
)
add_executable(test ${SRCS} ${HDRS} )
set_target_properties(test PROPERTIES LINKER_LANGUAGE CXX )
target_link_libraries(test ${GSL_LIBRARY})
target_include_directories(test PRIVATE ${GSL_INCLUDE_DIR})
install(TARGETS test
RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}
ARCHIVE DESTINATION ${CMAKE_SOURCE_DIR}
)
but when I compile #include <gsl/gsl_sf_bessel.h>
is not found...
Could someone tell me what I'm doing wrong ?