From 60106378d21b020a13d60d3df96c9fc972a023f4 Mon Sep 17 00:00:00 2001 From: Petr Pavlu Date: Mon, 4 Jul 2016 20:11:33 +0100 Subject: [PATCH] Teach the cmake build about ncursesw6-config --- cmake/FindNCURSESW.cmake | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/cmake/FindNCURSESW.cmake b/cmake/FindNCURSESW.cmake index 7b93ac2..dec2f74 100644 --- a/cmake/FindNCURSESW.cmake +++ b/cmake/FindNCURSESW.cmake @@ -1,18 +1,19 @@ -# Find ncursesw using ncursesw5-config. Set _FOUND, -# _CFLAGS and _LDFLAGS in -# the same way pkg_check_modules() does. +# Find ncursesw using ncursesw6-config or ncursesw5-config. Set +# _FOUND, _CFLAGS and +# _LDFLAGS in the same way pkg_check_modules() does. if(${CMAKE_FIND_PACKAGE_NAME}_CFLAGS OR ${CMAKE_FIND_PACKAGE_NAME}_LDFLAGS) # Use externally set variables. set(${CMAKE_FIND_PACKAGE_NAME}_LIBRARY true) else() - # Try to use ncursesw5-config to obtain correct flags. - find_program(NCURSESW5_CONFIG_EXECUTABLE ncursesw5-config) - if(NCURSESW5_CONFIG_EXECUTABLE) - execute_process(COMMAND ${NCURSESW5_CONFIG_EXECUTABLE} --cflags + # Try to use ncursesw6-config or ncursesw5-config to obtain correct flags. + find_program(NCURSESW_CONFIG_EXECUTABLE + NAMES ncursesw6-config ncursesw5-config) + if(NCURSESW_CONFIG_EXECUTABLE) + execute_process(COMMAND ${NCURSESW_CONFIG_EXECUTABLE} --cflags OUTPUT_VARIABLE ${CMAKE_FIND_PACKAGE_NAME}_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND ${NCURSESW5_CONFIG_EXECUTABLE} --libs + execute_process(COMMAND ${NCURSESW_CONFIG_EXECUTABLE} --libs OUTPUT_VARIABLE ${CMAKE_FIND_PACKAGE_NAME}_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) set(${CMAKE_FIND_PACKAGE_NAME}_LIBRARY true) @@ -24,4 +25,4 @@ include(FindPackageHandleStandardArgs) find_package_handle_standard_args(${CMAKE_FIND_PACKAGE_NAME} REQUIRED_VARS ${CMAKE_FIND_PACKAGE_NAME}_LIBRARY) -mark_as_advanced(NCURSESW5_CONFIG_EXECUTABLE) +mark_as_advanced(NCURSESW_CONFIG_EXECUTABLE) -- 2.11.4.GIT