/
CMakeLists.txt
38 lines (30 loc) · 1.2 KB
1
2
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
PROJECT(MojoShader)
3
4
5
6
7
IF(CMAKE_COMPILER_IS_GNUCC)
ADD_DEFINITIONS(-Wall -ggdb3)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
8
9
# testparse uses this when I'm looking at memory usage patterns.
#ADD_DEFINITIONS(-DMOJOSHADER_DEBUG_MALLOC=1)
10
11
12
13
14
15
IF(MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS=1)
ADD_DEFINITIONS(-TP) # force .c files to compile as C++.
ENDIF(MSVC)
16
17
ADD_LIBRARY(mojoshader STATIC mojoshader.c mojoshader_opengl.c)
18
FIND_PACKAGE(SDL)
19
20
21
IF(SDL_FOUND)
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
ADD_DEFINITIONS(-DFINDERRORS_COMPILE_SHADERS=1)
22
23
ADD_EXECUTABLE(glcaps glcaps.c)
TARGET_LINK_LIBRARIES(glcaps ${SDL_LIBRARY})
24
25
ADD_EXECUTABLE(bestprofile bestprofile.c)
TARGET_LINK_LIBRARIES(bestprofile mojoshader ${SDL_LIBRARY})
26
27
ADD_EXECUTABLE(availableprofiles availableprofiles.c)
TARGET_LINK_LIBRARIES(availableprofiles mojoshader ${SDL_LIBRARY})
28
29
ENDIF(SDL_FOUND)
30
31
32
33
34
35
ADD_EXECUTABLE(testparse testparse.c)
TARGET_LINK_LIBRARIES(testparse mojoshader)
ADD_EXECUTABLE(testoutput testoutput.c)
TARGET_LINK_LIBRARIES(testoutput mojoshader)
ADD_EXECUTABLE(finderrors finderrors.c)
TARGET_LINK_LIBRARIES(finderrors mojoshader ${SDL_LIBRARY})
36
37
# End of CMakeLists.txt ...