Commit fdcf7326 authored by Matthias Klumpp's avatar Matthias Klumpp

Fix projectM linking

parent 66cccaff
......@@ -3,3 +3,6 @@ pristine-tar = True
[git-import-orig]
dch = False
[git-buildpackage]
export-dir = ../build-area/
--- a/src/libprojectM/CMakeLists.txt
+++ b/src/libprojectM/CMakeLists.txt
@@ -46,11 +46,11 @@
if (USE_NATIVE_GLEW)
ADD_DEFINITIONS(-DUSE_NATIVE_GLEW)
-SET(GLEW_SOURCES glew.h glew.c)
-SET(GLEW_LINK_TARGETS )
+ SET(GLEW_SOURCES glew.h glew.c)
+ SET(GLEW_LIBRARY "")
else(USE_NATIVE_GLEW)
-SET(GLEW_SOURCES )
-SET (GLEW_LINK_TARGETS GLEW)
+ set (GLEW_SOURCES "")
+ find_package (GLEW)
endif(USE_NATIVE_GLEW)
SET(projectM_SOURCES projectM.cpp PCM.cpp Preset.cpp fftsg.cpp KeyHandler.cpp
@@ -118,6 +118,8 @@
ADD_LIBRARY(projectM SHARED ${projectM_SOURCES})
endif(BUILD_PROJECTM_STATIC)
+set_property(TARGET projectM PROPERTY LINK_INTERFACE_LIBRARIES "")
+set_property(TARGET projectM PROPERTY IMPORTED_LINK_DEPENDENT_LIBRARIES "")
SET_TARGET_PROPERTIES(projectM PROPERTIES VERSION 2.0.1 SOVERSION 2)
#ADD_DEFINITIONS(-DUSE_THREADS)
@@ -186,10 +188,10 @@
LINK_DIRECTORIES(${FTGL_LINK_DIRS} ${Renderer_BINARY_DIR} ${PRESET_FACTORY_BINARY_DIR})
if(BUILD_PROJECTM_STATIC)
- TARGET_LINK_LIBRARIES(projectM ${GLEW_LINK_TARGETS} m ${FTGL_LINK_TARGETS} ${OPENGL_LIBRARIES} ${IMAGE_LINK_TARGETS} ${CG_LINK_TARGETS} ${PRESET_FACTORY_LINK_TARGETS})
+ TARGET_LINK_LIBRARIES(projectM Renderer ${IMAGE_LINK_TARGETS} ${CG_LINK_TARGETS} ${PRESET_FACTORY_LINK_TARGETS} ${GLEW_LIBRARY} ${FTGL_LINK_TARGETS} m dl ${OPENGL_LIBRARIES})
else(BUILD_PROJECTM_STATIC)
-TARGET_LINK_LIBRARIES(projectM ${GLEW_LINK_TARGETS} m ${FTGL_LINK_TARGETS} ${OPENGL_LIBRARIES} ${IMAGE_LINK_TARGETS} ${CG_LINK_TARGETS} ${PRESET_FACTORY_LINK_TARGETS})
+TARGET_LINK_LIBRARIES(projectM Renderer ${IMAGE_LINK_TARGETS} ${CG_LINK_TARGETS} ${PRESET_FACTORY_LINK_TARGETS} ${GLEW_LIBRARY} ${FTGL_LINK_TARGETS} m dl ${OPENGL_LIBRARIES} )
endif(BUILD_PROJECTM_STATIC)
--- /dev/null
+++ b/src/libprojectM/cmake/FindGLEW.cmake
@@ -0,0 +1,23 @@
+# - Try to find GLEW
+# Once done this will define
+#
+# GLEW_FOUND - system has GLEW
+# GLEW_INCLUDE_DIR - the GLEW include directory
+# GLEW_LIBRARY - Link these to use GLEW
+#
+
+ FIND_PATH( GLEW_INCLUDE_DIR glew.h wglew.h
+ PATHS /usr/local /usr c:/glew "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK" "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK"
+ PATH_SUFFIXES include include/gl include/GL Include Include/gl Include/GL )
+ FIND_LIBRARY( GLEW_LIBRARY
+ NAMES glew32 glew GLEW
+ PATHS /usr /usr/local c:/glew "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK" "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK"
+ PATH_SUFFIXES lib Lib
+ )
+
+IF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
+ SET(GLEW_FOUND TRUE)
+ SET( GLEW_LIBRARY_DIR ${GLEW_LIBRARY} )
+ELSE (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
+ SET( GLEW_FOUND FALSE )
+ENDIF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
--- a/src/projectM-qt/CMakeLists.txt
+++ b/src/projectM-qt/CMakeLists.txt
@@ -6,6 +6,7 @@
include(cmake/CPack-projectM.cmake)
include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} )
+
include(FindPkgConfig.cmake)
if (${CMAKE_PROJECT_NAME} MATCHES "PROJECTM_ROOT")
set(LIBPROJECTM_FOUND true)
@@ -34,7 +35,7 @@
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/libprojectM-qt.pc.in" "${CMAKE_CURRENT_SOURCE_DIR}/libprojectM-qt.pc" @ONLY)
-ADD_DEFINITIONS(-DLINUX -DPROJECTM_PREFIX='"${PROJECTM_PREFIX}"')
+ADD_DEFINITIONS(-DLINUX -DPROJECTM_PREFIX="\"${PROJECTM_PREFIX}\"")
ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_NO_DEBUG)
@@ -97,7 +98,7 @@
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
-endif(COMMAND cmake_policy)
+endif(COMMAND cmake_policy)
if (BUILD_PROJECTM_QT_STATIC)
ADD_LIBRARY(projectM-qt STATIC ${projectM-qt_SRCS} ${projectM-qt_RC_SRCS} ${projectM-qt_MOC_SRCS} ${projectM-qt_UIS_H})
@@ -105,6 +106,8 @@
ADD_LIBRARY(projectM-qt SHARED ${projectM-qt_SRCS} ${projectM-qt_RC_SRCS} ${projectM-qt_MOC_SRCS} ${projectM-qt_UIS_H})
endif(BUILD_PROJECTM_QT_STATIC)
+set_property(TARGET projectM-qt PROPERTY LINK_INTERFACE_LIBRARIES "")
+set_property(TARGET projectM-qt PROPERTY IMPORTED_LINK_DEPENDENT_LIBRARIES "")
SET_TARGET_PROPERTIES(projectM-qt PROPERTIES VERSION 1.10 SOVERSION 1)
if (${CMAKE_PROJECT_NAME} MATCHES "PROJECTM_ROOT")
@@ -120,7 +123,7 @@
include_directories(${PROJECTM_INCLUDE} ${QT_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTXML_INCLUDE_DIR} ${QT_QTOPENGL_INCLUDE_DIR} ${CMAKE_CURRENT_LIBRARY_DIR})
# link the "qprojectM" target against the Qt libraries. which libraries exactly, is defined by the "include(${QT_USE_FILE})" line above, which sets up this variable.
-target_link_libraries(projectM-qt projectM ${QT_QTGUI_LIBRARIES} ${QT_QTOPENGL_LIBRARIES} ${QT_QTXML_LIBRARIES} ${QT_LIBRARIES})
+target_link_libraries(projectM-qt projectM GLEW GL ${QT_QTGUI_LIBRARIES} ${QT_QTOPENGL_LIBRARIES} ${QT_QTXML_LIBRARIES} ${QT_LIBRARIES})
install(FILES qprojectm_mainwindow.hpp DESTINATION include/libprojectM-qt)
install(TARGETS projectM-qt DESTINATION lib${LIB_SUFFIX})
--- a/src/libprojectM/libprojectM.pc.in
+++ b/src/libprojectM/libprojectM.pc.in
@@ -8,6 +8,6 @@
Name: libprojectM
Version: 2.0.0
Description: projectM - OpenGL Milkdrop
-Requires:
-Libs: -L${libdir} -lprojectM
-Cflags: -I${includedir}
+Requires: GL GLEW
+Libs: -L${libdir} -lprojectM
+Cflags: -I${includedir}
--- a/src/libprojectM/Renderer/CMakeLists.txt
+++ b/src/libprojectM/Renderer/CMakeLists.txt
@@ -3,8 +3,8 @@
SET(SOIL_SOURCES SOIL/image_DXT.c SOIL/image_helper.c SOIL/SOIL.c SOIL/stb_image_aug.c)
-SET(Renderer_SOURCES FBO.cpp MilkdropWaveform.cpp PerPixelMesh.cpp Pipeline.cpp Renderer.cpp ShaderEngine.cpp UserTexture.cpp Waveform.cpp
-Filters.cpp PerlinNoise.cpp PipelineContext.cpp Renderable.cpp BeatDetect.cpp Shader.cpp TextureManager.cpp VideoEcho.cpp
+SET(Renderer_SOURCES FBO.cpp MilkdropWaveform.cpp PerPixelMesh.cpp Pipeline.cpp Renderer.cpp ShaderEngine.cpp UserTexture.cpp Waveform.cpp
+Filters.cpp PerlinNoise.cpp PipelineContext.cpp Renderable.cpp BeatDetect.cpp Shader.cpp TextureManager.cpp VideoEcho.cpp
RenderItemDistanceMetric.cpp RenderItemMatcher.cpp ${SOIL_SOURCES})
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
@@ -13,4 +13,4 @@
INCLUDE_DIRECTORIES(${projectM_SOURCE_DIR})
ADD_LIBRARY(Renderer STATIC ${Renderer_SOURCES})
SET_TARGET_PROPERTIES(Renderer PROPERTIES VERSION 2.00 SOVERSION 2)
-TARGET_LINK_LIBRARIES(Renderer m)
+TARGET_LINK_LIBRARIES(Renderer m ${OPENGL_LIBRARIES} ${FREETYPE2_LIBRARIES})
......@@ -14,3 +14,4 @@
14_lprojectm_set-numeric.patch
15-gcc46.patch
16_lprojectm-parser.patch
17_lprojectm-linkinflibs.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment