Commit 7b651d13 authored by Thomas Fetzer's avatar Thomas Fetzer
Browse files

[cmake] Automatically find external libraries in the external folder

parent b1098ceb
......@@ -14,7 +14,9 @@
# look for header files, only at positions given by the user
find_path(GLPK_INCLUDE_DIR
NAMES glpk.h
PATHS ${GLPK_PREFIX} ${GLPK_ROOT}
PATHS ${GLPK_PREFIX}
${GLPK_ROOT}
"${CMAKE_SOURCE_DIR}/../external/glpk"
PATH_SUFFIXES "glpk" "include/glpk" "include" "SRC" "src"
NO_DEFAULT_PATH
)
......@@ -28,8 +30,10 @@ find_path(GLPK_INCLUDE_DIR
# look for library, only at positions given by the user
find_library(GLPK_LIBRARY
NAMES "glpk"
PATHS ${GLPK_PREFIX} ${GLPK_ROOT} ${GLPK_ROOT}/src/ ${GLPK_ROOT}/src/.libs/
PATH_SUFFIXES "lib" "lib32" "lib64" "libglpk"
PATHS ${GLPK_PREFIX}
${GLPK_ROOT}
"${CMAKE_SOURCE_DIR}/../external/glpk"
PATH_SUFFIXES "lib" "lib32" "lib64" "libglpk" "src" "src/.libs"
NO_DEFAULT_PATH
)
......
......@@ -14,7 +14,9 @@
# look for header files, only at positions given by the user
find_path(NLOPT_INCLUDE_DIR
NAMES nlopt.h
PATHS ${NLOPT_PREFIX} ${NLOPT_ROOT}
PATHS ${NLOPT_PREFIX}
${NLOPT_ROOT}
"${CMAKE_SOURCE_DIR}/../external/nlopt"
PATH_SUFFIXES "nlopt" "include/nlopt" "include" "SRC" "src" "api"
NO_DEFAULT_PATH
)
......@@ -28,8 +30,11 @@ find_path(NLOPT_INCLUDE_DIR
# look for library, only at positions given by the user
find_library(NLOPT_LIBRARY
NAMES "nlopt"
PATHS ${NLOPT_PREFIX} ${NLOPT_ROOT} ${NLOPT_ROOT}/.libs/
PATH_SUFFIXES "lib" "lib32" "lib64" "libnlopt"
PATHS ${NLOPT_PREFIX}
${NLOPT_ROOT}
${NLOPT_ROOT}
"${CMAKE_SOURCE_DIR}/../external/nlopt"
PATH_SUFFIXES "lib" "lib32" "lib64" "libnlopt" ".libs"
NO_DEFAULT_PATH
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment