poomer-discord-helloworld/CMakeLists.txt
2025-08-14 16:29:32 +00:00

36 lines
1.4 KiB
CMake

# Minimum CMake version required
cmake_minimum_required(VERSION 3.22)
# Project name, version, and description
project(discord-bot VERSION 1.0 DESCRIPTION "A discord bot" LANGUAGES CXX) # Specify CXX language
# Temporarily removed to rule out interference from custom CMake modules.
# If you have custom CMake modules here that you need, we can re-add this later.
# list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# Create an executable
add_executable(${PROJECT_NAME}
main.cpp
)
# Include directories for your headers and D++ headers
# This tells the compiler where to find #include <ImageProcessor.h> and #include <dpp/dpp.h>
target_include_directories(${PROJECT_NAME} PRIVATE
# Ensure this path is correct if your D++ headers are NOT directly in ${CMAKE_CURRENT_SOURCE_DIR}/include/dpp
# If dpp/dpp.h is found in ${CMAKE_CURRENT_SOURCE_DIR}/include/dpp, then the line below is correct.
${CMAKE_CURRENT_SOURCE_DIR}
)
# --- NEW: Direct Linker Injection using Generator Expression ---
# This method tells CMake to ONLY pass the full path to the linker,
# explicitly preventing it from being treated as a build target.
target_link_libraries(${PROJECT_NAME} PRIVATE
"$<LINK_ONLY:${CMAKE_CURRENT_SOURCE_DIR}/lib/libdpp.so.10.1.4>"
)
# Set C++ version
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
)