Normal compilation (works fine):
g++ DBHandler.cpp Functions.cpp Main.cpp -I/usr/local/include -L/usr/local/lib -lconfig++ -lpqxx -lpq -o dbhandler
It`s possible to run:
./dbhandler
CMakeLists.txt (standard):
cmake_minimum_required(VERSION 2.8.9)
project(DBHandler)
include_directories(include)
file(GLOB SOURCES "src/*.cpp")
target_link_libraries(dbhandler config++ pqxx pq)
add_executable(dbhandler ${SOURCES})
How to change CMakeLists.txt and add:
-I/usr/local/include -L/usr/local/lib -lconfig++ -lpqxx -lpq
to compile program using cmake?