#482 Build on Kubuntu 12.04 fails due to missing include paths

open
nobody
5
2012-07-16
2012-07-16
No

Hi. While trying to build on Kubuntu 12.04 with all optional features, two files fail to build because librdf is looking for raptor2 and rasqal include files, which are in different directories that the compiler isn't looking in (/usr/include/raptor2 and /usr/include/rasqal, respectively).

[ 47%] Building CXX object CMakeFiles/lmms.dir/src/core/lv2_manager.cpp.o
In file included from /usr/include/slv2/world.h:26:0,
from /tmp/lmms/include/lv2_manager.h:33,
from /tmp/lmms/src/core/lv2_manager.cpp:35:
/usr/include/librdf.h:31:21: fatal error: raptor2.h: No such file or directory

(after satisfying the raptor2 requirement)
[ 47%] Building CXX object CMakeFiles/lmms.dir/src/core/lv2_manager.cpp.o
In file included from /usr/include/slv2/world.h:26:0,
from /tmp/lmms/include/lv2_manager.h:33,
from /tmp/lmms/src/core/lv2_manager.cpp:35:
/usr/include/librdf.h:33:20: fatal error: rasqal.h: No such file or directory
compilation terminated.

To get it to build for me, I made the following change to CMakeLists.txt; there's probably a better fix than this:
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -536,7 +536,7 @@ ENDIF()

ADD_DEFINITIONS(-D'LIB_DIR="${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/"' -D'PLUGIN_DIR="${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/lmms/"' ${PULSEAUDIO_DEFINITIONS} ${PORTAUDIO_DEFINITIONS})

-INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/include ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/include ${SDL_INCLUDE_DIR} ${PORTAUDIO_INCLUDE_DIR} ${PULSEAUDIO_INCLUDE_DIR} ${JACK_INCLUDE_DIRS} ${OGGVORBIS_INCLUDE_DIR} ${SAMPLERATE_INCLUDE_DIRS} ${SNDFILE_INCLUDE_DIRS} ${FLAC_INCLUDE_DIR})
+INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/include ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/include ${SDL_INCLUDE_DIR} ${PORTAUDIO_INCLUDE_DIR} ${PULSEAUDIO_INCLUDE_DIR} ${JACK_INCLUDE_DIRS} ${OGGVORBIS_INCLUDE_DIR} ${SAMPLERATE_INCLUDE_DIRS} ${SNDFILE_INCLUDE_DIRS} ${FLAC_INCLUDE_DIR} /usr/include/raptor2/ /usr/include/rasqal/ )
LINK_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/lib ${ASOUND_LIBRARY_DIR} ${JACK_LIBRARY_DIRS} ${SAMPLERATE_LIBRARY_DIRS} ${SNDFILE_LIBRARY_DIRS})
LINK_LIBRARIES(${CMAKE_THREAD_LIBS_INIT} ${QT_LIBRARIES} ${ASOUND_LIBRARY} ${SDL_LIBRARY} ${PORTAUDIO_LIBRARIES} ${PULSEAUDIO_LIBRARIES} ${JACK_LIBRARIES} ${OGGVORBIS_LIBRARIES} ${SAMPLERATE_LIBRARIES} ${SNDFILE_LIBRARIES} ${FLAC_LIBRARIES} ${SLV2_LIBRARY} ${EXTRA_LIBRARIES})

Thanks.

Discussion