-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
116 lines (101 loc) · 4.1 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
cmake_minimum_required(VERSION 3.2.2)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING
"Choose the type of build, options are: Debug Release."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)
set(CMAKE_CXX_EXTENSIONS off)
# -Wall only works for gcc or clang, but let's fix that when someone starts
# complaining.
# Also disable deprecation warnings, because there is no point in fixing them
# when I'm planning to migrate to GSK (the successor of clutter) once it's
# available widely enough in Gtk.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-deprecated-declarations")
project (VHDE)
set(ANTLR_RUNTIME antlr4-cpp-runtime)
get_filename_component(ANTLR_RUNTIME_PREFIX ${ANTLR_RUNTIME}-prefix ABSOLUTE)
include(ExternalProject)
externalproject_add(${ANTLR_RUNTIME}
PREFIX ${ANTLR_RUNTIME_PREFIX}
GIT_REPOSITORY https://github.com/Griffon26/antlr4.git
GIT_TAG "4.7-unique_ptr"
UPDATE_COMMAND ""
PATCH_COMMAND ../../../deps/patch_antlr.sh ${ANTLR_RUNTIME_PREFIX}/src/${ANTLR_RUNTIME}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${ANTLR_RUNTIME_PREFIX}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DWITH_LIBCXX=Off
)
find_package(PkgConfig)
pkg_check_modules(CLUTTERMM REQUIRED cluttermm-1.0)
pkg_check_modules(CLUTTERGTKMM REQUIRED clutter-gtkmm-1.0)
pkg_search_module(GTKMM REQUIRED gtkmm-3.0 gtkmm-2.4)
include_directories(${CLUTTERMM_INCLUDE_DIRS}
${CLUTTERGTKMM_INCLUDE_DIRS}
${GTKMM_INCLUDE_DIRS}
${ANTLR_RUNTIME_PREFIX}/include/antlr4-runtime
src/clutter
src/common
src/gui
src/layout
src/parsers
src/parsers/generated
src/vhdl)
link_directories(${CLUTTERMM_LIBRARY_DIRS}
${CLUTTERGTKMM_LIBRARY_DIRS}
${GTKMM_LIBRARY_DIRS}
${ANTLR_RUNTIME_PREFIX}/lib)
link_libraries(${CLUTTERMM_LIBRARIES}
${CLUTTERGTKMM_LIBRARIES}
${GTKMM_LIBRARIES}
${ANTLR_RUNTIME_PREFIX}/lib/libantlr4-runtime.so)
set(SRCS src/main.cpp
src/architecture_stage_updater.cpp
src/entity_stage_updater.cpp
src/move_and_resize_handler.cpp
src/project.cpp
src/project_treeview_updater.cpp
src/clutter/clutter_block.cpp
src/clutter/clutter_port.cpp
src/clutter/clutter_scaling_text.cpp
src/clutter/clutter_wire.cpp
src/gui/gui_block.cpp
src/gui/gui_component.cpp
src/gui/gui_instance.cpp
src/gui/gui_port.cpp
src/gui/gui_selection.cpp
src/gui/gui_signal.cpp
src/layout/layout_architecture.cpp
src/layout/layout_block.cpp
src/layout/layout_component.cpp
src/layout/layout_file.cpp
src/layout/layout_instance.cpp
src/layout/layout_port.cpp
src/layout/layout_signal.cpp
src/parsers/generated/vhdlBaseVisitor.cpp
src/parsers/generated/vhdlLexer.cpp
src/parsers/generated/vhdlParser.cpp
src/parsers/generated/vhdlVisitor.cpp
src/parsers/parse_layout.cpp
src/parsers/parse_vhdl.cpp
src/vhde_application.cpp
src/vhde_window.cpp
src/vhdl/vhdl_architecture.cpp
src/vhdl/vhdl_component.cpp
src/vhdl/vhdl_entity.cpp
src/vhdl/vhdl_file.cpp
src/vhdl/vhdl_fragment.cpp
src/vhdl/vhdl_instance.cpp
src/vhdl/vhdl_interface.cpp
src/vhdl/vhdl_port.cpp
src/vhdl/vhdl_signal.cpp
src/vhdl/vhdl_type.cpp)
add_executable(vhde ${SRCS})
# This definition enables a work-around for
# https://bugzilla.gnome.org/show_bug.cgi?id=783362
add_definitions(-DCLUTTER_GTKMM_BUG)
target_compile_features(vhde PRIVATE cxx_generic_lambdas
cxx_noexcept
cxx_override
cxx_range_for
)
add_dependencies(vhde ${ANTLR_RUNTIME})