forked from nathandunk/BetterSerialPlotter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
74 lines (60 loc) · 2.68 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# MIT License
#
# Copyright (c) 2020 Nathan Dunkelberger
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Author(s): Nathan Dunkelberger (n8dunk@gmail.com)
cmake_minimum_required(VERSION 3.13.0)
# create project
project(BSP VERSION 0.1.1 LANGUAGES CXX)
# defines conventional GNU isntallation directories
include(GNUInstallDirs)
# set compiler flags
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3") # all warnings
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /MP") # warning level 4
endif()
# Use fetch content to get libraries that meii is dependent on
include(FetchContent)
# MAHI GUI
FetchContent_Declare(mahi-gui GIT_REPOSITORY https://github.com/mahilab/mahi-gui.git)
FetchContent_MakeAvailable(mahi-gui)
# MAHI COM
FetchContent_Declare(mahi-com
GIT_REPOSITORY https://github.com/nathandunk/mahi-com.git
GIT_TAG origin/mac-serial)
FetchContent_MakeAvailable(mahi-com)
set(SRC_BSP
${CMAKE_SOURCE_DIR}/src/BetterSerialPlotter/Utility.cpp
${CMAKE_SOURCE_DIR}/src/BetterSerialPlotter/BSP.cpp
${CMAKE_SOURCE_DIR}/src/BetterSerialPlotter/Plot.cpp
${CMAKE_SOURCE_DIR}/src/BetterSerialPlotter/Widget.cpp
${CMAKE_SOURCE_DIR}/src/BetterSerialPlotter/DataPanel.cpp
${CMAKE_SOURCE_DIR}/src/BetterSerialPlotter/SerialManager.cpp
${CMAKE_SOURCE_DIR}/src/BetterSerialPlotter/PlotMonitor.cpp
${CMAKE_SOURCE_DIR}/src/BetterSerialPlotter/SerialMonitor.cpp
${CMAKE_SOURCE_DIR}/src/BetterSerialPlotter/Serialization.cpp
)
include_directories(include)
set(MACOSX_BUNDLE_ICON_FILE BSP_Logo.icns)
set(APP_ICON ${CMAKE_CURRENT_SOURCE_DIR}/icon/BSP_Logo.icns)
# set_source_files_properties(APP_ICON PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
if (APPLE)
add_executable(BetterSerialPlotter MACOSX_BUNDLE src/main.cpp ${SRC_BSP} ${APP_ICON})
set_target_properties(BetterSerialPlotter PROPERTIES
RESOURCE ${APP_ICON})
else()
add_executable(BetterSerialPlotter WIN32 src/main.cpp ${SRC_BSP} icon/BSP_icon.rc)
endif()
target_link_libraries(BetterSerialPlotter mahi::gui mahi::com)
add_subdirectory(test)