You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FindThirdPartyX11.cmake 1.2KB

3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # ---------------------------------
  2. # Finds X11 toolkit
  3. #
  4. # Sets X11_FOUND
  5. # Sets X11_LIBRARIES
  6. # Sets X11_LIBRARY_DIRS
  7. # Sets X11_LDFLAGS
  8. # Sets X11_LDFLAGS_OTHERS
  9. # Sets X11_INCLUDE_DIRS
  10. # Sets X11_CFLAGS
  11. # Sets X11_CFLAGS_OTHERS
  12. # ---------------------------------
  13. GET_PROPERTY(OV_PRINTED GLOBAL PROPERTY OV_TRIED_ThirdPartyX11)
  14. IF(UNIX)
  15. INCLUDE("FindThirdPartyPkgConfig")
  16. pkg_check_modules(X11 x11)
  17. IF(X11_FOUND)
  18. OV_PRINT(OV_PRINTED " Found X11...")
  19. INCLUDE_DIRECTORIES(${X11_INCLUDE_DIRS})
  20. ADD_DEFINITIONS(${X11_CFLAGS})
  21. ADD_DEFINITIONS(${X11_CFLAGS_OTHERS})
  22. # LINK_DIRECTORIES(${X11_LIBRARY_DIRS})
  23. FOREACH(X11_LIB ${X11_LIBRARIES})
  24. SET(X11_LIB1 "X11_LIB1-NOTFOUND")
  25. FIND_LIBRARY(X11_LIB1 NAMES ${X11_LIB} PATHS ${X11_LIBRARY_DIRS} ${X11_LIBDIR} NO_DEFAULT_PATH)
  26. FIND_LIBRARY(X11_LIB1 NAMES ${X11_LIB})
  27. IF(X11_LIB1)
  28. OV_PRINT(OV_PRINTED " [ OK ] Third party lib ${X11_LIB1}")
  29. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${X11_LIB1})
  30. ELSE(X11_LIB1)
  31. OV_PRINT(OV_PRINTED " [FAILED] Third party lib ${X11_LIB}")
  32. ENDIF(X11_LIB1)
  33. ENDFOREACH(X11_LIB)
  34. ELSE(X11_FOUND)
  35. OV_PRINT(OV_PRINTED " FAILED to find X11...")
  36. ENDIF(X11_FOUND)
  37. ENDIF(UNIX)
  38. SET_PROPERTY(GLOBAL PROPERTY OV_TRIED_ThirdPartyX11 "Yes")