author | Ryan C. Gordon <icculus@icculus.org> |
Mon, 08 Feb 2010 02:42:12 -0500 | |
branch | calculator-experiment |
changeset 811 | 307e3ab506fa |
parent 810 | 367f7133bd71 |
child 828 | 32b964418dcc |
permissions | -rw-r--r-- |
711
d547597e81de
Cleaned up some CMake issues.
Ryan C. Gordon <icculus@icculus.org>
parents:
710
diff
changeset
|
1 |
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) |
35 | 2 |
PROJECT(MojoShader) |
48 | 3 |
|
588
ef3d2efa822d
Moved all the test and utility programs to a "utils" directory.
Ryan C. Gordon <icculus@icculus.org>
parents:
569
diff
changeset
|
4 |
INCLUDE_DIRECTORIES(.) |
ef3d2efa822d
Moved all the test and utility programs to a "utils" directory.
Ryan C. Gordon <icculus@icculus.org>
parents:
569
diff
changeset
|
5 |
|
569
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
6 |
FIND_PROGRAM(HG hg DOC "Path to hg command line app: http://www.selenic.com/mercurial/") |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
7 |
IF(NOT HG) |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
8 |
MESSAGE(STATUS "Mercurial (hg) not found. You can go on, but version info will be wrong.") |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
9 |
SET(MOJOSHADER_VERSION -1) |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
10 |
SET(MOJOSHADER_CHANGESET "???") |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
11 |
ELSE(NOT HG) |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
12 |
MARK_AS_ADVANCED(HG) |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
13 |
EXECUTE_PROCESS( |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
14 |
COMMAND hg tip --template {rev} |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
15 |
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
16 |
RESULT_VARIABLE HGVERSION_RC |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
17 |
OUTPUT_VARIABLE MOJOSHADER_VERSION |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
18 |
ERROR_QUIET |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
19 |
OUTPUT_STRIP_TRAILING_WHITESPACE |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
20 |
) |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
21 |
EXECUTE_PROCESS( |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
22 |
COMMAND hg tip --template hg-{rev}:{node|short} |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
23 |
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
24 |
RESULT_VARIABLE HGVERSION_RC |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
25 |
OUTPUT_VARIABLE MOJOSHADER_CHANGESET |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
26 |
ERROR_QUIET |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
27 |
OUTPUT_STRIP_TRAILING_WHITESPACE |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
28 |
) |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
29 |
ENDIF(NOT HG) |
455
d99f47386d51
Generate MOJOSHADER_VERSION, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
423
diff
changeset
|
30 |
|
d99f47386d51
Generate MOJOSHADER_VERSION, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
423
diff
changeset
|
31 |
WRITE_FILE( |
d99f47386d51
Generate MOJOSHADER_VERSION, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
423
diff
changeset
|
32 |
"${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_version.h" |
d99f47386d51
Generate MOJOSHADER_VERSION, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
423
diff
changeset
|
33 |
"/* This file was autogenerated. Do not edit! */\n" |
d99f47386d51
Generate MOJOSHADER_VERSION, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
423
diff
changeset
|
34 |
"#ifndef _INCL_MOJOSHADER_VERSION_H_\n" |
d99f47386d51
Generate MOJOSHADER_VERSION, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
423
diff
changeset
|
35 |
"#define _INCL_MOJOSHADER_VERSION_H_\n" |
d99f47386d51
Generate MOJOSHADER_VERSION, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
423
diff
changeset
|
36 |
"#define MOJOSHADER_VERSION ${MOJOSHADER_VERSION}\n" |
d99f47386d51
Generate MOJOSHADER_VERSION, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
423
diff
changeset
|
37 |
"#define MOJOSHADER_CHANGESET \"${MOJOSHADER_CHANGESET}\"\n" |
d99f47386d51
Generate MOJOSHADER_VERSION, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
423
diff
changeset
|
38 |
"#endif\n" |
d99f47386d51
Generate MOJOSHADER_VERSION, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
423
diff
changeset
|
39 |
) |
d99f47386d51
Generate MOJOSHADER_VERSION, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
423
diff
changeset
|
40 |
|
48 | 41 |
IF(CMAKE_COMPILER_IS_GNUCC) |
42 |
ADD_DEFINITIONS(-Wall -ggdb3) |
|
43 |
ENDIF(CMAKE_COMPILER_IS_GNUCC) |
|
44 |
||
52 | 45 |
# testparse uses this when I'm looking at memory usage patterns. |
46 |
#ADD_DEFINITIONS(-DMOJOSHADER_DEBUG_MALLOC=1) |
|
48 | 47 |
|
254 | 48 |
IF(MSVC) |
49 |
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS=1) |
|
50 |
ADD_DEFINITIONS(-TP) # force .c files to compile as C++. |
|
51 |
ENDIF(MSVC) |
|
52 |
||
706
01a92f30b84f
Added some basic compiler stub stuff, just to get this building at all.
Ryan C. Gordon <icculus@icculus.org>
parents:
705
diff
changeset
|
53 |
# We build lemon, then use it to generate parser C code. |
01a92f30b84f
Added some basic compiler stub stuff, just to get this building at all.
Ryan C. Gordon <icculus@icculus.org>
parents:
705
diff
changeset
|
54 |
ADD_EXECUTABLE(lemon "misc/lemon.c") |
01a92f30b84f
Added some basic compiler stub stuff, just to get this building at all.
Ryan C. Gordon <icculus@icculus.org>
parents:
705
diff
changeset
|
55 |
GET_TARGET_PROPERTY(LEMON lemon LOCATION) |
01a92f30b84f
Added some basic compiler stub stuff, just to get this building at all.
Ryan C. Gordon <icculus@icculus.org>
parents:
705
diff
changeset
|
56 |
ADD_CUSTOM_COMMAND( |
714
e8ed66bfff18
Make parser generate a header, to avoid external project build confusion.
Ryan C. Gordon <icculus@icculus.org>
parents:
711
diff
changeset
|
57 |
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_parser_hlsl.h" |
711
d547597e81de
Cleaned up some CMake issues.
Ryan C. Gordon <icculus@icculus.org>
parents:
710
diff
changeset
|
58 |
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_parser_hlsl.lemon" |
d547597e81de
Cleaned up some CMake issues.
Ryan C. Gordon <icculus@icculus.org>
parents:
710
diff
changeset
|
59 |
DEPENDS lemon "${CMAKE_CURRENT_SOURCE_DIR}/misc/lempar.c" |
706
01a92f30b84f
Added some basic compiler stub stuff, just to get this building at all.
Ryan C. Gordon <icculus@icculus.org>
parents:
705
diff
changeset
|
60 |
COMMAND "${LEMON}" |
810
367f7133bd71
Don't suppress #line directives in lemon output.
Ryan C. Gordon <icculus@icculus.org>
parents:
738
diff
changeset
|
61 |
ARGS -q "-T${CMAKE_CURRENT_SOURCE_DIR}/misc/lempar.c" "${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_parser_hlsl.lemon" |
706
01a92f30b84f
Added some basic compiler stub stuff, just to get this building at all.
Ryan C. Gordon <icculus@icculus.org>
parents:
705
diff
changeset
|
62 |
) |
01a92f30b84f
Added some basic compiler stub stuff, just to get this building at all.
Ryan C. Gordon <icculus@icculus.org>
parents:
705
diff
changeset
|
63 |
|
465
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
455
diff
changeset
|
64 |
ADD_LIBRARY(mojoshader STATIC |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
455
diff
changeset
|
65 |
mojoshader.c |
732
e070fea1f8c7
Added mojoshader_common.c with first shot at generic hashtable.
Ryan C. Gordon <icculus@icculus.org>
parents:
714
diff
changeset
|
66 |
mojoshader_common.c |
706
01a92f30b84f
Added some basic compiler stub stuff, just to get this building at all.
Ryan C. Gordon <icculus@icculus.org>
parents:
705
diff
changeset
|
67 |
mojoshader_compiler.c |
555
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
473
diff
changeset
|
68 |
mojoshader_preprocessor.c |
940821555fda
Initial work on preprocessor. Not yet complete!
Ryan C. Gordon <icculus@icculus.org>
parents:
473
diff
changeset
|
69 |
mojoshader_lexer.c |
465
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
455
diff
changeset
|
70 |
mojoshader_assembler.c |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
455
diff
changeset
|
71 |
mojoshader_opengl.c |
0a75f98f785b
Initial work on assembler. Not even close to done.
Ryan C. Gordon <icculus@icculus.org>
parents:
455
diff
changeset
|
72 |
) |
415
25ca83d8bbd5
Build mojoshader.c and mojoshader_opengl.c into a static library.
Ryan C. Gordon <icculus@icculus.org>
parents:
406
diff
changeset
|
73 |
|
711
d547597e81de
Cleaned up some CMake issues.
Ryan C. Gordon <icculus@icculus.org>
parents:
710
diff
changeset
|
74 |
SET_SOURCE_FILES_PROPERTIES( |
d547597e81de
Cleaned up some CMake issues.
Ryan C. Gordon <icculus@icculus.org>
parents:
710
diff
changeset
|
75 |
mojoshader_compiler.c |
714
e8ed66bfff18
Make parser generate a header, to avoid external project build confusion.
Ryan C. Gordon <icculus@icculus.org>
parents:
711
diff
changeset
|
76 |
PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_parser_hlsl.h" |
711
d547597e81de
Cleaned up some CMake issues.
Ryan C. Gordon <icculus@icculus.org>
parents:
710
diff
changeset
|
77 |
) |
d547597e81de
Cleaned up some CMake issues.
Ryan C. Gordon <icculus@icculus.org>
parents:
710
diff
changeset
|
78 |
|
811
307e3ab506fa
Start of experiment with a basic calculator.
Ryan C. Gordon <icculus@icculus.org>
parents:
810
diff
changeset
|
79 |
# Calculator test stuff... |
307e3ab506fa
Start of experiment with a basic calculator.
Ryan C. Gordon <icculus@icculus.org>
parents:
810
diff
changeset
|
80 |
ADD_CUSTOM_COMMAND( |
307e3ab506fa
Start of experiment with a basic calculator.
Ryan C. Gordon <icculus@icculus.org>
parents:
810
diff
changeset
|
81 |
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/calculator.h" |
307e3ab506fa
Start of experiment with a basic calculator.
Ryan C. Gordon <icculus@icculus.org>
parents:
810
diff
changeset
|
82 |
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/calculator.lemon" |
307e3ab506fa
Start of experiment with a basic calculator.
Ryan C. Gordon <icculus@icculus.org>
parents:
810
diff
changeset
|
83 |
DEPENDS lemon "${CMAKE_CURRENT_SOURCE_DIR}/misc/lempar.c" |
307e3ab506fa
Start of experiment with a basic calculator.
Ryan C. Gordon <icculus@icculus.org>
parents:
810
diff
changeset
|
84 |
COMMAND "${LEMON}" |
307e3ab506fa
Start of experiment with a basic calculator.
Ryan C. Gordon <icculus@icculus.org>
parents:
810
diff
changeset
|
85 |
ARGS -q "-T${CMAKE_CURRENT_SOURCE_DIR}/misc/lempar.c" "${CMAKE_CURRENT_SOURCE_DIR}/calculator.lemon" |
307e3ab506fa
Start of experiment with a basic calculator.
Ryan C. Gordon <icculus@icculus.org>
parents:
810
diff
changeset
|
86 |
) |
307e3ab506fa
Start of experiment with a basic calculator.
Ryan C. Gordon <icculus@icculus.org>
parents:
810
diff
changeset
|
87 |
SET_SOURCE_FILES_PROPERTIES( |
307e3ab506fa
Start of experiment with a basic calculator.
Ryan C. Gordon <icculus@icculus.org>
parents:
810
diff
changeset
|
88 |
calculator.c |
307e3ab506fa
Start of experiment with a basic calculator.
Ryan C. Gordon <icculus@icculus.org>
parents:
810
diff
changeset
|
89 |
PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/calculator.h" |
307e3ab506fa
Start of experiment with a basic calculator.
Ryan C. Gordon <icculus@icculus.org>
parents:
810
diff
changeset
|
90 |
) |
307e3ab506fa
Start of experiment with a basic calculator.
Ryan C. Gordon <icculus@icculus.org>
parents:
810
diff
changeset
|
91 |
ADD_EXECUTABLE(calculator calculator.c) |
307e3ab506fa
Start of experiment with a basic calculator.
Ryan C. Gordon <icculus@icculus.org>
parents:
810
diff
changeset
|
92 |
TARGET_LINK_LIBRARIES(calculator mojoshader) |
307e3ab506fa
Start of experiment with a basic calculator.
Ryan C. Gordon <icculus@icculus.org>
parents:
810
diff
changeset
|
93 |
|
569
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
94 |
FIND_PROGRAM(RE2C re2c DOC "Path to re2c command line app: http://re2c.org/") |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
95 |
IF(NOT RE2C) |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
96 |
MESSAGE(STATUS "re2c missing. You can go on, but can't rebuild the lexer.") |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
97 |
ELSE(NOT RE2C) |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
98 |
MARK_AS_ADVANCED(RE2C) |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
99 |
ADD_CUSTOM_COMMAND( |
705
7ea12a852213
Throw some quotes around strings in CMakeLists.txt ...
Ryan C. Gordon <icculus@icculus.org>
parents:
669
diff
changeset
|
100 |
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_lexer.c" |
569
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
101 |
DEPENDS mojoshader_lexer.re |
705
7ea12a852213
Throw some quotes around strings in CMakeLists.txt ...
Ryan C. Gordon <icculus@icculus.org>
parents:
669
diff
changeset
|
102 |
COMMAND "${RE2C}" |
7ea12a852213
Throw some quotes around strings in CMakeLists.txt ...
Ryan C. Gordon <icculus@icculus.org>
parents:
669
diff
changeset
|
103 |
ARGS -is --no-generation-date -o "${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_lexer.c" "${CMAKE_CURRENT_SOURCE_DIR}/mojoshader_lexer.re" |
569
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
104 |
) |
117d6e606c4e
Cleaned up CMakeLists.txt to work in the absence of external tools.
Ryan C. Gordon <icculus@icculus.org>
parents:
563
diff
changeset
|
105 |
ENDIF(NOT RE2C) |
563
d22551643fcb
Added re2c step to build.
Ryan C. Gordon <icculus@icculus.org>
parents:
555
diff
changeset
|
106 |
|
333
2b36a1d72fa1
Wrote most of the arb1 OpenGL glue code.
Ryan C. Gordon <icculus@icculus.org>
parents:
328
diff
changeset
|
107 |
FIND_PACKAGE(SDL) |
169
7e9d90724cf8
Push parsed shaders through GLSL compiler to see what breaks.
Ryan C. Gordon <icculus@icculus.org>
parents:
153
diff
changeset
|
108 |
IF(SDL_FOUND) |
7e9d90724cf8
Push parsed shaders through GLSL compiler to see what breaks.
Ryan C. Gordon <icculus@icculus.org>
parents:
153
diff
changeset
|
109 |
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR}) |
588
ef3d2efa822d
Moved all the test and utility programs to a "utils" directory.
Ryan C. Gordon <icculus@icculus.org>
parents:
569
diff
changeset
|
110 |
ADD_EXECUTABLE(glcaps utils/glcaps.c) |
269 | 111 |
TARGET_LINK_LIBRARIES(glcaps ${SDL_LIBRARY}) |
588
ef3d2efa822d
Moved all the test and utility programs to a "utils" directory.
Ryan C. Gordon <icculus@icculus.org>
parents:
569
diff
changeset
|
112 |
ADD_EXECUTABLE(bestprofile utils/bestprofile.c) |
415
25ca83d8bbd5
Build mojoshader.c and mojoshader_opengl.c into a static library.
Ryan C. Gordon <icculus@icculus.org>
parents:
406
diff
changeset
|
113 |
TARGET_LINK_LIBRARIES(bestprofile mojoshader ${SDL_LIBRARY}) |
588
ef3d2efa822d
Moved all the test and utility programs to a "utils" directory.
Ryan C. Gordon <icculus@icculus.org>
parents:
569
diff
changeset
|
114 |
ADD_EXECUTABLE(availableprofiles utils/availableprofiles.c) |
423
ee393c1cf3b4
Added availableprofiles.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
415
diff
changeset
|
115 |
TARGET_LINK_LIBRARIES(availableprofiles mojoshader ${SDL_LIBRARY}) |
169
7e9d90724cf8
Push parsed shaders through GLSL compiler to see what breaks.
Ryan C. Gordon <icculus@icculus.org>
parents:
153
diff
changeset
|
116 |
ENDIF(SDL_FOUND) |
7e9d90724cf8
Push parsed shaders through GLSL compiler to see what breaks.
Ryan C. Gordon <icculus@icculus.org>
parents:
153
diff
changeset
|
117 |
|
711
d547597e81de
Cleaned up some CMake issues.
Ryan C. Gordon <icculus@icculus.org>
parents:
710
diff
changeset
|
118 |
ADD_EXECUTABLE(finderrors utils/finderrors.c) |
d547597e81de
Cleaned up some CMake issues.
Ryan C. Gordon <icculus@icculus.org>
parents:
710
diff
changeset
|
119 |
TARGET_LINK_LIBRARIES(finderrors mojoshader ${SDL_LIBRARY}) |
d547597e81de
Cleaned up some CMake issues.
Ryan C. Gordon <icculus@icculus.org>
parents:
710
diff
changeset
|
120 |
IF(SDL_FOUND) |
d547597e81de
Cleaned up some CMake issues.
Ryan C. Gordon <icculus@icculus.org>
parents:
710
diff
changeset
|
121 |
SET_SOURCE_FILES_PROPERTIES( |
d547597e81de
Cleaned up some CMake issues.
Ryan C. Gordon <icculus@icculus.org>
parents:
710
diff
changeset
|
122 |
utils/finderrors.c |
d547597e81de
Cleaned up some CMake issues.
Ryan C. Gordon <icculus@icculus.org>
parents:
710
diff
changeset
|
123 |
PROPERTIES COMPILE_FLAGS "-DFINDERRORS_COMPILE_SHADERS=1" |
d547597e81de
Cleaned up some CMake issues.
Ryan C. Gordon <icculus@icculus.org>
parents:
710
diff
changeset
|
124 |
) |
d547597e81de
Cleaned up some CMake issues.
Ryan C. Gordon <icculus@icculus.org>
parents:
710
diff
changeset
|
125 |
ENDIF(SDL_FOUND) |
d547597e81de
Cleaned up some CMake issues.
Ryan C. Gordon <icculus@icculus.org>
parents:
710
diff
changeset
|
126 |
|
588
ef3d2efa822d
Moved all the test and utility programs to a "utils" directory.
Ryan C. Gordon <icculus@icculus.org>
parents:
569
diff
changeset
|
127 |
ADD_EXECUTABLE(testparse utils/testparse.c) |
415
25ca83d8bbd5
Build mojoshader.c and mojoshader_opengl.c into a static library.
Ryan C. Gordon <icculus@icculus.org>
parents:
406
diff
changeset
|
128 |
TARGET_LINK_LIBRARIES(testparse mojoshader) |
588
ef3d2efa822d
Moved all the test and utility programs to a "utils" directory.
Ryan C. Gordon <icculus@icculus.org>
parents:
569
diff
changeset
|
129 |
ADD_EXECUTABLE(testoutput utils/testoutput.c) |
415
25ca83d8bbd5
Build mojoshader.c and mojoshader_opengl.c into a static library.
Ryan C. Gordon <icculus@icculus.org>
parents:
406
diff
changeset
|
130 |
TARGET_LINK_LIBRARIES(testoutput mojoshader) |
669
fd14a7278a95
Merged assemble.c into mojoshader-compiler.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
613
diff
changeset
|
131 |
ADD_EXECUTABLE(mojoshader-compiler utils/mojoshader-compiler.c) |
fd14a7278a95
Merged assemble.c into mojoshader-compiler.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
613
diff
changeset
|
132 |
TARGET_LINK_LIBRARIES(mojoshader-compiler mojoshader) |
1 | 133 |
|
737
d028bf9d8096
Wired up unit tests to CMakefile.
Ryan C. Gordon <icculus@icculus.org>
parents:
732
diff
changeset
|
134 |
# Unit tests... |
d028bf9d8096
Wired up unit tests to CMakefile.
Ryan C. Gordon <icculus@icculus.org>
parents:
732
diff
changeset
|
135 |
ADD_CUSTOM_TARGET( |
d028bf9d8096
Wired up unit tests to CMakefile.
Ryan C. Gordon <icculus@icculus.org>
parents:
732
diff
changeset
|
136 |
test |
d028bf9d8096
Wired up unit tests to CMakefile.
Ryan C. Gordon <icculus@icculus.org>
parents:
732
diff
changeset
|
137 |
COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/unit_tests/run_tests.pl" |
d028bf9d8096
Wired up unit tests to CMakefile.
Ryan C. Gordon <icculus@icculus.org>
parents:
732
diff
changeset
|
138 |
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" |
738
023189c285f6
test command depends on the compiler tool.
Ryan C. Gordon <icculus@icculus.org>
parents:
737
diff
changeset
|
139 |
DEPENDS mojoshader-compiler |
737
d028bf9d8096
Wired up unit tests to CMakefile.
Ryan C. Gordon <icculus@icculus.org>
parents:
732
diff
changeset
|
140 |
COMMENT "Running unit tests..." |
738
023189c285f6
test command depends on the compiler tool.
Ryan C. Gordon <icculus@icculus.org>
parents:
737
diff
changeset
|
141 |
VERBATIM |
737
d028bf9d8096
Wired up unit tests to CMakefile.
Ryan C. Gordon <icculus@icculus.org>
parents:
732
diff
changeset
|
142 |
) |
d028bf9d8096
Wired up unit tests to CMakefile.
Ryan C. Gordon <icculus@icculus.org>
parents:
732
diff
changeset
|
143 |
|
1 | 144 |
# End of CMakeLists.txt ... |
145 |