mirror of
https://github.com/pantor/inja.git
synced 2026-04-03 14:48:51 +00:00
Added CMake and TravisCI
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -30,3 +30,10 @@
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
|
||||
# Build Folders
|
||||
build
|
||||
dist
|
||||
|
||||
# Coveralls repo token
|
||||
.coveralls.yml
|
||||
20
.travis.yml
Normal file
20
.travis.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
#########################
|
||||
# project configuration #
|
||||
#########################
|
||||
|
||||
language: cpp
|
||||
|
||||
# dist: trusty
|
||||
|
||||
compiler:
|
||||
- gcc
|
||||
before_install:
|
||||
- pip install --user cpp-coveralls
|
||||
script:
|
||||
- mkdir -p build && cd build
|
||||
- cmake .. && cmake --build . --config Release -- -j4
|
||||
- ctest -C Release -V
|
||||
- cd ..
|
||||
# - ./configure --enable-gcov && make && make check
|
||||
#after_success:
|
||||
# - coveralls --exclude lib --exclude tests --gcov-options '\-lp'
|
||||
38
CMakeLists.txt
Normal file
38
CMakeLists.txt
Normal file
@@ -0,0 +1,38 @@
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
|
||||
##
|
||||
## PROJECT
|
||||
## name and version
|
||||
##
|
||||
project(inja)
|
||||
|
||||
##
|
||||
## OPTIONS
|
||||
##
|
||||
option(BUILD_UNIT_TESTS "Build the unit tests" ON)
|
||||
|
||||
##
|
||||
## CONFIGURATION
|
||||
##
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(INJA_SOURCE_DIR src/)
|
||||
set(INJA_HEADER_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dist)
|
||||
|
||||
##
|
||||
## TESTS
|
||||
## create and configure the unit test target
|
||||
##
|
||||
if(BUILD_UNIT_TESTS)
|
||||
enable_testing()
|
||||
# include_directories(${NLOHMANN_JSON_SOURCE_DIR})
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
|
||||
##
|
||||
## INSTALL
|
||||
## install header files, generate and install cmake config files for find_package()
|
||||
##
|
||||
install(
|
||||
DIRECTORY ${INJA_SOURCE_DIR}
|
||||
DESTINATION ${INJA_HEADER_INSTALL_DIR}
|
||||
)
|
||||
@@ -2,5 +2,7 @@
|
||||
|
||||
A Template Engine for Modern C++
|
||||
|
||||
[](https://travis-ci.org/pantor/inja)
|
||||
[](https://coveralls.io/r/pantor/inja)
|
||||
[](http://github.com/pantor/inja/issues)
|
||||
[](https://raw.githubusercontent.com/pantor/inja/master/LICENSE.MIT)
|
||||
13
test/CMakeLists.txt
Normal file
13
test/CMakeLists.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
# Prepare "Catch" library for other executables
|
||||
set(CATCH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty)
|
||||
add_library(Catch INTERFACE)
|
||||
target_include_directories(Catch INTERFACE ${CATCH_INCLUDE_DIR})
|
||||
|
||||
set(UNITTEST_TARGET_NAME "inja_unit")
|
||||
set(TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/test.cpp)
|
||||
add_executable(${UNITTEST_TARGET_NAME} ${TEST_SOURCES})
|
||||
target_link_libraries(${UNITTEST_TARGET_NAME} Catch)
|
||||
|
||||
add_test(NAME "${UNITTEST_TARGET_NAME}_default"
|
||||
COMMAND ${UNITTEST_TARGET_NAME}
|
||||
)
|
||||
BIN
test/src/test
BIN
test/src/test
Binary file not shown.
Reference in New Issue
Block a user