diff --git a/kinfocenter/CMakeLists.txt b/kinfocenter/CMakeLists.txt index eac11c28..5ddc9f65 100644 --- a/kinfocenter/CMakeLists.txt +++ b/kinfocenter/CMakeLists.txt @@ -3,10 +3,34 @@ include(CheckCXXSymbolExists) include_directories( ${KDE4_INCLUDES} ) add_definitions( -DKDE_DEFAULT_DEBUG_AREA=1208 ) +# info_fbsd.cpp +check_include_files(devinfo.h HAVE_DEVINFO_H) + +# opengl.cpp +if(LIBDRM_FOUND) + cmake_reset_check_state() + set(CMAKE_REQUIRED_INCLUDES ${LIBDRM_INCLUDE_DIR}) + set(CMAKE_REQUIRED_LIBRARIES ${LIBDRM_LIBRARIES}) + check_symbol_exists(drmIsKMS "xf86drmMode.h" HAVE_DRMISKMS) + cmake_reset_check_state() +else() + set(HAVE_DRMISKMS FALSE) +endif() + +configure_file ( + config-infocenter.h.cmake + ${CMAKE_CURRENT_BINARY_DIR}/config-infocenter.h +) +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} +) + add_subdirectory( Categories ) add_subdirectory( Modules ) -INCLUDE_DIRECTORIES( ToolTips ) +include_directories( + ToolTips +) set( kinfocenter_SRCS infocenter.cpp diff --git a/kinfocenter/Modules/base/CMakeLists.txt b/kinfocenter/Modules/base/CMakeLists.txt deleted file mode 100644 index 9ead6e33..00000000 --- a/kinfocenter/Modules/base/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -check_include_files(devinfo.h HAVE_DEVINFO_H) # info_fbsd.cpp - -configure_file ( - ../base/config-infocenter.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/config-infocenter.h -) diff --git a/kinfocenter/Modules/info/CMakeLists.txt b/kinfocenter/Modules/info/CMakeLists.txt index c8914d08..c45b2096 100644 --- a/kinfocenter/Modules/info/CMakeLists.txt +++ b/kinfocenter/Modules/info/CMakeLists.txt @@ -1,7 +1,5 @@ # OS Base includes -include(../base/CMakeLists.txt) - include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../base ) diff --git a/kinfocenter/Modules/opengl/opengl.cpp b/kinfocenter/Modules/opengl/opengl.cpp index 485c7e08..8b0ff3a0 100644 --- a/kinfocenter/Modules/opengl/opengl.cpp +++ b/kinfocenter/Modules/opengl/opengl.cpp @@ -22,6 +22,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "config-infocenter.h" // HAVE_DRMISKMS #include "opengl.h" #include @@ -219,7 +220,9 @@ static QTreeWidgetItem *print_drm_info(QTreeWidgetItem *l1, QTreeWidgetItem *aft QString dri_description = QString::fromLatin1(driVer->desc, driVer->desc_len); QString dri_version = QString::fromLatin1("%1.%2.%3").arg(driVer->version_major).arg(driVer->version_minor).arg(driVer->version_patchlevel); QString dri_bus = QString::fromLatin1(driBus); +#ifdef HAVE_DRMISKMS bool dri_kms = (drmIsKMS(driFd) == 1); +#endif drmFreeBusid(driBus); drmFreeVersion(driVer); @@ -231,7 +234,9 @@ static QTreeWidgetItem *print_drm_info(QTreeWidgetItem *l1, QTreeWidgetItem *aft l3 = newItem(l2, l3, i18n("Description"), dri_description); l3 = newItem(l2, l3, i18n("Version"), dri_version); l3 = newItem(l2, l3, i18n("Bus"), dri_bus); +#ifdef HAVE_DRMISKMS l3 = newItem(l2, l3, i18n("Kernel mode-setting"), dri_kms ? i18n("Yes") : i18n("No")); +#endif } #ifdef UNDEFINE_MAX3 diff --git a/kinfocenter/Modules/pci/CMakeLists.txt b/kinfocenter/Modules/pci/CMakeLists.txt index d9eaded4..2c489b4e 100644 --- a/kinfocenter/Modules/pci/CMakeLists.txt +++ b/kinfocenter/Modules/pci/CMakeLists.txt @@ -1,7 +1,5 @@ # OS Base includes -include(../base/CMakeLists.txt) - include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../base ) diff --git a/kinfocenter/Modules/base/config-infocenter.h.cmake b/kinfocenter/config-infocenter.h.cmake similarity index 51% rename from kinfocenter/Modules/base/config-infocenter.h.cmake rename to kinfocenter/config-infocenter.h.cmake index 19a8a19e..b859e32b 100644 --- a/kinfocenter/Modules/base/config-infocenter.h.cmake +++ b/kinfocenter/config-infocenter.h.cmake @@ -1,5 +1,5 @@ -/* Defines if you have libdevinfo of Solaris 7 or later */ -#undef HAVE_LIBDEVINFO_H - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_DEVINFO_H 1 + +/* Defines if you have drmIsKMS() */ +#cmakedefine HAVE_DRMISKMS 1