From 31a0398bb263e6da4a19d69f084c7a7f101ceef1 Mon Sep 17 00:00:00 2001 From: SySyAli Date: Wed, 3 Jan 2024 23:53:29 -0500 Subject: [PATCH] Adding X11 to the CMakeLists.txt. --- .github/workflows/build.yml | 2 +- CMakeLists.txt | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f9ca4c..be3f146 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,7 +51,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y cmake g++ libsqlite3-dev + sudo apt-get install -y cmake g++ libsqlite3-dev libx11-dev - name: Configure CMake run: cmake -S . -B build diff --git a/CMakeLists.txt b/CMakeLists.txt index 9978275..ea524cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,9 @@ endif() # include sqlite3 find_package(SQLite3 REQUIRED) +# find X11 - linux +find_package(X11 REQUIRED) + # include testing enable_testing() # Bring in GoogleTest @@ -50,6 +53,12 @@ else() endif() target_include_directories(desktop_screentime PRIVATE ${SQLite3_INCLUDE_DIRS}) +# Link X11 library for Linux build +if(X11_FOUND) + target_link_libraries(desktop_screentime ${X11_LIBRARIES}) + target_include_directories(desktop_screentime PRIVATE ${X11_INCLUDE_DIR}) +endif() + # Testing Executable # Define the source files and dependencies for the executable set(SOURCE_FILES