forked from CVM-Projects/CVM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
46 lines (35 loc) · 1.57 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
cmake_minimum_required(VERSION 3.0)
project(CVM)
include(cotire.cmake)
#------------------------------------------------------------------
# * Find GMP/MPIR Library
#------------------------------------------------------------------
find_path(GMP_OR_MPIR_INCLUDE_PATH gmpxx.h)
find_library(MPIR_LIBRARY mpir)
if (NOT ${MPIR_LIBRARY} MATCHES MPIR_LIBRARY-NOTFOUND)
set(GMP_OR_MPIR_LIBRARY ${MPIR_LIBRARY})
else()
find_library(GMP_PATH gmp)
find_library(GMPXX_PATH gmpxx)
set(GMP_OR_MPIR_LIBRARY ${GMP_PATH} ${GMPXX_PATH})
endif()
message(GMP_OR_MPIR_INCLUDE_PATH " " ${GMP_OR_MPIR_INCLUDE_PATH})
message(GMP_OR_MPIR_LIBRARY " " ${GMP_OR_MPIR_LIBRARY})
#------------------------------------------------------------------
include_directories(GMP_OR_MPIR_INCLUDE_PATH)
add_subdirectory(prilib prilib)
add_subdirectory(lcmm lcmm)
include_directories(include)
include_directories(${GMP_OR_MPIR_INCLUDE_PATH})
aux_source_directory(source SOURCE_FILES)
aux_source_directory(source/runtime SOURCE_RUNTIME_FILES)
aux_source_directory(source/inststruct SOURCE_INSTSTRUCT_FILES)
aux_source_directory(source/parser SOURCE_PARSER_FILES)
aux_source_directory(source/compiler SOURCE_COMPILER_FILES)
add_executable(cvm ${SOURCE_FILES} ${SOURCE_RUNTIME_FILES} ${SOURCE_INSTSTRUCT_FILES} ${SOURCE_PARSER_FILES} ${SOURCE_COMPILER_FILES} include)
set_property(TARGET cvm PROPERTY CXX_STANDARD 17)
target_link_libraries(cvm prilib)
target_link_libraries(cvm lcmm)
target_link_libraries(cvm ${GMP_OR_MPIR_LIBRARY})
set_target_properties(cvm PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "include/basic.h")
cotire(cvm)