clasim.cmake 1.88 KB
Newer Older
1
2
cmake_minimum_required(VERSION 3.9.4)

fmg005's avatar
fmg005 committed
3
project(clasim)
4

5
6
7
# use dpkg -L libconfig++-dev to find the location of libconfig.h++ and libconfig++.a
find_path(CONFIG++_INCLUDE_DIR libconfig.h++ <libconfig.h++ location>)
find_library(CONFIG++_LIBRARY NAMES libconfig++.a PATH <libconfig++.a location>)
fmg005's avatar
fmg005 committed
8

9
10
11
#clasim depends on pulse this will call will give you access to pulse directories
#needed by clasim
find_package(Pulse REQUIRED NO_MODULE)
fmg005's avatar
fmg005 committed
12

13
14
15
16
17
18
19
20
21
22
23
24
25
# Variables to be used in the source files
set(CLASIM_CONFIG_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources/)
set(CLASIM_RESULTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/results/)
set(PULSE_STATE_DIR ${Pulse_INSTALL}/bin/states/)

# Create directory at build generation
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/results)

# Generate header file to include variables
configure_file(
    ${CMAKE_CURRENT_SOURCE_DIR}/simsrc/mcps2018/include/configure_clasim_paths.h.in
    ${CMAKE_CURRENT_SOURCE_DIR}/simsrc/mcps2018/include/configure_clasim_paths.h
)
26

27
28
# set your simulation source directory
set(SIM_SRC_PATH simsrc/mcps2018/algo1)
pkda001's avatar
pkda001 committed
29
30
31

# *** include your source files
# list each file individually
fmg005's avatar
fmg005 committed
32
33
set(MY_SOURCE_FILES

34
35
36
37
38
39
    ${SIM_SRC_PATH}/SimEngine.cpp
    ${SIM_SRC_PATH}/Monitor.cpp
    ${SIM_SRC_PATH}/Controller.cpp
    ${SIM_SRC_PATH}/Pump.cpp
    ${SIM_SRC_PATH}/SimulationLogger.cpp
    ${SIM_SRC_PATH}/MedicalDevice.cpp
fmg005's avatar
fmg005 committed
40
41
42

)

43
add_executable(clasim ${MY_SOURCE_FILES})
fmg005's avatar
fmg005 committed
44

45
#include directories
46
47
target_include_directories(clasim PRIVATE ${Pulse_INCLUDE_DIRS})
target_include_directories(clasim PRIVATE ${CONFIG++_INCLUDE_DIR})
pkda001's avatar
pkda001 committed
48
49

# *** include your simulation include directories here
50
target_include_directories(clasim PRIVATE simsrc/mcps2018/include/)
pkda001's avatar
pkda001 committed
51

52
#libraries
53
54
55
56
target_link_libraries(clasim debug "${Pulse_DEBUG_LIBS}")
target_link_libraries(clasim optimized "${Pulse_LIBS}")
target_link_libraries(clasim optimized "${CONFIG++_LIBRARY}")

fmg005's avatar
fmg005 committed
57

58
install(TARGETS clasim RUNTIME DESTINATION ${Pulse_INSTALL}/bin)