-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
59 lines (43 loc) · 1.43 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
cmake_minimum_required(VERSION 2.8)
project(Scheme)
set(LIBDIR "${CMAKE_CURRENT_SOURCE_DIR}/lib/" CACHE STRING "Library path")
set(DEFAULT_PROMPT "> " CACHE STRING "Default prompt")
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
endif()
set(BUILD_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build)
set(BUILD_CONFIG_PATH ${BUILD_PATH}/config)
set(SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories ("${INCLUDE_PATH}")
## For config.h
include_directories ("${BUILD_CONFIG_PATH}")
set(BINARY sch)
include(CheckIncludeFiles)
include(CheckFunctionExists)
check_include_files(getopt.h HAVE_GETOPT_H)
check_function_exists(getopt HAVE_GETOPT)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
${BUILD_CONFIG_PATH}/config.h)
set(SOURCES
${SOURCE_PATH}/buffer.c
${SOURCE_PATH}/eval.c
${SOURCE_PATH}/hashtable.c
${SOURCE_PATH}/init.c
${SOURCE_PATH}/main.c
${SOURCE_PATH}/object.c
${SOURCE_PATH}/parser.c
${SOURCE_PATH}/parser_object.c
${SOURCE_PATH}/primitive.c
${SOURCE_PATH}/run.c)
set(HEADERS
${INCLUDE_PATH}/buffer.h
${INCLUDE_PATH}/eval.h
${INCLUDE_PATH}/hashtable.h
${INCLUDE_PATH}/init.h
${INCLUDE_PATH}/object.h
${INCLUDE_PATH}/parser.h
${INCLUDE_PATH}/parser_object.h
${INCLUDE_PATH}/primitive.h
${INCLUDE_PATH}/run.h)
add_executable(${BINARY} ${SOURCES} ${HEADERS})