Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg-config support #782

Merged
merged 8 commits into from Sep 16, 2016
6 changes: 6 additions & 0 deletions CMakeLists.txt
Expand Up @@ -506,6 +506,9 @@ if (PKG_CONFIG_FOUND)

set(MLPACK_INCLUDE_DIRS_STRING "${MLPACK_INCLUDE_DIRS_STRING} -I${incldir}")
endforeach ()
# Add the install directory too.
set(MLPACK_INCLUDE_DIRS_STRING
"${MLPACK_INCLUDE_DIRS_STRING} -I${CMAKE_INSTALL_PREFIX}/include/")

# Create the list of link directories.
foreach (linkdir ${MLPACK_LIBRARY_DIRS})
Expand All @@ -520,6 +523,9 @@ if (PKG_CONFIG_FOUND)
set(MLPACK_LIBRARIES_STRING "${MLPACK_LIBRARIES_STRING} -l${lib}")
endif ()
endforeach ()
# Don't forget to add mlpack as a dependency too.
set(MLPACK_LIBRARIES_STRING
"${MLPACK_LIBRARIES_STRING} -L${CMAKE_INSTALL_PREFIX}/lib/ -lmlpack")

# Do first stage of configuration.
set(MLPACK_VERSION_STRING "@MLPACK_VERSION_STRING@")
Expand Down