I would like to use vcpkg to manage my packages. I would also like to use CMake to manage my builds. Is it possible to include quantlib library without resorting to hard coded links? Something like find_package(quantlib)?
EDIT: Things I've tried to far (disclaimer - I'm new to this. It feels like I'm groping in the dark. This section makes my ignorance a little too transparent) First, this is a clean build and I do not have backward comparability constraints. My aim is to create something that I can use between my Linux and Windows environments. I am using VSCode to edit my code and CMake. My reference here was the Boost library. The way I used that, successfully (and header only at this point), was
find_package(Boost ${BOOST_VERSION} REQUIRED)
if (Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
else()
MESSAGE("BOOST not found")
endif()
To date I am making progress with something along the following lines (I'm not 100% sure this works yet but I believe I will get it over the line):
set(QUANTLIB_DIR "E:/SD/Programming/C++/vcpkg/installed/x64-windows"
CACHE PATH "The path to the quantlib directory")
include_directories(${QUANTLIB_DIR})
add_library(quantlib STATIC IMPORTED)
set_target_properties(quantlib PROPERTIES IMPORTED_LOCATION ${QUANTLIB_DIR}/lib/QuantLib-vc141-x64-mt.lib)
add_library(quantlibDebug STATIC IMPORTED)
set_target_properties(quantlibDebug PROPERTIES IMPORTED_LOCATION ${QUANTLIB_DIR}/debug/lib/QuantLib-vc141-x64-mt-gd.lib)
If this is the way I need to proceed (system dependent, build dependent) I will need to have sections like this for each different environments. I was hoping that using a package manager with CMake would allow me to use system agnostic variables in my build. Am I naive?