-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (39 loc) · 1.61 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
SET(PROJECTNAME zkme)
PROJECT(${PROJECTNAME})
CMAKE_MINIMUM_REQUIRED(VERSION 3.16.3)
INCLUDE_DIRECTORIES("./src")
INCLUDE_DIRECTORIES("./src/utils")
# add_executable(${PROJECTNAME} src/main.cpp)
AUX_SOURCE_DIRECTORY(./src DIR_MAIN_SRCS)
AUX_SOURCE_DIRECTORY(./src/utils DIR_MAIN_UTILS_SRCS)
AUX_SOURCE_DIRECTORY(./src/crypto DIR_MAIN_CRYPTO_SRCS)
ADD_EXECUTABLE(${PROJECTNAME}
${DIR_MAIN_SRCS}
${DIR_MAIN_UTILS_SRCS}
${DIR_MAIN_CRYPTO_SRCS}
)
# Enable ExternalProject CMake module
include(ExternalProject)
# Set default ExternalProject root directory
set_directory_properties(PROPERTIES EP_PREFIX ${CMAKE_SOURCE_DIR}/src/rust)
# Add librustbellman as a CMake target
ExternalProject_Add(
librustbellman
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND cargo build #COMMAND cargo build --release
UPDATE_COMMAND cargo build #COMMAND cargo build --release
BINARY_DIR "${CMAKE_SOURCE_DIR}/src/rust"
INSTALL_COMMAND ""
ALWAYS TRUE
LOG_BUILD ON)
# Create dependency of Example on librustbellman
add_dependencies(${PROJECTNAME} librustbellman)
# message(${CMAKE_SOURCE_DIR})
# Specify Example's link libraries
target_link_libraries(${PROJECTNAME}
debug "${CMAKE_SOURCE_DIR}/src/rust/target/debug/librustbellman.a"
optimized "${CMAKE_SOURCE_DIR}/src/rust/target/release/librustbellman.a")
# set_target_properties(Example PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON)
TARGET_LINK_LIBRARIES(${PROJECTNAME} -lpthread)
TARGET_LINK_LIBRARIES(${PROJECTNAME} -ldl)