Closed guzhaoyuan closed 4 years ago
I am able to load the built library with the help of this issue.
I changed my CMakeList.txt to use
LIST(APPEND CMAKE_MODULE_PATH /usr/local/lib/cmake/xlnt) # I have put Findxlnt.cmake in this folder
find_package(xlnt MODULE)
,
and in the build section,
add_executable(read_xlsx src/read_xlsx.cpp) target_link_libraries(read_xlsx xlnt::xlnt)
.
This works for me.
I have installed from source using cmake + make on ubuntu 18.04. After building the src and
sudo make install
, xlnt seems to be installed correctly. However, when I try to use the installed library from CMakeLists.txt, where I try to find the xlnt usingfind_package(Xlnt REQUIRED)
, cmake cannot set variables correctly. My question is, what is the right way to include the installed library into my project. Are there any examples that I could look into?