Split CMake project into several files
This commit is contained in:
parent
f6cdbabe1c
commit
0960080128
5 changed files with 23 additions and 15 deletions
|
@ -5,18 +5,4 @@ include(UseJava)
|
|||
|
||||
project(Lox NONE)
|
||||
|
||||
add_custom_command(OUTPUT com/craftinginterpreters/lox/Expr.java
|
||||
COMMAND java -jar GenerateAst.jar com/craftinginterpreters/lox
|
||||
DEPENDS GenerateAst)
|
||||
|
||||
add_jar(Lox
|
||||
com/craftinginterpreters/lox/Lox.java
|
||||
com/craftinginterpreters/lox/TokenType.java
|
||||
com/craftinginterpreters/lox/Token.java
|
||||
com/craftinginterpreters/lox/Expr.java
|
||||
com/craftinginterpreters/lox/AstPrinter.java
|
||||
ENTRY_POINT com/craftinginterpreters/lox/Lox)
|
||||
|
||||
add_jar(GenerateAst
|
||||
com/craftinginterpreters/tool/GenerateAst.java
|
||||
ENTRY_POINT com/craftinginterpreters/tool/GenerateAst)
|
||||
add_subdirectory(com/craftinginterpreters)
|
||||
|
|
2
src/com/craftinginterpreters/CMakeLists.txt
Normal file
2
src/com/craftinginterpreters/CMakeLists.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
add_subdirectory(tool)
|
||||
add_subdirectory(lox)
|
1
src/com/craftinginterpreters/lox/.gitignore
vendored
Normal file
1
src/com/craftinginterpreters/lox/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
Expr.java
|
16
src/com/craftinginterpreters/lox/CMakeLists.txt
Normal file
16
src/com/craftinginterpreters/lox/CMakeLists.txt
Normal file
|
@ -0,0 +1,16 @@
|
|||
get_target_property(GENERATE_AST_JAR GenerateAst JAR_FILE)
|
||||
|
||||
set(EXPR_JAVA_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/Expr.java CACHE INTERNAL "")
|
||||
|
||||
add_custom_command(OUTPUT ${EXPR_JAVA_FILENAME}
|
||||
COMMAND java -jar ${GENERATE_AST_JAR} ${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS GenerateAst)
|
||||
|
||||
add_jar(Lox
|
||||
Lox.java
|
||||
TokenType.java
|
||||
Token.java
|
||||
Scanner.java
|
||||
${EXPR_JAVA_FILENAME}
|
||||
AstPrinter.java
|
||||
ENTRY_POINT com/craftinginterpreters/lox/Lox)
|
3
src/com/craftinginterpreters/tool/CMakeLists.txt
Normal file
3
src/com/craftinginterpreters/tool/CMakeLists.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
add_jar(GenerateAst
|
||||
GenerateAst.java
|
||||
ENTRY_POINT com/craftinginterpreters/tool/GenerateAst)
|
Loading…
Reference in a new issue