I'm new to CMake and I don't really know what I'm doing ... I am currently trying to link a static library (libavcodec.a) against a shared one (GreenVideo). I keep having errors saying that my functions provided by my static lib are "undefined reference". My CMakeLists.txt looks like this:
PROJECT(GreenVideo)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/)
link_directories(/home/nde/svn/Visio/trunk/applications/dorsalistaApp/components/GreenVideo/lib)
ADD_LIBRARY( GreenVideo SHARED
${CMAKE_CURRENT_SOURCE_DIR}/include/libavcodec/xvmc.h
${CMAKE_CURRENT_SOURCE_DIR}/include/libavcodec/vdpau.h
${CMAKE_CURRENT_SOURCE_DIR}/include/libavcodec/dxva2.h
${CMAKE_CURRENT_SOURCE_DIR}/include/libavcodec/avcodec.h
${CMAKE_CURRENT_SOURCE_DIR}/include/libavcodec/avfft.h
${CMAKE_CURRENT_SOURCE_DIR}/include/libavcodec/dv_profile.h
${CMAKE_CURRENT_SOURCE_DIR}/include/libavcodec/vaapi.h
${CMAKE_CURRENT_SOURCE_DIR}/include/libavcodec/vda.h
${CMAKE_CURRENT_SOURCE_DIR}/include/libavcodec/version.h
metadatagen.h metadatagen.cpp
greenvideofactory.h
greenvideofactory.cpp
)
target_link_libraries(GreenVideo /home/nde/svn/Visio/trunk/applications/dorsalistaApp/components/GreenVideo/lib/libavcodec.a)
Is there anything suspicious in the way I'm doing it ?
Regards, Nicolas