39 lines
1.6 KiB
CMake
39 lines
1.6 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}
|
|
src/main.cpp
|
|
src/ImageProcessor.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
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include # This covers ImageProcessor.h and the parent for dpp/dpp.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include/stb # For stb_image.h and stb_image_write.h
|
|
# 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}/include/dpp
|
|
)
|
|
|
|
# --- 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>" # Corrected 'libs' to 'lib'
|
|
)
|
|
|
|
# Set C++ version
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
CXX_STANDARD 20
|
|
CXX_STANDARD_REQUIRED ON
|
|
)
|