2014-03-05 09:00:24 -05:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
2014-03-01 11:52:41 -05:00
|
|
|
|
2014-03-02 00:34:02 -05:00
|
|
|
PROJECT(picrin)
|
2014-03-02 00:51:50 -05:00
|
|
|
|
|
|
|
# load extra cmake modules
|
2014-03-02 00:34:02 -05:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
|
2014-03-01 11:52:41 -05:00
|
|
|
|
2014-03-02 00:51:50 -05:00
|
|
|
# ----
|
|
|
|
|
2014-03-01 22:07:16 -05:00
|
|
|
# git submodule update --init
|
2014-03-26 01:08:55 -04:00
|
|
|
find_package(Git REQUIRED)
|
2014-03-01 22:07:16 -05:00
|
|
|
execute_process(
|
|
|
|
COMMAND ${GIT_EXECUTABLE} submodule update --init
|
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
|
2014-03-01 11:52:41 -05:00
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY bin)
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY lib)
|
2014-03-01 22:32:59 -05:00
|
|
|
set(CMAKE_C_FLAGS "-Wall -Wextra -std=c99")
|
2014-03-04 10:39:43 -05:00
|
|
|
set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG=1")
|
2014-03-05 09:06:06 -05:00
|
|
|
include_directories(include extlib)
|
2014-03-01 11:52:41 -05:00
|
|
|
|
|
|
|
# build picrin
|
|
|
|
include(src/CMakeLists.txt)
|
|
|
|
include(tools/CMakeLists.txt)
|
2014-03-01 12:39:50 -05:00
|
|
|
|
|
|
|
# copy runtime files
|
|
|
|
file(COPY piclib DESTINATION .)
|
2014-03-01 22:23:36 -05:00
|
|
|
file(COPY etc DESTINATION .)
|
2014-03-01 12:40:04 -05:00
|
|
|
|
2014-03-02 00:51:50 -05:00
|
|
|
# ----
|
|
|
|
|
2014-03-01 12:40:04 -05:00
|
|
|
# $ make run
|
|
|
|
add_custom_target(run bin/picrin DEPENDS repl)
|
2014-03-01 22:23:36 -05:00
|
|
|
|
|
|
|
# $ make no-act
|
|
|
|
add_custom_target(no-act bin/picrin -e '' > /dev/null DEPENDS repl)
|
|
|
|
|
|
|
|
# $ make tak
|
|
|
|
add_custom_target(tak bin/picrin etc/tak.scm DEPENDS repl)
|
|
|
|
|
|
|
|
# $ make lines
|
|
|
|
add_custom_target(lines find . -name "*.[chyl]" | xargs wc -l WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|