When I used GTest library on CMake, I could use GTEST_ROOT
for finding root path of GTest. However, I cannot use CURL_ROOT
to use curl, because FindCURL.cmake doesn't get the variable.
How can I do?
When I used GTest library on CMake, I could use GTEST_ROOT
for finding root path of GTest. However, I cannot use CURL_ROOT
to use curl, because FindCURL.cmake doesn't get the variable.
How can I do?
Use CMAKE_PREFIX_PATH
variable. Also you may use semicolon(;
) with multiple paths.
On script:
set (CMAKE_PREFIX_PATH C:/Libraries/gtest;C:/Libraries/curl)
find_package (GTest REQUIRED)
include_directories (${GTEST_INCLUDE_DIRS})
find_package (CURL REQUIRED)
include_directories (${CURL_INCLUDE_DIRS})
On console:
cmake .. -DCMAKE_PREFIX_PATH=C:/Libraries/gtest;C:/Libraries/curl