Skip to content

Latest commit

 

History

History
96 lines (85 loc) · 3.09 KB

CMakeLists.txt

File metadata and controls

96 lines (85 loc) · 3.09 KB
 
Mar 22, 2008
Mar 22, 2008
1
2
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
PROJECT(MojoShader)
Mar 28, 2008
Mar 28, 2008
3
Feb 12, 2009
Feb 12, 2009
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FIND_PROGRAM(HG hg DOC "Path to hg command line app: http://www.selenic.com/mercurial/")
IF(NOT HG)
MESSAGE(STATUS "Mercurial (hg) not found. You can go on, but version info will be wrong.")
SET(MOJOSHADER_VERSION -1)
SET(MOJOSHADER_CHANGESET "???")
ELSE(NOT HG)
MARK_AS_ADVANCED(HG)
EXECUTE_PROCESS(
COMMAND hg tip --template {rev}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE HGVERSION_RC
OUTPUT_VARIABLE MOJOSHADER_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
EXECUTE_PROCESS(
COMMAND hg tip --template hg-{rev}:{node|short}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE HGVERSION_RC
OUTPUT_VARIABLE MOJOSHADER_CHANGESET
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
ENDIF(NOT HG)
Nov 6, 2008
Nov 6, 2008
28
29
30
31
32
33
34
35
36
37
38
WRITE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_version.h"
"/* This file was autogenerated. Do not edit! */\n"
"#ifndef _INCL_MOJOSHADER_VERSION_H_\n"
"#define _INCL_MOJOSHADER_VERSION_H_\n"
"#define MOJOSHADER_VERSION ${MOJOSHADER_VERSION}\n"
"#define MOJOSHADER_CHANGESET \"${MOJOSHADER_CHANGESET}\"\n"
"#endif\n"
)
Mar 28, 2008
Mar 28, 2008
39
40
41
42
IF(CMAKE_COMPILER_IS_GNUCC)
ADD_DEFINITIONS(-Wall -ggdb3)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
Mar 28, 2008
Mar 28, 2008
43
44
# testparse uses this when I'm looking at memory usage patterns.
#ADD_DEFINITIONS(-DMOJOSHADER_DEBUG_MALLOC=1)
Mar 28, 2008
Mar 28, 2008
45
Apr 30, 2008
Apr 30, 2008
46
47
48
49
50
IF(MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS=1)
ADD_DEFINITIONS(-TP) # force .c files to compile as C++.
ENDIF(MSVC)
Dec 5, 2008
Dec 5, 2008
51
52
ADD_LIBRARY(mojoshader STATIC
mojoshader.c
Feb 9, 2009
Feb 9, 2009
53
54
mojoshader_preprocessor.c
mojoshader_lexer.c
Dec 5, 2008
Dec 5, 2008
55
56
57
mojoshader_assembler.c
mojoshader_opengl.c
)
Jun 29, 2008
Jun 29, 2008
58
Feb 12, 2009
Feb 12, 2009
59
60
61
62
63
64
65
66
67
68
69
70
FIND_PROGRAM(RE2C re2c DOC "Path to re2c command line app: http://re2c.org/")
IF(NOT RE2C)
MESSAGE(STATUS "re2c missing. You can go on, but can't rebuild the lexer.")
ELSE(NOT RE2C)
MARK_AS_ADVANCED(RE2C)
ADD_CUSTOM_COMMAND(
OUTPUT mojoshader_lexer.c
DEPENDS mojoshader_lexer.re
COMMAND ${RE2C}
ARGS -s -o ${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_lexer.c ${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_lexer.re
)
ENDIF(NOT RE2C)
Feb 11, 2009
Feb 11, 2009
71
May 28, 2008
May 28, 2008
72
FIND_PACKAGE(SDL)
Apr 22, 2008
Apr 22, 2008
73
74
75
IF(SDL_FOUND)
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
ADD_DEFINITIONS(-DFINDERRORS_COMPILE_SHADERS=1)
May 3, 2008
May 3, 2008
76
77
ADD_EXECUTABLE(glcaps glcaps.c)
TARGET_LINK_LIBRARIES(glcaps ${SDL_LIBRARY})
Jun 29, 2008
Jun 29, 2008
78
79
ADD_EXECUTABLE(bestprofile bestprofile.c)
TARGET_LINK_LIBRARIES(bestprofile mojoshader ${SDL_LIBRARY})
Jul 3, 2008
Jul 3, 2008
80
81
ADD_EXECUTABLE(availableprofiles availableprofiles.c)
TARGET_LINK_LIBRARIES(availableprofiles mojoshader ${SDL_LIBRARY})
Apr 22, 2008
Apr 22, 2008
82
83
ENDIF(SDL_FOUND)
Jun 29, 2008
Jun 29, 2008
84
85
86
87
88
89
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})
Dec 10, 2008
Dec 10, 2008
90
91
ADD_EXECUTABLE(assemble assemble.c)
TARGET_LINK_LIBRARIES(assemble mojoshader)
Feb 9, 2009
Feb 9, 2009
92
93
ADD_EXECUTABLE(preprocess preprocess.c)
TARGET_LINK_LIBRARIES(preprocess mojoshader)
Feb 9, 2008
Feb 9, 2008
94
95
# End of CMakeLists.txt ...