picrin/CMakeLists.txt

39 lines
961 B
CMake
Raw Normal View History

2014-03-01 11:52:41 -05:00
cmake_minimum_required(VERSION 2.8)
project(picrin)
# git submodule update --init
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-01 22:29:23 -05:00
set(CMAKE_C_FLAGS_DEBUG "-DDEBUG=1")
2014-03-01 11:52:41 -05:00
# external libraries
add_library(xfile SHARED extlib/xfile/xfile.c)
# build picrin
include_directories(include extlib)
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
# $ 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})