I am new to cmake and try to create a project that works with databases and need special flags to compile successfully. I need to find a way to tell cmake to use thoses flags but I did not find how to do it yet.
Compiling without cmake : g++ project.cpp -L /usr/include/mariadb/mysql -lmariadbclient -o project
cmake file:
#######################################################################
*cmake_minimum_required(VERSION 3.23.1)
project(IrcChannel)
add_executable(${PROJECT_NAME} IrcChannel.cpp)
add_subdirectory(Headers)
target_include_directories(${PROJECT_NAME} PUBLIC Headers)
target_link_directories(${PROJECT_NAME} PUBLIC Headers)
target_link_libraries(${PROJECT_NAME} PUBLIC IrcChannelLibrary)*
#######################################################################
I have tried many things in vain, do you guys have any solution?