Skip to content

Commit

Permalink
Fixing CMakeLists.txt.
Browse files Browse the repository at this point in the history
  • Loading branch information
SySyAli committed Jan 4, 2024
1 parent 19b7c6d commit 946cb97
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ else()
endif()
endif()

# linking
if(MSVC)
# Using Microsoft Visual C++
target_include_directories(desktop_screentime PRIVATE ${SQLite3_INCLUDE_DIRS})
else()
# Assuming GCC or Clang
if(X11_FOUND)
target_include_directories(desktop_screentime PRIVATE ${SQLite3_INCLUDE_DIRS} ${X11_LIBRARIES})
else()
target_include_directories(desktop_screentime PRIVATE ${SQLite3_INCLUDE_DIRS})
endif()
endif()



# Testing Executable
# Define the source files and dependencies for the executable
Expand All @@ -72,7 +86,6 @@ set(SOURCE_FILES
)

# Make the project root directory the working directory when we run
# TODO: Add something about X11
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
add_executable(tests ${SOURCE_FILES})
target_link_libraries(tests gtest gtest_main ${SQLite3_LIBRARIES})
Expand Down
3 changes: 2 additions & 1 deletion IWindowInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ void WindowsTracker::startTracking()
#endif

#if __linux__
std::string getTrackingScreenLinux(Display* display) {
std::string getTrackingScreenLinux(Display* display)
{
Window window;
char* title = nullptr;
int revert_to_return;
Expand Down
5 changes: 5 additions & 0 deletions IWindowInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,9 @@ class LinuxTracker : public IWindowInterface {
void startTracking() override;
};

class MacOSTracker : public IWindowInterface {
public:
void startTracking() override;
};

#endif // WINDOWTRACKER_H

0 comments on commit 946cb97

Please sign in to comment.