I am able to compile and run my code from the terminal with:
g++ main.cpp MapParser.cpp -o test -lgdal -std=c++11
Now I want to run it using CLion, but I am unable to link the gdal shared library in CMakeLists.txt. So far, this is what I have come up with:
cmake_minimum_required(VERSION 3.9)
project(MyMapsParser)
set(CMAKE_CXX_STANDARD 11)
add_library (gdal SHARED ./MapParser.h)
SET_TARGET_PROPERTIES(gdal PROPERTIES LINKER_LANGUAGE C)
set(
SOURCE_FILES
main.cpp
./MapParser.h
./MapParser.cpp
)
add_executable(MyMapsParser ${SOURCE_FILES})