picrin/CMakeLists.txt

56 lines
1.3 KiB
CMake
Raw Normal View History

2014-06-15 13:22:09 -04:00
cmake_minimum_required(VERSION 2.6)
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
# ----
# git submodule update --init
2014-03-26 01:08:55 -04:00
find_package(Git REQUIRED)
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)
set(CMAKE_C_FLAGS "-Wall -Wextra")
2014-03-04 10:39:43 -05:00
set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG=1")
option(USE_C11_FEATURE "Enable c11 feature" OFF)
if(USE_C11_FEATURE)
add_definitions(-std=c11)
else()
add_definitions(-std=c99) # at least c99 is required
endif()
2014-03-05 09:06:06 -05:00
include_directories(include extlib)
2014-03-01 11:52:41 -05:00
# build picrin
2014-05-20 11:48:56 -04:00
include(piclib/CMakeLists.txt)
2014-03-31 07:43:36 -04:00
include(contrib/CMakeLists.txt)
2014-03-01 11:52:41 -05:00
include(src/CMakeLists.txt)
include(tools/CMakeLists.txt)
2014-03-01 12:39:50 -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
2014-06-22 07:32:34 -04:00
# $ make test
2014-06-22 09:29:02 -04:00
add_custom_target(test DEPENDS no-act test-r7rs)
2014-06-22 07:32:34 -04:00
2014-03-01 22:23:36 -05:00
# $ make no-act
add_custom_target(no-act bin/picrin -e '' > /dev/null 2> /dev/null DEPENDS repl)
2014-03-01 22:23:36 -05:00
2014-06-22 09:29:02 -04:00
# $ make test-r7rs
add_custom_target(test-r7rs bin/picrin ${PROJECT_SOURCE_DIR}/t/r7rs-tests.scm DEPENDS repl)
2014-03-01 22:23:36 -05:00
# $ 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})