summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt100
-rw-r--r--LTO.cmake32
-rw-r--r--kms++/CMakeLists.txt41
-rw-r--r--kms++/kms++.pc.in10
-rw-r--r--kms++util/CMakeLists.txt31
-rw-r--r--kms++util/kms++util.pc.in11
-rw-r--r--kmscube/CMakeLists.txt45
-rw-r--r--py/CMakeLists.txt2
-rw-r--r--py/pykms/CMakeLists.txt30
-rw-r--r--py/tests/CMakeLists.txt7
-rw-r--r--utils/CMakeLists.txt37
11 files changed, 0 insertions, 346 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644
index 8af9b9c..0000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,100 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-project(kms++)
-
-include(LTO.cmake)
-
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-
-include(CheckCXXCompilerFlag)
-
-IF(NOT CMAKE_BUILD_TYPE)
- message(STATUS "Setting build type to 'Release' as none was specified.")
- SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
- set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
-ENDIF()
-
-string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE)
-
-option(BUILD_SHARED_LIBS "Build shared libs" FALSE)
-option(TREAT_WARNINGS_AS_ERRORS "Treat warnings as errors" FALSE)
-
-set(KMSXX_ENABLE_PYTHON ON CACHE BOOL "Enable Python wrappers")
-set(KMSXX_PYTHON_VERSION "python3" CACHE STRING "Python pkgconfig package")
-
-set(KMSXX_ENABLE_KMSCUBE OFF CACHE BOOL "Enable kmscube")
-
-set(KMSXX_ENABLE_THREADING ON CACHE BOOL "Enable threading for parallelized drawing")
-set(KMSXX_ENABLE_LIBDRMOMAP ON CACHE BOOL "Enable OMAP-specific extensions")
-
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Wall")
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra -Wno-unused-parameter")
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wno-unused-parameter")
-
-if (CMAKE_COMPILER_IS_GNUCC)
- if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
- # GCC 4.x seems to warn too much
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers")
- endif()
-endif()
-
-# HACK: cmake always adds "-rdynamic", this removes it
-SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
-SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
-
-set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
-
-if (TREAT_WARNINGS_AS_ERRORS)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
-endif()
-
-# static link libc
-# set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
-
-check_lto()
-
-if (NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG)
- if (LTO_WORKS)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
- set(CMAKE_AR "${LTO_AR}")
- set(CMAKE_RANLIB "${LTO_RANLIB}")
- endif()
-endif()
-
-find_package(PkgConfig REQUIRED)
-pkg_check_modules(LIBDRM libdrm>=2.4.71 REQUIRED)
-
-if (KMSXX_ENABLE_LIBDRMOMAP)
- pkg_check_modules(LIBDRM_OMAP libdrm_omap)
-else()
- set(LIBDRM_OMAP_FOUND FALSE)
-endif()
-
-if(LIBDRM_OMAP_FOUND)
- add_definitions(-DHAS_LIBDRM_OMAP)
-endif()
-
-pkg_check_modules(LIBEVDEV libevdev)
-
-enable_testing()
-
-add_subdirectory(kms++)
-add_subdirectory(kms++util)
-add_subdirectory(utils)
-
-add_subdirectory(ext/fmt)
-
-if(KMSXX_ENABLE_KMSCUBE)
- add_subdirectory(kmscube)
-endif()
-
-if(KMSXX_ENABLE_PYTHON)
- add_subdirectory(py)
-endif()
-
-add_custom_target(docs SOURCES "README.md")
diff --git a/LTO.cmake b/LTO.cmake
deleted file mode 100644
index 9a18d77..0000000
--- a/LTO.cmake
+++ /dev/null
@@ -1,32 +0,0 @@
-function(check_lto)
- if (DEFINED LTO_WORKS)
- return()
- endif()
-
- set(LTO_WORKS FALSE CACHE INTERNAL "LTO works")
-
- CHECK_CXX_COMPILER_FLAG("-flto" HAS_LTO_FLAG)
-
- if (NOT HAS_LTO_FLAG)
- return()
- endif()
-
- find_program(LTO_AR NAMES "${CMAKE_C_COMPILER}-ar" gcc-ar)
- find_program(LTO_RANLIB NAMES "${CMAKE_C_COMPILER}-ranlib" gcc-ranlib)
-
- if (NOT LTO_AR OR NOT LTO_RANLIB)
- return()
- endif()
-
- EXECUTE_PROCESS(COMMAND "${LTO_AR}" --version RESULT_VARIABLE ret OUTPUT_QUIET ERROR_QUIET)
- if (ret)
- return()
- endif()
-
- EXECUTE_PROCESS(COMMAND "${LTO_RANLIB}" --version RESULT_VARIABLE ret OUTPUT_QUIET ERROR_QUIET)
- if (ret)
- return()
- endif()
-
- set(LTO_WORKS TRUE CACHE INTERNAL "LTO works")
-endfunction()
diff --git a/kms++/CMakeLists.txt b/kms++/CMakeLists.txt
deleted file mode 100644
index 6e21fa5..0000000
--- a/kms++/CMakeLists.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-include_directories(${LIBDRM_INCLUDE_DIRS})
-link_directories(${LIBDRM_LIBRARY_DIRS})
-
-include_directories(${LIBDRM_OMAP_INCLUDE_DIRS})
-link_directories(${LIBDRM_OMAP_LIBRARY_DIRS})
-
-file(GLOB SRCS "src/*.cpp" "src/*.h")
-file(GLOB PUB_HDRS "inc/kms++/*.h")
-
-if(LIBDRM_OMAP_FOUND)
- file(GLOB OMAP_SRCS "src/omap/*.cpp" "src/omap/*.h")
- file(GLOB OMAP_PUB_HDRS "inc/kms++/omap/*.h")
-
- set(SRCS ${SRCS} ${OMAP_SRCS})
- set(PUB_HDRS ${PUB_HDRS} ${OMAP_PUB_HDRS})
-endif()
-
-add_library(kms++ ${SRCS} ${PUB_HDRS})
-
-target_include_directories(kms++ PUBLIC
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
- $<INSTALL_INTERFACE:include>
- PRIVATE src)
-
-target_link_libraries(kms++ ${LIBDRM_LIBRARIES} ${LIBDRM_OMAP_LIBRARIES} fmt::fmt-header-only)
-
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/kms++.pc.in ${CMAKE_CURRENT_BINARY_DIR}/kms++.pc @ONLY)
-
-# Set a dummy SOVERSION just to avoid having a naked .so file in the filesystem.
-# This version number doesn't make any promise about API/ABI stability.
-set_target_properties(kms++ PROPERTIES
- PUBLIC_HEADER "${PUB_HDRS}"
- SOVERSION 0)
-
-install(TARGETS kms++
- LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib
- PUBLIC_HEADER DESTINATION include/kms++)
-
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kms++.pc
- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
diff --git a/kms++/kms++.pc.in b/kms++/kms++.pc.in
deleted file mode 100644
index 60b5974..0000000
--- a/kms++/kms++.pc.in
+++ /dev/null
@@ -1,10 +0,0 @@
-prefix=@CMAKE_INSTALL_PREFIX@
-exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=@CMAKE_INSTALL_PREFIX@/lib
-includedir=@CMAKE_INSTALL_PREFIX@/include
-
-Name: kms++
-Description: C++ library for Linux kernel mode setting
-Version: 0.0.0
-Libs: -L${libdir} -lkms++
-Cflags: -I${includedir}
diff --git a/kms++util/CMakeLists.txt b/kms++util/CMakeLists.txt
deleted file mode 100644
index 0bfb56b..0000000
--- a/kms++util/CMakeLists.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-file(GLOB SRCS "src/*.cpp" "src/*.h")
-file(GLOB PUB_HDRS "inc/kms++util/*.h")
-add_library(kms++util ${SRCS} ${PUB_HDRS})
-
-target_include_directories(kms++util PUBLIC
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
- $<INSTALL_INTERFACE:include>
- PRIVATE src)
-
-target_link_libraries(kms++util kms++)
-
-if (KMSXX_ENABLE_THREADING)
- target_link_libraries(kms++util pthread)
- add_definitions(-DHAS_PTHREAD)
-endif()
-
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/kms++util.pc.in ${CMAKE_CURRENT_BINARY_DIR}/kms++util.pc @ONLY)
-
-# Set a dummy SOVERSION just to avoid havig a naked .so file in the filesystem.
-# This version number doesn't make any promise about API/ABI stability.
-set_target_properties(kms++util PROPERTIES
- PUBLIC_HEADER "${PUB_HDRS}"
- SOVERSION 0)
-
-install(TARGETS kms++util
- LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib
- PUBLIC_HEADER DESTINATION include/kms++util)
-
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kms++util.pc
- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
diff --git a/kms++util/kms++util.pc.in b/kms++util/kms++util.pc.in
deleted file mode 100644
index b90df89..0000000
--- a/kms++util/kms++util.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@CMAKE_INSTALL_PREFIX@
-exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=@CMAKE_INSTALL_PREFIX@/lib
-includedir=@CMAKE_INSTALL_PREFIX@/include
-
-Name: kms++
-Description: C++ library for Linux kernel mode setting
-Version: 0.0.0
-Requires: kms++
-Libs: -L${libdir} -lkms++util
-Cflags: -I${includedir}
diff --git a/kmscube/CMakeLists.txt b/kmscube/CMakeLists.txt
deleted file mode 100644
index 9df43c0..0000000
--- a/kmscube/CMakeLists.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-
-pkg_check_modules(GLESv2 glesv2 REQUIRED)
-pkg_check_modules(EGL egl REQUIRED)
-pkg_check_modules(GBM gbm REQUIRED)
-pkg_check_modules(X11 x11 REQUIRED)
-pkg_check_modules(XCB xcb REQUIRED)
-pkg_check_modules(X11XCB x11-xcb REQUIRED)
-pkg_check_modules(WL wayland-client REQUIRED)
-pkg_check_modules(WL_EGL wayland-egl REQUIRED)
-
-
-include_directories(
- ${LIBDRM_INCLUDE_DIRS}
- ${GLESv2_INCLUDE_DIRS}
- ${EGL_INCLUDE_DIRS}
- ${GBM_INCLUDE_DIRS}
- ${X11_INCLUDE_DIRS}
- ${XCB_INCLUDE_DIRS}
- ${X11XCB_INCLUDE_DIRS}
-)
-
-link_directories(
- ${LIBDRM_LIBRARY_DIRS}
- ${GLESv2_LIBRARY_DIRS}
- ${EGL_LIBRARY_DIRS}
- ${GBM_LIBRARY_DIRS}
- ${X11_LIBRARY_DIRS}
- ${XCB_LIBRARY_DIRS}
- ${X11XCB_LIBRARY_DIRS}
-)
-
-add_executable (kmscube cube.cpp cube.h cube-egl.cpp cube-egl.h cube-gles2.cpp cube-gles2.h
- cube-null.cpp cube-gbm.cpp cube-x11.cpp cube-wl.cpp
- esTransform.cpp esTransform.h)
-target_link_libraries(kmscube kms++ kms++util
- ${LIBDRM_LIBRARIES}
- ${GLESv2_LIBRARIES}
- ${EGL_LIBRARIES}
- ${GBM_LIBRARIES}
- ${X11_LIBRARIES}
- ${XCB_LIBRARIES}
- ${X11XCB_LIBRARIES}
- ${WL_LIBRARIES}
- ${WL_EGL_LIBRARIES}
-)
diff --git a/py/CMakeLists.txt b/py/CMakeLists.txt
deleted file mode 100644
index 77f19b4..0000000
--- a/py/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-add_subdirectory(pykms)
-add_subdirectory(tests)
diff --git a/py/pykms/CMakeLists.txt b/py/pykms/CMakeLists.txt
deleted file mode 100644
index 505c0c3..0000000
--- a/py/pykms/CMakeLists.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-include_directories(${LIBDRM_INCLUDE_DIRS})
-link_directories(${LIBDRM_LIBRARY_DIRS})
-
-pkg_search_module(PYTHON REQUIRED ${KMSXX_PYTHON_VERSION})
-include_directories(${PYTHON_INCLUDE_DIRS})
-
-if (NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
-endif()
-
-include_directories(${PROJECT_SOURCE_DIR}/ext/pybind11/include)
-
-set(SRCS pykms.cpp pykmsbase.cpp pykmsutil.cpp pyvid.cpp)
-
-if(LIBDRM_OMAP_FOUND)
- set(SRCS ${SRCS} pykmsomap.cpp)
-endif()
-
-add_library(pykms SHARED ${SRCS})
-target_link_libraries(pykms kms++ kms++util ${LIBDRM_LIBRARIES})
-
-# Don't add a 'lib' prefix to the shared library
-set_target_properties(pykms PROPERTIES PREFIX "")
-set_target_properties(pykms PROPERTIES LIBRARY_OUTPUT_DIRECTORY "")
-
-configure_file(__init__.py __init__.py COPYONLY)
-
-set(PY_DESTDIR lib/python${PYTHON_VERSION}/site-packages/pykms)
-install(FILES __init__.py DESTINATION ${PY_DESTDIR})
-install(TARGETS pykms DESTINATION ${PY_DESTDIR})
diff --git a/py/tests/CMakeLists.txt b/py/tests/CMakeLists.txt
deleted file mode 100644
index a670ed9..0000000
--- a/py/tests/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-file(GLOB PY_SRCS "*.py")
-add_custom_target(pyextras SOURCES ${PY_SRCS})
-
-add_test(NAME pytest COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/functest.py")
-set_property(TEST pytest PROPERTY
- ENVIRONMENT "PYTHONPATH=." "LD_LIBRARY_PATH=."
-)
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
deleted file mode 100644
index d28527a..0000000
--- a/utils/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-include_directories(${LIBDRM_INCLUDE_DIRS})
-link_directories(${LIBDRM_LIBRARY_DIRS})
-
-include_directories(${LIBEVDEV_INCLUDE_DIRS})
-link_directories(${LIBEVDEV_LIBRARY_DIRS})
-
-add_executable (kmstest kmstest.cpp)
-target_link_libraries(kmstest kms++ kms++util ${LIBDRM_LIBRARIES})
-
-add_executable (kmsview kmsview.cpp)
-target_link_libraries(kmsview kms++ kms++util ${LIBDRM_LIBRARIES})
-
-add_executable (kmsprint kmsprint.cpp)
-target_link_libraries(kmsprint kms++ kms++util ${LIBDRM_LIBRARIES})
-
-add_executable (fbtest fbtest.cpp)
-target_link_libraries(fbtest kms++util)
-
-add_executable (kmscapture kmscapture.cpp)
-target_link_libraries(kmscapture kms++ kms++util ${LIBDRM_LIBRARIES})
-
-add_executable (kmsblank kmsblank.cpp)
-target_link_libraries(kmsblank kms++ kms++util ${LIBDRM_LIBRARIES})
-
-if(LIBEVDEV_FOUND)
- add_executable (kmstouch kmstouch.cpp)
- target_link_libraries(kmstouch kms++ kms++util ${LIBDRM_LIBRARIES} ${LIBEVDEV_LIBRARIES})
-endif()
-
-add_executable (omap-wbcap omap-wbcap.cpp)
-target_link_libraries(omap-wbcap kms++ kms++util ${LIBDRM_LIBRARIES})
-
-add_executable (omap-wbm2m omap-wbm2m.cpp)
-target_link_libraries(omap-wbm2m kms++ kms++util ${LIBDRM_LIBRARIES})
-
-install(TARGETS kmstest kmsprint fbtest
- DESTINATION bin)