lollms/examples/cpp_client_example/CMakeLists.txt

31 lines
1.2 KiB
CMake
Raw Normal View History

2023-09-17 11:53:24 +00:00
cmake_minimum_required(VERSION 3.12)
2023-09-17 15:48:00 +00:00
project(LollmsClientApp)
2023-07-05 07:10:28 +00:00
2023-09-17 11:53:24 +00:00
# Include ExternalProject module
include(ExternalProject)
2023-07-05 07:10:28 +00:00
2023-09-17 11:53:24 +00:00
# Set up the external project
ExternalProject_Add(
socketio-client-cpp
PREFIX ${CMAKE_BINARY_DIR}/external
GIT_REPOSITORY https://github.com/socketio/socket.io-client-cpp.git
GIT_TAG master # You can change this to a specific release/tag if needed
2023-09-17 15:48:00 +00:00
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> -DSIO_DISABLE_LOGGING=ON # Add this line to disable logging
2023-09-17 11:53:24 +00:00
)
2023-07-05 07:10:28 +00:00
2023-09-17 11:53:24 +00:00
# Add your project's executable or library here
2023-09-17 15:48:00 +00:00
add_executable(LollmsClientApp main.cpp src/ASCIIColors.cpp)
2023-07-05 07:10:28 +00:00
2023-09-17 11:53:24 +00:00
# Include the socket.io-client-cpp header files
2023-09-17 15:48:00 +00:00
target_include_directories(LollmsClientApp PRIVATE
2023-09-17 11:53:24 +00:00
${CMAKE_BINARY_DIR}/external/include
${CMAKE_BINARY_DIR}/external/include/socket.io-client-cpp # Add this line
2023-07-05 07:10:28 +00:00
)
2023-09-17 11:53:24 +00:00
# This is required for googletest
find_package(sioclient)
# Link your project with the socket.io-client-cpp library
2023-09-17 15:48:00 +00:00
target_include_directories(LollmsClientApp PRIVATE ${CMAKE_BINARY_DIR}/external/include)
target_link_directories(LollmsClientApp PRIVATE ${CMAKE_BINARY_DIR}/external/lib)
target_include_directories(LollmsClientApp PRIVATE ./inc)
target_link_libraries(LollmsClientApp PRIVATE sioclient)