-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
52 lines (44 loc) · 1.7 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
cmake_minimum_required(VERSION 3.14...3.19)
project(polyfy
LANGUAGES CXX
)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# configuration options
option(DEPLOY "Configure for deployment")
option(BUILD_TESTS "Also build tests for polyfy project")
option(PERF "Add debug info for performance analysis tools")
#build type settings
set(default_build_type "Release")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
endif()
# Add path for custom modules
list (APPEND CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(cmake/DownloadProject.cmake)
find_package(GMP REQUIRED)
add_library(gmp::gmpxx IMPORTED INTERFACE)
add_library(gmp::libgmpxx IMPORTED INTERFACE)
add_library(gmp::libgmp IMPORTED INTERFACE)
set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")
download_project(PROJ mockturtle
GIT_REPOSITORY https://github.com/lsils/mockturtle.git
GIT_TAG master
${UPDATE_DISCONNECTED_IF_AVAILABLE}
)
add_subdirectory(${mockturtle_SOURCE_DIR}/include)
add_subdirectory( ${mockturtle_SOURCE_DIR}/lib)
add_subdirectory(src)
# add test code
if (BUILD_TESTS)
enable_testing()
#include(GoogleTest)
find_package(GTest REQUIRED)
add_subdirectory(test)
endif ()
# add apps if this is the main project
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
add_subdirectory(apps)
endif()