Browse Source

Try harder to find ncursesw

Přemysl Janouch 2 years ago
parent
commit
c04ab011d1
3 changed files with 27 additions and 5 deletions
  1. 9
    4
      CMakeLists.txt
  2. 17
    0
      cmake/FindNcursesw.cmake
  3. 1
    1
      termo

+ 9
- 4
CMakeLists.txt View File

@@ -17,10 +17,14 @@ set (project_VERSION "${project_VERSION_MAJOR}")
17 17
 set (project_VERSION "${project_VERSION}.${project_VERSION_MINOR}")
18 18
 set (project_VERSION "${project_VERSION}.${project_VERSION_PATCH}")
19 19
 
20
+# For custom modules
21
+set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
22
+
20 23
 # Dependencies
21 24
 find_package (ZLIB REQUIRED)
25
+find_package (Ncursesw REQUIRED)
22 26
 find_package (PkgConfig REQUIRED)
23
-pkg_check_modules (dependencies REQUIRED ncursesw glib-2.0 gio-2.0 pango)
27
+pkg_check_modules (dependencies REQUIRED glib-2.0 gio-2.0 pango)
24 28
 
25 29
 pkg_check_modules (icu icu-uc icu-i18n)
26 30
 if (NOT icu_FOUND)
@@ -85,11 +89,12 @@ endif (WITH_GTK)
85 89
 
86 90
 link_directories (${dependencies_LIBRARY_DIRS})
87 91
 include_directories (${ZLIB_INCLUDE_DIRS} ${icu_INCLUDE_DIRS}
88
-	${dependencies_INCLUDE_DIRS} ${Termo_INCLUDE_DIRS})
92
+	${dependencies_INCLUDE_DIRS} ${NCURSESW_INCLUDE_DIRS}
93
+	${Termo_INCLUDE_DIRS})
89 94
 
90 95
 # Configuration
91 96
 include (CheckFunctionExists)
92
-set (CMAKE_REQUIRED_LIBRARIES ${dependencies_LIBRARIES})
97
+set (CMAKE_REQUIRED_LIBRARIES ${NCURSESW_LIBRARIES})
93 98
 CHECK_FUNCTION_EXISTS ("resizeterm" HAVE_RESIZETERM)
94 99
 
95 100
 # Localization
@@ -140,7 +145,7 @@ set (project_common_headers
140 145
 
141 146
 # Project libraries
142 147
 set (project_common_libraries ${ZLIB_LIBRARIES} ${icu_LIBRARIES}
143
-	${dependencies_LIBRARIES} termo-static)
148
+	${dependencies_LIBRARIES} ${NCURSESW_LIBRARIES} termo-static)
144 149
 
145 150
 # Create a common project library so that source files are only compiled once
146 151
 if (${CMAKE_VERSION} VERSION_GREATER "2.8.7")

+ 17
- 0
cmake/FindNcursesw.cmake View File

@@ -0,0 +1,17 @@
1
+# Public Domain
2
+
3
+find_package (PkgConfig REQUIRED)
4
+pkg_check_modules (NCURSESW QUIET ncursesw)
5
+
6
+# OpenBSD doesn't provide a pkg-config file
7
+set (required_vars NCURSESW_LIBRARIES)
8
+if (NOT NCURSESW_FOUND)
9
+	find_library (NCURSESW_LIBRARIES NAMES ncursesw)
10
+	find_path (NCURSESW_INCLUDE_DIRS ncurses.h)
11
+	list (APPEND required_vars NCURSESW_INCLUDE_DIRS)
12
+endif (NOT NCURSESW_FOUND)
13
+
14
+include (FindPackageHandleStandardArgs)
15
+FIND_PACKAGE_HANDLE_STANDARD_ARGS (NCURSESW DEFAULT_MSG ${required_vars})
16
+
17
+mark_as_advanced (NCURSESW_LIBRARIES NCURSESW_INCLUDE_DIRS)

+ 1
- 1
termo

@@ -1 +1 @@
1
-Subproject commit 0b5d8ecd0d4119f7fa3e1ef8bc060c6c7124de14
1
+Subproject commit 783b744e8baeb606dd8925547ec0318df3c75237

Loading…
Cancel
Save