From 7ae51442500ad11072da88786f7a08b003ee140e Mon Sep 17 00:00:00 2001 From: Mischa Spiegelmock Date: Sun, 1 Nov 2015 00:29:26 -0700 Subject: [PATCH] SDL2 cmake stuff --- src/CMakeLists.txt | 2 +- src/projectM-sdl/CMakeLists.txt | 10 ++++++---- src/projectM-sdl/cmake_install.cmake | 29 ++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 src/projectM-sdl/cmake_install.cmake diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 06c970d4cd..c1875dad28 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -30,7 +30,7 @@ if(APPLE) SET(INCLUDE-PROJECTM-PULSEAUDIO OFF) SET(INCLUDE-PROJECTM-LIBVISUAL OFF) SET(INCLUDE-PROJECTM-TEST OFF) - SET(INCLUDE-SDL ON) + SET(INCLUDE-PROJECTM-SDL ON) SET(INCLUDE-NATIVE-PRESETS OFF) endif(APPLE) diff --git a/src/projectM-sdl/CMakeLists.txt b/src/projectM-sdl/CMakeLists.txt index 8ce9274e2b..64c2febdad 100644 --- a/src/projectM-sdl/CMakeLists.txt +++ b/src/projectM-sdl/CMakeLists.txt @@ -12,17 +12,19 @@ SET(PROJECTM_INCLUDE ${PROJECTM_ROOT_SOURCE_DIR}/libprojectM ${PROJECTM_ROOT_SOU # we're producing an executable called projectMSDL ADD_EXECUTABLE(projectMSDL projectM_SDL_main.cpp - ${PROJECTM_ROOT_SOURCE_DIR}/libprojectM/PresetFactory.cpp - ${PROJECTM_ROOT_SOURCE_DIR}/libprojectM/KeyHandler.cpp ) # openGL FIND_PACKAGE(OpenGL) +# SDL2 +SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # has FindSDL2 +FIND_PACKAGE(SDL2 REQUIRED) + # link in projectM # i have no idea if this is correct -TARGET_LINK_LIBRARIES(projectMSDL projectM ${OPENGL_LIBRARIES}) +TARGET_LINK_LIBRARIES(projectMSDL projectM ${OPENGL_LIBRARIES} ${SDL2_LIBRARY}) SET(PROJECTM_LINK ${LIBPROJECTM_LDFLAGS}) -INCLUDE_DIRECTORIES(${PROJECTM_INCLUDE}) +INCLUDE_DIRECTORIES(${PROJECTM_INCLUDE} ${SDL2_INCLUDE_DIR}) LINK_DIRECTORIES(${PROJECTM_LINK}) diff --git a/src/projectM-sdl/cmake_install.cmake b/src/projectM-sdl/cmake_install.cmake new file mode 100644 index 0000000000..c39885fbec --- /dev/null +++ b/src/projectM-sdl/cmake_install.cmake @@ -0,0 +1,29 @@ +# Install script for directory: /Users/bobo/dev/projectm/src/projectM-sdl + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() +