summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKurt Sansom <kayarre@gmail.com>2020-07-16 17:48:41 (GMT)
committerKurt Sansom <kayarre@gmail.com>2020-07-16 19:16:24 (GMT)
commitfa7157b86ddcfe675c5f8a6750bcbd6095737465 (patch)
tree26de1e1f4d4d8a786ab5e2fb85371e173813c031
parentc7b7547d8da6b9a4225d111440d0cf6c2f55914d (diff)
downloadCMake-fa7157b86ddcfe675c5f8a6750bcbd6095737465.zip
CMake-fa7157b86ddcfe675c5f8a6750bcbd6095737465.tar.gz
CMake-fa7157b86ddcfe675c5f8a6750bcbd6095737465.tar.bz2
FindX11: Add Xaw libraries
Fixes: #20963
-rw-r--r--Modules/FindX11.cmake19
-rw-r--r--Tests/FindX11/Test/CMakeLists.txt2
-rw-r--r--Tests/FindX11/Test/main.c21
3 files changed, 42 insertions, 0 deletions
diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake
index aa83575..958a22e 100644
--- a/Modules/FindX11.cmake
+++ b/Modules/FindX11.cmake
@@ -59,6 +59,7 @@ and also the following more fine grained variables and targets:
X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND
X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND
X11_XSync_INCLUDE_PATH, (in X11_Xext_LIB), X11_XSync_FOUND
+ X11_Xaw_INCLUDE_PATH, X11_Xaw_LIB X11_Xaw_FOUND X11::Xaw
#]=======================================================================]
if (UNIX)
@@ -100,6 +101,7 @@ if (UNIX)
find_path(X11_Xaccessrules_INCLUDE_PATH X11/extensions/XKBrules.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xaccessstr_INCLUDE_PATH X11/extensions/XKBstr.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xau_INCLUDE_PATH X11/Xauth.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xaw_INCLUDE_PATH X11/Xaw/Intrinsic.h ${X11_INC_SEARCH_PATH})
find_path(X11_xcb_INCLUDE_PATH xcb/xcb.h ${X11_INC_SEARCH_PATH})
find_path(X11_X11_xcb_INCLUDE_PATH X11/Xlib-xcb.h ${X11_INC_SEARCH_PATH})
find_path(X11_xcb_icccm_INCLUDE_PATH xcb/xcb_icccm.h ${X11_INC_SEARCH_PATH})
@@ -134,6 +136,8 @@ if (UNIX)
find_path(X11_Xv_INCLUDE_PATH X11/extensions/Xvlib.h ${X11_INC_SEARCH_PATH})
find_path(X11_XSync_INCLUDE_PATH X11/extensions/sync.h ${X11_INC_SEARCH_PATH})
+
+
# Backwards compatibility.
set(X11_Xinput_INCLUDE_PATH "${X11_Xi_INCLUDE_PATH}")
set(X11_xf86misc_INCLUDE_PATH "${X11_Xxf86misc_INCLUDE_PATH}")
@@ -148,6 +152,7 @@ if (UNIX)
find_library(X11_ICE_LIB ICE ${X11_LIB_SEARCH_PATH})
find_library(X11_SM_LIB SM ${X11_LIB_SEARCH_PATH})
find_library(X11_Xau_LIB Xau ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xaw_LIB Xaw ${X11_LIB_SEARCH_PATH})
find_library(X11_xcb_LIB xcb ${X11_LIB_SEARCH_PATH})
find_library(X11_X11_xcb_LIB X11-xcb ${X11_LIB_SEARCH_PATH})
find_library(X11_xcb_icccm_LIB xcb-icccm ${X11_LIB_SEARCH_PATH})
@@ -392,6 +397,10 @@ if (UNIX)
set(X11_SM_FOUND TRUE)
endif()
+ if(X11_Xaw_LIB AND X11_Xaw_INCLUDE_PATH)
+ set(X11_Xaw_FOUND TRUE)
+ endif()
+
# Most of the X11 headers will be in the same directories, avoid
# creating a huge list of duplicates.
if (X11_INCLUDE_DIR)
@@ -519,6 +528,14 @@ if (UNIX)
INTERFACE_INCLUDE_DIRECTORIES "${X11_Xau_INCLUDE_PATH}")
endif ()
+ if (X11_Xaw_FOUND AND NOT TARGET X11::Xaw)
+ add_library(X11::Xaw UNKNOWN IMPORTED)
+ set_target_properties(X11::Xaw PROPERTIES
+ IMPORTED_LOCATION "${X11_Xaw_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xaw_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::Xext;X11::Xmu;X11::Xt;X11::Xpm;X11::X11")
+ endif ()
+
if (X11_xcb_FOUND AND NOT TARGET X11::xcb)
add_library(X11::xcb UNKNOWN IMPORTED)
set_target_properties(X11::xcb PROPERTIES
@@ -817,6 +834,8 @@ if (UNIX)
X11_SM_LIB
X11_SM_INCLUDE_PATH
X11_XSync_INCLUDE_PATH
+ X11_Xaw_LIB
+ X11_Xaw_INCLUDE_PATH
)
set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE})
set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
diff --git a/Tests/FindX11/Test/CMakeLists.txt b/Tests/FindX11/Test/CMakeLists.txt
index b2adfb2..7325b32 100644
--- a/Tests/FindX11/Test/CMakeLists.txt
+++ b/Tests/FindX11/Test/CMakeLists.txt
@@ -29,6 +29,7 @@ test_x11_component(x11_components SM)
set(X11_X11_FOUND ${X11_FOUND})
test_x11_component(x11_components X11)
test_x11_component(x11_components Xau)
+test_x11_component(x11_components Xaw)
test_x11_component(x11_components xcb)
test_x11_component(x11_components X11_xcb)
test_x11_component(x11_components xcb_icccm)
@@ -67,6 +68,7 @@ target_link_libraries(test_var PRIVATE ${X11_LIBRARIES})
# Not included in X11_LIBRARIES.
foreach(lib
Xau
+ Xaw
xcb
X11_xcb
xcb_icccm
diff --git a/Tests/FindX11/Test/main.c b/Tests/FindX11/Test/main.c
index c8144e0..f8c723c 100644
--- a/Tests/FindX11/Test/main.c
+++ b/Tests/FindX11/Test/main.c
@@ -308,6 +308,24 @@ static int test_Xv(void)
}
#endif
+#ifdef HAVE_X11_Xaw
+# include <X11/Intrinsic.h>
+# include <X11/Xaw/Box.h>
+
+static void test_Xaw(void)
+{
+ XrmOptionDescRec opt_table[] = { { NULL } };
+
+ Widget toplevel;
+ toplevel =
+ XtInitialize("test", "test", opt_table, XtNumber(opt_table), NULL, NULL);
+ Widget box =
+ XtCreateManagedWidget("testbox", boxWidgetClass, toplevel, NULL, 0);
+ return;
+}
+
+#endif
+
#include <stddef.h>
int main(int argc, char* argv[])
@@ -392,6 +410,9 @@ int main(int argc, char* argv[])
#ifdef HAVE_X11_Xv
test_Xv,
#endif
+#ifdef HAVE_X11_Xaw
+ test_Xaw,
+#endif
NULL,
};