-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathCMakeLists.txt
69 lines (62 loc) · 2.03 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
cmake_minimum_required (VERSION 2.6)
project (Cheerp_Utils LANGUAGES)
set (CHEERP_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE FILEPATH "set cheerp installation prefix")
execute_process(COMMAND "${CMAKE_INSTALL_PREFIX}/bin/clang" --version
OUTPUT_VARIABLE CMAKE_CHEERP_RAW_VERSION)
message(WARNING "Cheerp raw version string ${CMAKE_CHEERP_RAW_VERSION}")
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+"
CHEERP_VERSION
"${CMAKE_CHEERP_RAW_VERSION}")
message(WARNING "Cheerp version match ${CHEERP_VERSION}")
# scripts
configure_file (
"scripts/cheerpwrap.in"
"${PROJECT_BINARY_DIR}/cheerpwrap"
)
install (PROGRAMS "${PROJECT_BINARY_DIR}/cheerpwrap"
DESTINATION bin)
install (PROGRAMS
scripts/cheerp-unknown-none-ar
scripts/cheerp-unknown-none-g++
scripts/cheerp-unknown-none-gcc
scripts/cheerp-unknown-none-ranlib
scripts/wasm32-unknown-none-ar
scripts/wasm32-unknown-none-g++
scripts/wasm32-unknown-none-gcc
scripts/wasm32-unknown-none-ranlib
scripts/wasm32-unknown-wasi-ar
scripts/wasm32-unknown-wasi-g++
scripts/wasm32-unknown-wasi-gcc
scripts/wasm32-unknown-wasi-ranlib
DESTINATION libexec )
# tools
SET(toolchain_files_templates
"tools/CheerpCommon.cmake.in"
)
foreach(toolchain_file ${toolchain_files_templates})
get_filename_component(base ${toolchain_file} NAME_WE)
configure_file (
${toolchain_file}
"${PROJECT_BINARY_DIR}/${base}.cmake"
@ONLY
)
install (FILES "${PROJECT_BINARY_DIR}/${base}.cmake"
DESTINATION share/cmake/Modules/)
endforeach()
install (FILES
"tools/CheerpToolchain.cmake"
"tools/CheerpWasmToolchain.cmake"
DESTINATION share/cmake/Modules/)
install (FILES
"tools/Cheerp.cmake"
"tools/CheerpToolchain.cmake"
"tools/CheerpWasmToolchain.cmake"
DESTINATION share/cmake/Modules/Platform)
# tests
install (FILES tests/dom/dom1.cpp tests/dom/test1.html
DESTINATION share/cheerp/examples/dom )
install (FILES tests/webgl/webgl.cpp tests/webgl/webgl.html
DESTINATION share/cheerp/examples/webgl )
# include
install (DIRECTORY include/client/
DESTINATION include/client/cheerp )