Skip to content

Commit

Permalink
SDL2 cmake stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
revmischa committed Nov 1, 2015
1 parent e470e81 commit 7ae5144
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
10 changes: 6 additions & 4 deletions src/projectM-sdl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

29 changes: 29 additions & 0 deletions src/projectM-sdl/cmake_install.cmake
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 7ae5144

Please sign in to comment.