CMakeLists.txt
author Ryan C. Gordon <icculus@icculus.org>
Tue, 22 Apr 2008 00:26:13 -0400
branchtrunk
changeset 174 0eb9e160ff7f
parent 171 4bf769d41b01
child 225 b43efdf651ed
permissions -rw-r--r--
Patched finderrors to build on Linux again.

CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
PROJECT(MojoShader)

IF(CMAKE_COMPILER_IS_GNUCC)
    ADD_DEFINITIONS(-Wall -ggdb3)
ENDIF(CMAKE_COMPILER_IS_GNUCC)

# testparse uses this when I'm looking at memory usage patterns.
#ADD_DEFINITIONS(-DMOJOSHADER_DEBUG_MALLOC=1)

FIND_PACKAGE(SDL)
IF(SDL_FOUND)
    INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
    ADD_DEFINITIONS(-DFINDERRORS_COMPILE_SHADERS=1)
    IF(APPLE)
        FIND_LIBRARY(OPENGL_LIBRARY OpenGL)
        MARK_AS_ADVANCED(OPENGL_LIBRARY)
        SET(EXTRA_LIBS ${OPENGL_LIBRARY})
    ELSE(APPLE)
        SET(EXTRA_LIBS GL)
    ENDIF(APPLE)
ENDIF(SDL_FOUND)

ADD_EXECUTABLE(testparse testparse.c mojoshader.c)
ADD_EXECUTABLE(finderrors finderrors.c mojoshader.c)
TARGET_LINK_LIBRARIES(finderrors ${SDL_LIBRARY} ${EXTRA_LIBS})

# End of CMakeLists.txt ...