diff options
author | MichaĆ Orynicz <michal.orynicz@tieto.com> | 2014-04-28 15:52:15 +0200 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-05-01 12:12:12 +0000 |
commit | fbd3c937989c7622815d3019538ca4b7d5a58e27 (patch) | |
tree | 54e1aa580eda2cfab6532600a187f2326ef1e9e1 /CMakeLists.txt | |
parent | 2f960b70982f7852f816141ed6bb3b50536081a5 (diff) |
Fix procedure of finding packages
Before this change the code using make package was just showing
a string ${PACKAGE_VAR}_FOUND instead of showing if the
${PACKAGE_VAR}_FOUND variable was set true by find_package function.
Now the user will be informed about which packages were not found
and an error will be raised, as packages sought are the ones that
are selected for the build.
This change also ads fixes to some improper PACKAGE_VAR
variables that prevented find_package from finding
proper packages.
Change-Id: Ic20bc50ace65bab385059a7430909f95367520a3
Reviewed-on: https://code.wireshark.org/review/1410
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 659cfd5952..e50de6abd0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -425,6 +425,7 @@ endif() #The minimum package list set(PACKAGELIST Gettext GLIB2 GMODULE2 GTHREAD2 M LEX YACC Perl SED SH PythonInterp) +set(GLIB2_REQUIRED) set(GLIB2_FIND_REQUIRED) set(GLIB2_MIN_VERSION 2.14.0) set(GTHREAD2_REQUIRED) @@ -561,9 +562,15 @@ foreach(PACKAGE ${PACKAGELIST}) if(${PACKAGE} STREQUAL "Qt4") set(PACKAGE_VAR "QT") elseif(${PACKAGE} STREQUAL "PythonInterp") - set(PACKAGE_VAR "PYTHON") + set(PACKAGE_VAR "PYTHONINTERP") elseif(${PACKAGE} STREQUAL "PythonLibs") - set(PACKAGE_VAR "PYTHON") + set(PACKAGE_VAR "PYTHONLIBS") + elseif(${PACKAGE} STREQUAL "Gettext") + set(PACKAGE_VAR "GETTEXT") + elseif(${PACKAGE} STREQUAL "HtmlViewer") + set(PACKAGE_VAR "HTMLVIEWER") + elseif(${PACKAGE} STREQUAL "Perl") + set(PACKAGE_VAR "PERL") else() set(PACKAGE_VAR ${PACKAGE}) endif() @@ -574,8 +581,8 @@ foreach(PACKAGE ${PACKAGELIST}) else() find_package(${PACKAGE}) endif() - message(${PACKAGE_VAR}_FOUND) if (${PACKAGE_VAR}_FOUND) + message("${PACKAGE_VAR} FOUND") set(HAVE_LIB${PACKAGE_VAR} 1) include_directories(${${PACKAGE_VAR}_INCLUDE_DIRS}) set(WS_ALL_LIBS ${WS_ALL_LIBS} ${${PACKAGE_VAR}_LIBRARIES}) @@ -587,6 +594,8 @@ foreach(PACKAGE ${PACKAGELIST}) if (${PACKAGE_VAR}_EXECUTABLE) message(STATUS "${PACKAGE} executable: ${${PACKAGE_VAR}_EXECUTABLE}") endif() + else() + message(SEND_ERROR "${PACKAGE_VAR} NOT FOUND") endif() endforeach() |