1
|
cmake_minimum_required(VERSION 2.8.4)
|
2
|
project (lustrec-tests)
|
3
|
include(FindJava)
|
4
|
|
5
|
|
6
|
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/modules)
|
7
|
include(./modules/Lustre_compile.cmake)
|
8
|
include(./modules/Zustre_compile.cmake)
|
9
|
include(./modules/helpful_functions.cmake)
|
10
|
include(./modules/strategies.cmake)
|
11
|
|
12
|
if(LUSTRE_COMPILER)
|
13
|
message(STATUS "lustrec: ${LUSTRE_COMPILER} ")
|
14
|
else(LUSTRE_COMPILER)
|
15
|
message(FATAL_ERROR "lustrec not found")
|
16
|
endif(LUSTRE_COMPILER)
|
17
|
|
18
|
|
19
|
if(ZUSTRE_COMPILER)
|
20
|
message(STATUS "Found zustre: ${ZUSTRE_COMPILER} ")
|
21
|
else(ZUSTRE_COMPILER)
|
22
|
message(STATUS "Zustre not found")
|
23
|
endif(ZUSTRE_COMPILER)
|
24
|
|
25
|
|
26
|
if(JAVA_COMPILE AND EXISTS ${PROJECT_SOURCE_DIR}/modules/XPathParser_lusi.java)
|
27
|
file(COPY ${PROJECT_SOURCE_DIR}/modules/XPathParser_lusi.java ${PROJECT_SOURCE_DIR}/modules/javax.xml-1.3.4.jar DESTINATION ${CMAKE_BINARY_DIR}/modules)
|
28
|
execute_process( COMMAND ${JAVA_COMPILE} -classpath "'.;javax.xml-1.3.4.jar;'" XPathParser_lusi.java
|
29
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules
|
30
|
)
|
31
|
#add_custom_target (XPathParser_lusi ALL
|
32
|
# DEPENDS ${CMAKE_BINARY_DIR}/modules/XPathParser_lusi.class)
|
33
|
else()
|
34
|
message("javac not found")
|
35
|
endif()
|
36
|
|
37
|
if(JAVA_COMPILE AND EXISTS ${PROJECT_SOURCE_DIR}/modules/Generate_inputs_lusi.java)
|
38
|
file(COPY ${PROJECT_SOURCE_DIR}/modules/Generate_inputs_lusi.java DESTINATION ${CMAKE_BINARY_DIR}/modules)
|
39
|
execute_process(#OUTPUT ${CMAKE_BINARY_DIR}/modules/Generate_inputs_lusi.class
|
40
|
COMMAND ${JAVA_COMPILE} Generate_inputs_lusi.java
|
41
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules
|
42
|
)
|
43
|
#add_custom_target (Generate_inputs_lusi ALL
|
44
|
# DEPENDS ${CMAKE_BINARY_DIR}/modules/Generate_inputs_lusi.class)
|
45
|
else()
|
46
|
message("javac not found")
|
47
|
endif()
|
48
|
|
49
|
|
50
|
if(JAVA_COMPILE AND EXISTS ${PROJECT_SOURCE_DIR}/modules/compare_lustrec_outputs.java)
|
51
|
file(COPY ${PROJECT_SOURCE_DIR}/modules/compare_lustrec_outputs.java DESTINATION ${CMAKE_BINARY_DIR}/modules)
|
52
|
execute_process(
|
53
|
COMMAND ${JAVA_COMPILE} compare_lustrec_outputs.java
|
54
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules
|
55
|
)
|
56
|
else()
|
57
|
message("javac not found")
|
58
|
endif()
|
59
|
|
60
|
enable_testing()
|
61
|
add_subdirectory(lustre_files)
|
62
|
|
63
|
|
64
|
if(NOT EXISTS ${ZUSTRE_COMPILER})
|
65
|
message(WARNING "Zustre is not available and associated tests will not be performed!")
|
66
|
endif()
|
67
|
|
68
|
|
69
|
if(SUBPROJ)
|
70
|
if(NOT ${SUBPROJ} MATCHES "master")
|
71
|
message(STATUS "Specific project: ${SUBPROJ}, commit to lustrec-unstable")
|
72
|
set(SUBPROJ unstable)
|
73
|
else()
|
74
|
message(STATUS "Main project: commit to lustrec-master")
|
75
|
endif()
|
76
|
else()
|
77
|
message(STATUS "No specific project specified: commit to lustrec-master")
|
78
|
set(SUBPROJ master)
|
79
|
endif()
|
80
|
|
81
|
# set(SUBPROJ "master")
|
82
|
message("subproj: ${SUBPROJ}")
|
83
|
set(BUILDNAME "${LUSTRE_COMPILER_VERSION}" CACHE STRING "Compiled with ${LUSTRE_COMPILER_VERSION} ")
|
84
|
|
85
|
|
86
|
include( CTest )
|
87
|
|