From c04ab011d1b87b98c78ccb39b8b1568a8baf2469 Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Thu, 14 Jan 2016 20:32:04 +0100
Subject: Try harder to find ncursesw
---
CMakeLists.txt | 13 +++++++++----
cmake/FindNcursesw.cmake | 17 +++++++++++++++++
termo | 2 +-
3 files changed, 27 insertions(+), 5 deletions(-)
create mode 100644 cmake/FindNcursesw.cmake
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 48e1df5..47ed206 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,10 +17,14 @@ set (project_VERSION "${project_VERSION_MAJOR}")
set (project_VERSION "${project_VERSION}.${project_VERSION_MINOR}")
set (project_VERSION "${project_VERSION}.${project_VERSION_PATCH}")
+# For custom modules
+set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
+
# Dependencies
find_package (ZLIB REQUIRED)
+find_package (Ncursesw REQUIRED)
find_package (PkgConfig REQUIRED)
-pkg_check_modules (dependencies REQUIRED ncursesw glib-2.0 gio-2.0 pango)
+pkg_check_modules (dependencies REQUIRED glib-2.0 gio-2.0 pango)
pkg_check_modules (icu icu-uc icu-i18n)
if (NOT icu_FOUND)
@@ -85,11 +89,12 @@ endif (WITH_GTK)
link_directories (${dependencies_LIBRARY_DIRS})
include_directories (${ZLIB_INCLUDE_DIRS} ${icu_INCLUDE_DIRS}
- ${dependencies_INCLUDE_DIRS} ${Termo_INCLUDE_DIRS})
+ ${dependencies_INCLUDE_DIRS} ${NCURSESW_INCLUDE_DIRS}
+ ${Termo_INCLUDE_DIRS})
# Configuration
include (CheckFunctionExists)
-set (CMAKE_REQUIRED_LIBRARIES ${dependencies_LIBRARIES})
+set (CMAKE_REQUIRED_LIBRARIES ${NCURSESW_LIBRARIES})
CHECK_FUNCTION_EXISTS ("resizeterm" HAVE_RESIZETERM)
# Localization
@@ -140,7 +145,7 @@ set (project_common_headers
# Project libraries
set (project_common_libraries ${ZLIB_LIBRARIES} ${icu_LIBRARIES}
- ${dependencies_LIBRARIES} termo-static)
+ ${dependencies_LIBRARIES} ${NCURSESW_LIBRARIES} termo-static)
# Create a common project library so that source files are only compiled once
if (${CMAKE_VERSION} VERSION_GREATER "2.8.7")
diff --git a/cmake/FindNcursesw.cmake b/cmake/FindNcursesw.cmake
new file mode 100644
index 0000000..88c1d01
--- /dev/null
+++ b/cmake/FindNcursesw.cmake
@@ -0,0 +1,17 @@
+# Public Domain
+
+find_package (PkgConfig REQUIRED)
+pkg_check_modules (NCURSESW QUIET ncursesw)
+
+# OpenBSD doesn't provide a pkg-config file
+set (required_vars NCURSESW_LIBRARIES)
+if (NOT NCURSESW_FOUND)
+ find_library (NCURSESW_LIBRARIES NAMES ncursesw)
+ find_path (NCURSESW_INCLUDE_DIRS ncurses.h)
+ list (APPEND required_vars NCURSESW_INCLUDE_DIRS)
+endif (NOT NCURSESW_FOUND)
+
+include (FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS (NCURSESW DEFAULT_MSG ${required_vars})
+
+mark_as_advanced (NCURSESW_LIBRARIES NCURSESW_INCLUDE_DIRS)
diff --git a/termo b/termo
index 0b5d8ec..783b744 160000
--- a/termo
+++ b/termo
@@ -1 +1 @@
-Subproject commit 0b5d8ecd0d4119f7fa3e1ef8bc060c6c7124de14
+Subproject commit 783b744e8baeb606dd8925547ec0318df3c75237
--
cgit v1.2.3-70-g09d2