forked from eclufsc/ophidian
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
122 lines (88 loc) · 3.63 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
116
117
118
119
120
121
122
################################################################################
# This is the main CMakeLists file for the Ophidian library.
#
# Its main goals are:
# - Set up global variables.
# - Configure Ophidian dependencies (find_packege).
# - Add subdirectories.
#
################################################################################
################################################################################
# Set up global variables
################################################################################
# Set up minimal cmake version
cmake_minimum_required(VERSION 3.5.2)
# Set project name
project(ophidian)
# Set project version
set(ophidian_VERSION 0.1)
# Set c++14 globally
set(CMAKE_CXX_STANDARD 14)
# Set Ophidian source dir
set(ophidian_source_dir ${PROJECT_SOURCE_DIR})
# Build ophidian_tests binary fully static
OPTION(OPHIDIAN_TESTS_FULLY_STATIC OFF)
# Run Uncrustify on project source
OPTION(UNCRUSTIFY_IT OFF)
# Enable uncrustify to check for code style
OPTION(RUN_UNCRUSTIFY_CHECK OFF)
# Set the uncrustify config file
set(ophidian_uncrustify_config ${ophidian_source_dir}/uncrustify.cfg)
################################################################################
# Set up installation variables
################################################################################
# Set ophidian shared libraries install path
set(ophidian_install_lib_dir lib)
# Set ophidian binary install path
set(ophidian_install_bin_dir bin)
# Set ophidian binary install path
set(ophidian_install_include_dir include)
# Set ophidian shared files path
set(ophidian_install_share_dir share/ophidian)
# Set ophidian copyright path
set(ophidian_install_copyright_dir share/doc/ophidian)
################################################################################
# Set Linker RPATH options
################################################################################
# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# the RPATH to be used when installing, but only if it's not a system directory
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
IF("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
ENDIF("${isSystemDir}" STREQUAL "-1")
################################################################################
# Handle raquirements
################################################################################
# Set Cmake module path for find_package
set(CMAKE_MODULE_PATH ${ophidian_source_dir}/cmake)
# Set Cmake prefix path for building with local dependencies
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${ophidian_source_dir}/dependencies)
# Find Boost
find_package(Boost 1.59 REQUIRED)
# Find Lemon
find_package(Lemon REQUIRED)
# Find Units
find_package(units REQUIRED CONFIG)
# Find DEF
find_package(DEF REQUIRED)
# Find LEF
find_package(LEF REQUIRED)
# Find Flute
find_package(Flute REQUIRED)
# Find Verilog-parser
find_package(verilog-parser REQUIRED)
################################################################################
# Project logic
################################################################################
# Add subdirectories
add_subdirectory(3rdparty)
add_subdirectory(ophidian)
add_subdirectory(test)