Could someone, who knows about kodis build-system help me out real quick?
I'm rewriting most of the visualization (making it more modular) and the core of the visualization will
be a project on it's own (a static library to be exact) but I'm unable to link it properly using the
build_addon macro
(With a glut-based project it works just fine)
PictureIt CMakeLists.txt (builds fine on it's own)
Code:
project(PictureIt)
cmake_minimum_required(VERSION 2.6)
find_package(OpenGL)
if(OPENGL_FOUND)
list(APPEND INCLUDES ${OpenGL_INCLUDE_DIRS})
list(APPEND DEPLIBS ${OPENGL_LIBRARIES})
add_definitions(${OpenGL_DEFINITIONS})
else(OPENGL_FOUND)
message(FATAL_ERROR "No rendering API found. Bailing")
endif(OPENGL_FOUND)
include_directories(${INCLUDES})
set(PICTUREIT_SOURCES pictureit.cpp
background.cpp
effects.cpp
spectrum.cpp)
if(NOT WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif(NOT WIN32)
add_library(PictureIt STATIC ${PICTUREIT_SOURCES})
set_property(TARGET PictureIt PROPERTY CXX_STANDARD 11)
visualization.pictureit CMakeLists.txt
It builds as well but says:
You have called ADD_LIBRARY for library visualization.pictureit without any source files. This typically indicates a problem with your CMakeLists.txt file
and for the life of me I don't see what I'm doing wrong :/
(I'm still super new to cmake so sorry if it's super obvious)
Code:
project(visualization.pictureit)
cmake_minimum_required(VERSION 2.6)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
find_package(kodi REQUIRED)
find_package(OpenGL)
if(OPENGL_FOUND)
list(APPEND INCLUDES ${OpenGL_INCLUDE_DIR})
list(APPEND DEPLIBS ${OPENGL_LIBRARIES})
add_definitions(${OpenGL_DEFINITIONS})
else()
message(FATAL_ERROR "No rendering API found. Bailing")
endif()
include_directories(${INCLUDES}
${KODI_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/lib/pictureit
${CMAKE_INCLUDE_PATH})
add_subdirectory(lib/pictureit)
set(VIS_SOURCES src/pictureit_addon.cpp)
list(APPEND DEPLIBS PictureIt)
if(APPLE)
set(DEPLIBS ${DEPLIBS} "-framework CoreVideo")
endif(APPLE)
build_addon(visualization.pictureit PICTUREIT DEPLIBS)
include(CPack)