Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / CMakeLists.txt @ dd62ff27

History | View | Annotate | Download (2.86 KB)

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
  execute_process(COMMAND ${LUSTRE_COMPILER} -version
15
        OUTPUT_VARIABLE LUSTRE_COMPILER_VERSION
16
        OUTPUT_STRIP_TRAILING_WHITESPACE)
17

    
18
else(LUSTRE_COMPILER)
19
  message(FATAL_ERROR "lustrec not found")
20
endif(LUSTRE_COMPILER)
21

    
22

    
23
if(ZUSTRE_COMPILER)
24
  message(STATUS "Found zustre: ${ZUSTRE_COMPILER} ")
25
else(ZUSTRE_COMPILER)
26
  message(STATUS "Zustre not found")
27
endif(ZUSTRE_COMPILER)
28

    
29

    
30
if(JAVA_COMPILE AND EXISTS ${PROJECT_SOURCE_DIR}/modules/XPathParser_lusi.java)
31
	file(COPY ${PROJECT_SOURCE_DIR}/modules/XPathParser_lusi.java ${PROJECT_SOURCE_DIR}/modules/javax.xml-1.3.4.jar  DESTINATION  ${CMAKE_BINARY_DIR}/modules)
32
	execute_process(			COMMAND ${JAVA_COMPILE} -classpath "'.;javax.xml-1.3.4.jar;'" XPathParser_lusi.java 
33
						WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules 
34
						)
35
	#add_custom_target (XPathParser_lusi ALL
36
	#	DEPENDS ${CMAKE_BINARY_DIR}/modules/XPathParser_lusi.class)
37
else()
38
	message("javac not found")
39
endif()
40

    
41
if(JAVA_COMPILE AND EXISTS ${PROJECT_SOURCE_DIR}/modules/Generate_inputs_lusi.java)
42
	file(COPY ${PROJECT_SOURCE_DIR}/modules/Generate_inputs_lusi.java   DESTINATION  ${CMAKE_BINARY_DIR}/modules)
43
	execute_process(#OUTPUT  ${CMAKE_BINARY_DIR}/modules/Generate_inputs_lusi.class 
44
						COMMAND ${JAVA_COMPILE}  Generate_inputs_lusi.java 
45
						WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules 
46
						)
47
	#add_custom_target (Generate_inputs_lusi ALL
48
	#	DEPENDS ${CMAKE_BINARY_DIR}/modules/Generate_inputs_lusi.class)
49
else()
50
	message("javac not found")
51
endif()
52

    
53

    
54
if(JAVA_COMPILE AND EXISTS ${PROJECT_SOURCE_DIR}/modules/compare_lustrec_outputs.java)
55
	file(COPY ${PROJECT_SOURCE_DIR}/modules/compare_lustrec_outputs.java   DESTINATION  ${CMAKE_BINARY_DIR}/modules)
56
	execute_process(
57
			COMMAND ${JAVA_COMPILE}  compare_lustrec_outputs.java
58
			WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules 
59
			)
60
else()
61
	message("javac not found")
62
endif()
63

    
64

    
65
add_subdirectory(lustre_files)
66

    
67
    
68
if(NOT EXISTS ${ZUSTRE_COMPILER})
69
message(WARNING "Zustre is not available and associated tests will not be performed!")  
70
endif()
71

    
72

    
73
if(SUBPROJ)
74
  if(NOT ${SUBPROJ} MATCHES "master")
75
    message(STATUS "Specific project: ${SUBPROJ}, commit to lustrec-unstable")
76
    set(SUBPROJ unstable)
77
  else()
78
    message(STATUS "Main project: commit to lustrec-master")
79
  endif()
80
else()
81
  message(STATUS "No specific project specified: commit to lustrec-master")
82
  set(SUBPROJ master)
83
endif()
84

    
85
# set(SUBPROJ "master")
86
message("subproj: ${SUBPROJ}")
87
set(BUILDNAME "${LUSTRE_COMPILER_VERSION}" CACHE STRING "Compiled with ${LUSTRE_COMPILER_VERSION} ")
88

    
89

    
90
include( CTest )
91