PageRenderTime 1ms CodeModel.GetById 12ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 1ms

/xbmc/visualizations/XBMCProjectM/libprojectM/CMakeLists.txt

http://github.com/xbmc/xbmc
CMake | 144 lines | 106 code | 34 blank | 4 comment | 22 complexity | 3cd7f0bbb7164b8eb2f662f9d457cb43 MD5 | raw file
  1PROJECT(projectM)
  2
  3cmake_minimum_required(VERSION 2.6)
  4
  5OPTION (USE_DEVIL "Use devIL for image loading rather than the builtin SOIL library" OFF)
  6
  7OPTION (USE_FBO "Use Framebuffer Objects for increased rendering quality.  Disable this for OpenGL ES 1.x or if you are experiencing problems on older or poorly supported hardware." ON)
  8
  9OPTION (USE_GLES1 "Use OpenGL ES 1.x" OFF)
 10
 11
 12OPTION (USE_NATIVE_GLEW "Use projectM's native implemention of GLEW." OFF)
 13
 14#OPTION (FTGL_STATIC "Build the projectM target library in the platform's native static (NOT shared) format." OFF)
 15
 16OPTION (BUILD_PROJECTM_STATIC "Build the projectM target library in the platform's native static (NOT shared) format." OFF)
 17SET(SOIL_SOURCES image_DXT.c image_helper.c SOIL.c stb_image_aug.c)
 18
 19if (USE_NATIVE_GLEW)
 20ADD_DEFINITIONS(-DUSE_NATIVE_GLEW)
 21SET(GLEW_SOURCES glew.h glew.c)
 22SET(GLEW_LINK_TARGETS )
 23else(USE_NATIVE_GLEW)
 24SET(GLEW_SOURCES )
 25SET (GLEW_LINK_TARGETS GLEW)
 26endif(USE_NATIVE_GLEW)
 27
 28SET(projectM_SOURCES projectM.cpp FBO.cpp InitCond.cpp 
 29 Expr.cpp PCM.cpp Parser.cpp Preset.cpp BeatDetect.cpp PerPixelEqn.cpp Param.cpp CustomWave.cpp CustomShape.cpp 
 30Func.cpp Eval.cpp  PerFrameEqn.cpp PerPointEqn.cpp fftsg.cpp KeyHandler.cpp
 31 timer.cpp  wipemalloc.cpp BuiltinFuncs.cpp BuiltinParams.cpp Renderer.cpp 
 32PresetLoader.cpp  PresetChooser.cpp PresetFrameIO.cpp PresetMerge.cpp
 33ConfigFile.cpp  IdlePreset.cpp TextureManager.cpp TimeKeeper.cpp ${GLEW_SOURCES})
 34
 35if (USE_DEVIL)
 36SET (projectM_SOURCES ${projectM_SOURCES})
 37ADD_DEFINITIONS(-DUSE_DEVIL)
 38SET (IMAGE_LINK_TARGETS IL ILU ILUT)
 39else (USE_DEVIL)
 40SET (projectM_SOURCES ${projectM_SOURCES} ${SOIL_SOURCES})
 41SET (IMAGE_LINK_TARGETS )
 42endif (USE_DEVIL)
 43
 44if(USE_GLES1)
 45ADD_DEFINITIONS(-DUSE_GLES1)
 46endif(USE_GLES1)
 47
 48if(USE_FBO)
 49ADD_DEFINITIONS(-DUSE_FBO)
 50endif(USE_FBO)
 51
 52if (BUILD_PROJECTM_STATIC)
 53ADD_LIBRARY(projectM STATIC ${projectM_SOURCES})
 54else(BUILD_PROJECTM_STATIC)
 55ADD_LIBRARY(projectM SHARED ${projectM_SOURCES})
 56endif(BUILD_PROJECTM_STATIC)
 57
 58SET_TARGET_PROPERTIES(projectM PROPERTIES VERSION 2.00 SOVERSION 2)
 59
 60if (APPLE)
 61ADD_DEFINITIONS(-DMACOS -DSTBI_NO_DDS)
 62set(RESOURCE_PREFIX "Resources" )
 63FIND_LIBRARY(CORE_FOUNDATION_LIBRARY CoreFoundation )
 64MARK_AS_ADVANCED (CORE_FOUNDATION_LIBRARY)
 65set(EXTRA_LIBS ${CORE_FOUNDATION_LIBRARY})
 66set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" ) 
 67set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" ) 
 68else (APPLE)
 69if (WIN32)
 70set (RESOURCE_PREFIX "Resources")
 71ADD_DEFINITIONS(-DWIN32 -DSTBI_NO_DDS)
 72else(WIN32)
 73set (RESOURCE_PREFIX "share/projectM")
 74ADD_DEFINITIONS(-DLINUX -DSTBI_NO_DDS)
 75endif(WIN32)
 76endif(APPLE)
 77
 78ADD_DEFINITIONS(-DCMAKE_INSTALL_PREFIX="\\\"${CMAKE_INSTALL_PREFIX}\\\"") 
 79
 80FIND_PACKAGE(OpenGL)
 81
 82INCLUDE(FindPkgConfig.cmake)
 83
 84pkg_search_module (FTGL ftgl)
 85
 86if (FTGL_FOUND)
 87	OPTION(USE_FTGL "Use FTGL for on-screen fonts (found on your system)" ON)
 88else (FTGL_FOUND)	
 89	OPTION(USE_FTGL "Use FTGL for on-screen fonts (Warning: NOT found on your system! Turning this on will probably bust the compilation.)" OFF)
 90endif(FTGL_FOUND)
 91
 92#set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH};/opt/local/include;/Developer/SDKs/MACOSX10.5.sdk/usr/X11/include)
 93#set(CMAKE_LIBRARY_PATH /opt/local/lib;/Developer/SDKs/MACOSX10.5.sdk;/Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/)
 94
 95IF(USE_FTGL)
 96	if (FTGL_FOUND)
 97		MESSAGE(STATUS "[projectM] FTGL font support was detected and enabled.")
 98	else (FTGL_FOUND)
 99		MESSAGE(STATUS 
100	"[projectM] Warning! FTGL has been enabled but not detected. Your compilation will probably break. Turn off FTGL support by setting USE_FTGL to false, or visit http://ftgl.wiki.sourceforge.net/ for help on installing FTGL.")
101	endif (FTGL_FOUND)
102	
103	ADD_DEFINITIONS(-DUSE_FTGL)
104	
105	set (FTGL_INCUDE_DIRS ${FTGL_INCLUDE_DIRS} ${CMAKE_INCLUDE_PATH} ${OPENGL_INCLUDE_DIR})
106	set (FTGL_LINK_DIRS ${FTGL_LIBRARY_DIRS} )
107	set (FTGL_LINK_TARGETS ftgl freetype)
108	
109ELSE (USE_FTGL)
110	IF (FTGL_FOUND)
111		MESSAGE(STATUS "[projectM] Warning: FTGL font support was detected but NOT enabled. You can enable it by setting USE_FTGL=true")
112	ELSE (FTGL_FOUND)
113		MESSAGE(STATUS "[projectM] Warning: FTGL font support was not detected. Visit http://ftgl.wiki.sourceforge.net/ for help on installing FTGL.")
114	ENDIF(FTGL_FOUND)
115	
116	# todo: change this because its obscure and probably not being used
117	set (FTGL_INCLUDE_DIRS "/opt/local/include")
118	set (FTGL_LINK_DIRS)
119	set (FTGL_LINK_TARGETS )
120ENDIF(USE_FTGL)
121
122
123
124INCLUDE_DIRECTORIES(${FTGL_INCLUDE_DIRS})
125LINK_DIRECTORIES(${FTGL_LINK_DIRS} "./")
126
127if(BUILD_PROJECTM_STATIC)
128		TARGET_LINK_LIBRARIES(projectM ${GLEW_LINK_TARGETS} m ${FTGL_LINK_TARGETS} ${OPENGL_LIBRARIES} ${IMAGE_LINK_TARGETS} ${EXTRA_LIBS} )
129else(BUILD_PROJECTM_STATIC)
130		TARGET_LINK_LIBRARIES(projectM ${GLEW_LINK_TARGETS} m ${FTGL_LINK_TARGETS} ${OPENGL_LIBRARIES} ${IMAGE_LINK_TARGETS} ${EXTRA_LIBS} )
131endif(BUILD_PROJECTM_STATIC)
132
133
134CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/libprojectM.pc.in" "${CMAKE_CURRENT_SOURCE_DIR}/libprojectM.pc" @ONLY)
135CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/config.inp.in" "${CMAKE_CURRENT_SOURCE_DIR}/config.inp" @ONLY)
136
137FILE(GLOB presets "presets/*.milk" "presets/*.prjm" "presets/*.tga")
138INSTALL(FILES ${presets} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/projectM/presets)
139FILE(GLOB fonts "fonts/*.ttf")
140INSTALL(FILES ${fonts} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/projectM/fonts)
141INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/libprojectM.pc" DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig)
142INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/config.inp DESTINATION ${CMAKE_INSTALL_PREFIX}/share/projectM)
143INSTALL(FILES projectM.hpp event.h dlldefs.h fatal.h PresetFrameIO.hpp PCM.hpp  DESTINATION include/libprojectM)
144INSTALL(TARGETS projectM DESTINATION lib${LIB_SUFFIX})