Skip to content

Commit

Permalink
Adding X11 to the CMakeLists.txt.
Browse files Browse the repository at this point in the history
  • Loading branch information
SySyAli committed Jan 4, 2024
1 parent 8f4a52b commit 31a0398
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 31a0398

Please sign in to comment.