From 48521823e328fcb0e5dc7dadc065d17ade0a1bf1 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Mon, 7 Jun 2010 11:37:37 +0000 Subject: [PATCH] Link to glew and dlfcn properly on windows --- 3rdparty/libprojectm/CMakeLists.txt | 10 +++++----- .../libprojectm/NativePresetFactory/CMakeLists.txt | 6 +++++- .../NativePresetFactory/NativePresetFactory.cpp | 5 ++++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/3rdparty/libprojectm/CMakeLists.txt b/3rdparty/libprojectm/CMakeLists.txt index 0c5d42ee4..f3c36de39 100644 --- a/3rdparty/libprojectm/CMakeLists.txt +++ b/3rdparty/libprojectm/CMakeLists.txt @@ -31,12 +31,12 @@ OPTION (DISABLE_MILKDROP_PRESETS "Turn off support for Milkdrop (.milk / .prjm) ADD_DEFINITIONS(-DCMAKE_INSTALL_PREFIX="\\\"${CMAKE_INSTALL_PREFIX}\\\"") if (USE_NATIVE_GLEW) -ADD_DEFINITIONS(-DUSE_NATIVE_GLEW) -SET(GLEW_SOURCES glew.h glew.c) -SET(GLEW_LINK_TARGETS ) + ADD_DEFINITIONS(-DUSE_NATIVE_GLEW) + SET(GLEW_SOURCES glew.h glew.c) + SET(GLEW_LINK_TARGETS ) else(USE_NATIVE_GLEW) -SET(GLEW_SOURCES ) -SET (GLEW_LINK_TARGETS GLEW) + SET(GLEW_SOURCES ) + find_library(GLEW_LINK_TARGETS NAMES glew GLEW glew32) endif(USE_NATIVE_GLEW) SET(projectM_SOURCES projectM.cpp PCM.cpp Preset.cpp fftsg.cpp KeyHandler.cpp diff --git a/3rdparty/libprojectm/NativePresetFactory/CMakeLists.txt b/3rdparty/libprojectm/NativePresetFactory/CMakeLists.txt index 2e7f766d1..cf72bd9e3 100644 --- a/3rdparty/libprojectm/NativePresetFactory/CMakeLists.txt +++ b/3rdparty/libprojectm/NativePresetFactory/CMakeLists.txt @@ -7,6 +7,10 @@ cmake_minimum_required(VERSION 2.4.0) SET(NativePresetFactory_SOURCES NativePresetFactory.cpp) +if(WIN32) + find_library(DL_LIBRARIES dl) +endif(WIN32) + if(MSVC) SET (MATH_LIBRARIES ) else(MSVC) @@ -16,4 +20,4 @@ endif(MSVC) INCLUDE_DIRECTORIES(${projectM_SOURCE_DIR} ${Renderer_SOURCE_DIR}) ADD_LIBRARY(NativePresetFactory STATIC ${NativePresetFactory_SOURCES}) SET_TARGET_PROPERTIES(NativePresetFactory PROPERTIES VERSION 2.00 SOVERSION 2) -TARGET_LINK_LIBRARIES(NativePresetFactory Renderer ${MATH_LIBRARIES}) +TARGET_LINK_LIBRARIES(NativePresetFactory Renderer ${MATH_LIBRARIES} ${DL_LIBRARIES}) diff --git a/3rdparty/libprojectm/NativePresetFactory/NativePresetFactory.cpp b/3rdparty/libprojectm/NativePresetFactory/NativePresetFactory.cpp index 5306a8390..529d82528 100644 --- a/3rdparty/libprojectm/NativePresetFactory/NativePresetFactory.cpp +++ b/3rdparty/libprojectm/NativePresetFactory/NativePresetFactory.cpp @@ -10,7 +10,10 @@ // // -#include +extern "C" { +# include +} + #include "NativePresetFactory.hpp" typedef void Handle;