-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCMakeLists-ExternalProjects.txt
39 lines (32 loc) · 1.68 KB
/
CMakeLists-ExternalProjects.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
include(ExternalProject)
set(DUK_DIR "${CMAKE_CURRENT_SOURCE_DIR}/duktape")
# TODO: Move to common place if littlesheens supports more External Projects
set(CMAKE_COMMON_ARGS)
if (DEFINED CMAKE_TOOLCHAIN_FILE)
# Forward the toolchain file if it was provided
set(CMAKE_COMMON_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_ISTALL_PREFIX})
else()
# Otherwise lean into toolchain environment setup.
set(CMAKE_COMMON_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_AR=${CMAKE_AR}
-DCMAKE_RANLIB=${CMAKE_RANLIB}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_OBJCOPY=${CMAKE_OBJCOPY}
-DCMAKE_STRIP=${CMAKE_STRIP}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_SHARED_LINKER_FLAGS=${CMAKE_SHARED_LINKER_FLAGS}
-DCMAKE_MODULE_LINKER_FLAGS=${CMAKE_MODULE_LINKER_FLAGS}
-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX})
endif()
ExternalProject_Add(duktape-ext
URL https://github.com/svaarala/duktape-releases/raw/master/duktape-2.2.0.tar.xz
URL_MD5 0f7c9fac5547f7f3fc1c671fc90b2ccf
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/duktape"
UPDATE_COMMAND ""
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt-duktape ${CMAKE_CURRENT_SOURCE_DIR}/duktape/CMakeLists.txt
CMAKE_ARGS "${CMAKE_COMMON_ARGS}"
TEST_COMMAND ""
)