Answer the question
In order to leave comments, you need to log in
Clion & Cmake connecting shared libraries?
Good afternoon. I made a dynamic library for my needs. And accordingly, in the project, if I compile through g ++, I perform a list of actions:
g++ -c main.cpp
g++ -o binary main.o -LDebug -lExtension -lSDL2 -Wl,-rpath,Debug
cmake_minimum_required(VERSION 3.6)
project(1_)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
find_package(SDL2 REQUIRED)
if(SDL2_TRUE)
include_directories(${SDL2_INCLUDE_DIR})
endif()
set(SOURCE_FILES main.cpp sources/Display.cpp headers/Display.h)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} ${SDL2_LIBRARY})
target_link_libraries(${PROJECT_NAME} Extension)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question