|
12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- # ---------------------------------
- # Finds X11 toolkit
- #
- # Sets X11_FOUND
- # Sets X11_LIBRARIES
- # Sets X11_LIBRARY_DIRS
- # Sets X11_LDFLAGS
- # Sets X11_LDFLAGS_OTHERS
- # Sets X11_INCLUDE_DIRS
- # Sets X11_CFLAGS
- # Sets X11_CFLAGS_OTHERS
- # ---------------------------------
- IF(UNIX)
- SET(OLD_CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH})
- IF(APPLE)
- SET(CMAKE_PREFIX_PATH "/opt/X11")
- ENDIF()
- INCLUDE("FindPkgConfig")
- pkg_check_modules(X11 x11)
-
- IF(X11_FOUND)
- debug_message( " Found X11... ${X11_INCLUDE_DIRS}")
- INCLUDE_DIRECTORIES(${X11_INCLUDE_DIRS})
- ADD_DEFINITIONS(${X11_CFLAGS})
- ADD_DEFINITIONS(${X11_CFLAGS_OTHERS})
- # LINK_DIRECTORIES(${X11_LIBRARY_DIRS})
- FOREACH(X11_LIB ${X11_LIBRARIES})
- SET(X11_LIB1 "X11_LIB1-NOTFOUND")
- FIND_LIBRARY(X11_LIB1 NAMES ${X11_LIB} PATHS ${X11_LIBRARY_DIRS} ${X11_LIBDIR} NO_DEFAULT_PATH)
- FIND_LIBRARY(X11_LIB1 NAMES ${X11_LIB})
- IF(X11_LIB1)
- debug_message( " [ OK ] Third party lib ${X11_LIB1}")
- TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${X11_LIB1})
- ELSE(X11_LIB1)
- MESSAGE(WARNING " [FAILED] Third party lib ${X11_LIB}")
- ENDIF(X11_LIB1)
- ENDFOREACH(X11_LIB)
- ELSE(X11_FOUND)
- MESSAGE(WARNING " FAILED to find X11...")
- ENDIF(X11_FOUND)
-
- SET(CMAKE_PREFIX_PATH ${OLD_CMAKE_PREFIX_PATH})
- ENDIF(UNIX)
|