CMakeLists.txt 1.94 KB
Newer Older
Timothee Habra's avatar
Timothee Habra committed
1
2
3
4
# Copyright: (C)
# Authors: Timothee Habra
# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT

5
cmake_minimum_required(VERSION 2.8.7)
Timothee Habra's avatar
Timothee Habra committed
6
7
8
9
10
11
12
13
14
15
16

project(MBsysC_realtime)

# list source files to compile
init_src()
increment_src(./realtime)

# Get SDL lib and add plot functions to src
if (FLAG_PLOT)

	# Find SDL
Nicolas Van der Noot's avatar
Nicolas Van der Noot committed
17
18
19
	sdl_lib(mbs_realtime)
	set(SDL2_LIBRARIES ${SDL2_LIBRARIES} PARENT_SCOPE)
	set(SDL2TTF_LIBRARIES ${SDL2TTF_LIBRARIES} PARENT_SCOPE)
Timothee Habra's avatar
Timothee Habra committed
20
21
22
23
24
25
26

	increment_src(./sdl)

	# configure a header file to pass some of the CMake settings to the source code
	set(SDL_FILES ${CMAKE_CURRENT_SOURCE_DIR}/sdl/SDL_files)

	configure_file (
Nicolas Van der Noot's avatar
Nicolas Van der Noot committed
27
28
29
30
	"./sdl/conf/cmake_sdl_config.h.in"
	"${PROJECT_BINARY_DIR}/conf/cmake_sdl_config.h"
	)
	include_directories ("${PROJECT_BINARY_DIR}/conf")
Timothee Habra's avatar
Timothee Habra committed
31
32
33
34
35
36

endif (FLAG_PLOT)

# Get java lib and add java functions to src
if (FLAG_VISU)
	# find java and java 3d
Nicolas Van der Noot's avatar
Nicolas Van der Noot committed
37
38
39
40
	java_lib(mbs_realtime)
	set(JNI_INCLUDE_PATH ${JNI_INCLUDE_PATH} PARENT_SCOPE)
	set(JNI_LIBRARIES ${JNI_LIBRARIES} PARENT_SCOPE)
	set (J3D_PATH ${J3D_PATH} PARENT_SCOPE)
Timothee Habra's avatar
Timothee Habra committed
41
42
43
44
45
46
47

	include_directories("./java")
	increment_src(./java)

	set(JAR_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../mbsyspad/MBsysPad.jar)

	configure_file (
Nicolas Van der Noot's avatar
Nicolas Van der Noot committed
48
49
50
51
	"./java/conf/cmake_java_config.h.in"
	"${PROJECT_BINARY_DIR}/conf/cmake_java_config.h"
	)
	include_directories ("${PROJECT_BINARY_DIR}/conf")
Timothee Habra's avatar
Timothee Habra committed
52
53
54
55
56
57
58
59
60

endif (FLAG_VISU)

# list include directories (to find headers)
init_include()
set(INCLUDE_DIR ${INCLUDE_DIR} "./realtime" PARENT_SCOPE)

add_library(MBsysC_realtime ${SOURCE_FILES} ${INCLUDE_DIR})

Nicolas Van der Noot's avatar
Nicolas Van der Noot committed
61
62
63
64
65
66
67
68
69
70
71
# SDL external library: linkage
if (FLAG_PLOT)
	target_link_libraries (MBsysC_realtime ${SDL2_LIBRARIES} ${SDL2TTF_LIBRARIES})
endif ( )

# Java external library: linkage
if (FLAG_VISU)
	target_link_libraries (MBsysC_realtime ${JNI_LIBRARIES})
endif ( )


Timothee Habra's avatar
Timothee Habra committed
72
73
74
75
include_directories("./")
include_directories("../mbs_struct")
include_directories("../mbs_utilities")
include_directories("./sdl" "./sdl/auto_plot")
76
include_directories("./realtime")