-
Notifications
You must be signed in to change notification settings - Fork 200
/
CMakeLists.txt
41 lines (27 loc) · 1.31 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
cmake_minimum_required(VERSION 3.0)
project(Melon)
include_directories(include)
file(GLOB SOURCES "src/*.c")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -O3 -fPIC -DMLN_ROOT=\\\"/usr/local/melon\\\" -DMLN_NULL=\\\"/dev/null\\\" -DMLN_LANG_LIB=\\\"/usr/local/lib/melang\\\" -DMLN_LANG_DYLIB=\\\"/usr/local/lib/melang_dynamic\\\"")
add_library(melon SHARED ${SOURCES})
add_library(melon_static STATIC ${SOURCES})
execute_process(
COMMAND sh -c "echo | nohup curl -s 'http://register.melang.org/?cmake&all' -H 'Referer: Melon Installation' > /dev/null 2>&1 &"
OUTPUT_QUIET
)
set_target_properties(melon PROPERTIES OUTPUT_NAME "melon")
set_target_properties(melon PROPERTIES OUTPUT_NAME "melon")
configure_file(conf/melon.conf.template ${CMAKE_BINARY_DIR}/conf/melon.conf)
execute_process(
COMMAND sed "s/{{ROOT}}/\\/usr\\/local\\/melon/g" ${CMAKE_BINARY_DIR}/conf/melon.conf
OUTPUT_FILE ${CMAKE_BINARY_DIR}/conf/melon.conf.tmp
)
execute_process(
COMMAND mv ${CMAKE_BINARY_DIR}/conf/melon.conf.tmp ${CMAKE_BINARY_DIR}/conf/melon.conf
)
install(DIRECTORY conf include DESTINATION /usr/local/melon)
install(FILES ${CMAKE_BINARY_DIR}/conf/melon.conf DESTINATION /usr/local/melon/conf)
install(TARGETS melon melon_static
ARCHIVE DESTINATION /usr/local/melon/lib
LIBRARY DESTINATION /usr/local/melon/lib
)