[CMake] [PATCH] Proposed fix for the FindX11.cmake triplication annoyance

Alan W. Irwin irwin at beluga.phys.uvic.ca
Fri Aug 3 15:29:29 EDT 2007


On 2007-08-03 10:27-0700 Alan W. Irwin wrote:

> I would appreciate comment from the X experts here about whether the
> proposed simplification would break any X platform that exists today. The
> attached patch should serve as a concrete basis for discussion of such
> simplification, and I have verified it gives correct results (with no
> triplication) at least on my platforms.

OOPS, I forgot to attach the patch.  Here it is... Alan
-------------- next part --------------
--- FindX11.cmake_original	2007-08-03 09:51:58.000000000 -0700
+++ FindX11.cmake	2007-08-03 09:56:54.000000000 -0700
@@ -27,24 +27,10 @@
     /usr/lib 
   )
 
-  FIND_PATH(X11_X11_INCLUDE_PATH X11/X.h ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xlib_INCLUDE_PATH X11/Xlib.h ${X11_INC_SEARCH_PATH})
-  FIND_PATH(X11_Xutil_INCLUDE_PATH X11/Xutil.h ${X11_INC_SEARCH_PATH})
+  FIND_PATH(X11_INCLUDE_DIR X11/X.h ${X11_INC_SEARCH_PATH})
   FIND_LIBRARY(X11_X11_LIB X11 ${X11_LIB_SEARCH_PATH})
   FIND_LIBRARY(X11_Xext_LIB Xext ${X11_LIB_SEARCH_PATH})
 
-  IF(X11_X11_INCLUDE_PATH)
-    SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_X11_INCLUDE_PATH})
-  ENDIF(X11_X11_INCLUDE_PATH)
-
-  IF(X11_Xlib_INCLUDE_PATH)
-    SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xlib_INCLUDE_PATH})
-  ENDIF(X11_Xlib_INCLUDE_PATH)
-
-  IF(X11_Xutil_INCLUDE_PATH)
-    SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xutil_INCLUDE_PATH})
-  ENDIF(X11_Xutil_INCLUDE_PATH)
-
   IF(X11_X11_LIB)
     SET(X11_LIBRARIES ${X11_LIBRARIES} ${X11_X11_LIB})
   ENDIF(X11_X11_LIB)
@@ -54,11 +40,11 @@
   ENDIF(X11_Xext_LIB)
 
   # Deprecated variable for backwards compatibility with CMake 1.4
-  IF(X11_X11_INCLUDE_PATH)
+  IF(X11_INCLUDE_DIR)
     IF(X11_LIBRARIES)
       SET(X11_FOUND 1)
     ENDIF(X11_LIBRARIES)
-  ENDIF(X11_X11_INCLUDE_PATH)
+  ENDIF(X11_INCLUDE_DIR)
 
   SET(X11_LIBRARY_DIR "")
   IF(X11_X11_LIB)
@@ -143,11 +129,8 @@
   ENDIF(X11_FOUND)
 
   MARK_AS_ADVANCED(
-    X11_X11_INCLUDE_PATH
     X11_X11_LIB
     X11_Xext_LIB
-    X11_Xlib_INCLUDE_PATH
-    X11_Xutil_INCLUDE_PATH
     X11_LIBRARIES
     )
   SET(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE})


More information about the CMake mailing list