Hi, I’m trying to compile an application using Cinder on Ubuntu 16.04. I’m using CLion and CMake. The project has several other external dependencies and I’m having issues linking them. At first I tried to create the cmakelists file from scratch, but got a lot of Cinder-related linker errors. I decided to look at the Cinder samples for inspiration.
Now I’m trying to use the cinderMakeApp.cmake file instead of linking Cinder by hand which works great for Cinder itself, but not for the other external libs. Here’s what the file looks like–it seems like this should work:
`cmake_minimum_required(VERSION 3.5)
project(AIBackend)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fpermissive")
set(AI_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/../include")
set(AI_SRC_DIR "${PROJECT_SOURCE_DIR}/../src")
include("$ENV{LIBCINDER0_9}/proj/cmake/modules/cinderMakeApp.cmake")
ci_make_app(
SOURCES ${AI_SRC_DIR}/AIBackend.cpp ${AI_SRC_DIR}/aiLoader.cpp ${AI_SRC_DIR}/aiPicker.cpp ${AI_SRC_DIR}/aiSensorIO.cpp
CINDER_PATH "$ENV{LIBCINDER0_9}"
INCLUDES "${PROJECT_SOURCE_DIR}/../include" "$ENV{LIBCINDER0_9}/include" "$ENV{LIBPCL}" "$ENV{EIGEN}" "$ENV{DEPTHSENSESDK64}/include"
LIBRARIES /opt/softkinetic/DepthSenseSDK/libDepthSense.so /opt/softkinetic/DepthSenseSDK/lib/libDepthSensePlugins.so /opt/softkinetic/DepthSenseSDK/lib/libusb-1.0.so
)`
I’m using the absolute path to the so files as a sanity check–I would much prefer to use an environment variable for their parent directory. I’ve tried variations on that theme with no luck. I also tried adding link_directories() in cinderMakeApp.cmake just to see if that might work, also no dice. I’m seeing tons of “undefined reference…” errors in the console related to the libs listed above. As I said, this is one of many external libs I need to link.
Any tips? They are much appreciated as cmake is not my forte. (obviously )