Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ libtoml.dylib
libtoml.so
main
main.o
test
test-toml
test.o
toml.o
toml_parse.c
Expand Down
17 changes: 13 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(libtoml)

FIND_PROGRAM(RAGEL ragel)
if(NOT RAGEL)
message(FATAL_ERROR "Ragel executable not found!")
endif()

FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_LIBICU icu-uc)
PKG_CHECK_MODULES(PC_LIBICU REQUIRED icu-uc)
PKG_CHECK_MODULES(PC_CUNIT cunit)

SET(RAGEL_SRCS toml_parse.rl)
SET(RAGEL_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/toml_parse.rl)

SET(CMAKE_INCLUDE_CURRENT_DIR TRUE)
INCLUDE_DIRECTORIES(${PC_LIBICU_INCLUDE_DIRS} ${PC_CUNIT_INCLUDE_DIRS})
Expand All @@ -32,5 +36,10 @@ TARGET_LINK_LIBRARIES(toml ${PC_LIBICU_LIBRARIES})

ADD_EXECUTABLE(main main.c)
TARGET_LINK_LIBRARIES(main toml ${PC_LIBICU_LIBRARIES})
ADD_EXECUTABLE(test test.c)
TARGET_LINK_LIBRARIES(test toml ${PC_LIBICU_LIBRARIES} ${PC_CUNIT_LIBRARIES})

if(NOT PC_CUNIT_FOUND)
message(WARNING "CUnit was not found, not building tests")
else()
ADD_EXECUTABLE(test-toml test.c)
TARGET_LINK_LIBRARIES(test-toml toml ${PC_LIBICU_LIBRARIES} ${PC_CUNIT_LIBRARIES})
endif()
39 changes: 0 additions & 39 deletions ccan/build_assert.h

This file was deleted.