Skip to content

Commit

Permalink
make jinja2cpp conan-friendly again (#217)
Browse files Browse the repository at this point in the history
* make jinja2cpp conan-friendly again
* fix c++20 build mode
  • Loading branch information
rmorozov authored Aug 26, 2021
1 parent b6ddef9 commit dae174c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ jobs:
mkdir $BUILD_DIRECTORY && cd $BUILD_DIRECTORY
sudo chmod gou+rw -R $WORKSPACE
cmake $CMAKE_OPTS -DCMAKE_BUILD_TYPE=$BUILD_CONFIG -DCMAKE_CXX_FLAGS=$CMAKE_CXX_FLAGS -DJINJA2CPP_DEPS_MODE=internal -DJINJA2CPP_BUILD_SHARED=$INPUT_BUILD_SHARED $EXTRA_FLAGS $WORKSPACE && cmake --build . --config $BUILD_CONFIG --target all -- -j4
shell: bash

- name: Test
env:
Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,15 @@ set_target_properties(${LIB_TARGET_NAME} PROPERTIES

set_property(TARGET ${LIB_TARGET_NAME} PROPERTY PUBLIC_HEADER ${PublicHeaders} ${JINJA2CPP_EXTRA_PUBLIC_HEADERS})

configure_file(jinja2cpp.pc.in jinja2cpp.pc @ONLY)
configure_file(jinja2cpp.pc.in ${CMAKE_BINARY_DIR}/jinja2cpp.pc @ONLY)

if (JINJA2CPP_BUILD_TESTS)
enable_testing()

CollectSources(TestSources TestHeaders ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/test)
add_executable(jinja2cpp_tests ${TestSources} ${TestHeaders})
target_link_libraries(jinja2cpp_tests gtest gtest_main nlohmann_json ${LIB_TARGET_NAME} ${EXTRA_TEST_LIBS} ${JINJA2CPP_PRIVATE_LIBS})
target_link_libraries(jinja2cpp_tests gtest gtest_main
nlohmann_json::nlohmann_json ${LIB_TARGET_NAME} ${EXTRA_TEST_LIBS} ${JINJA2CPP_PRIVATE_LIBS})

set_target_properties(jinja2cpp_tests PROPERTIES
CXX_STANDARD ${JINJA2CPP_CXX_STANDARD}
Expand Down
15 changes: 8 additions & 7 deletions thirdparty/thirdparty-conan-build.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
message(STATUS "'conan-build' dependencies mode selected for Jinja2Cpp. All dependencies are taken as a conan packages")

find_package(expected-lite)
find_package(variant-lite)
find_package(optional-lite)
find_package(string-view-lite)
find_package(expected-lite REQUIRED)
find_package(variant-lite REQUIRED)
find_package(optional-lite REQUIRED)
find_package(string-view-lite REQUIRED)
find_package(nlohmann_json REQUIRED)

find_package(Boost)
set(CONAN_BOOST_PACKAGE_NAME Boost::Boost)
find_package(fmt)
find_package(rapidjson)
find_package(RapidJSON)

set(JINJA2_PRIVATE_LIBS_INT ${CONAN_BOOST_PACKAGE_NAME} fmt::fmt rapidjson::rapidjson)
set(JINJA2_PUBLIC_LIBS_INT expected-lite::expected-lite variant-lite::variant-lite optional-lite::optional-lite string-view-lite::string-view-lite)
set(JINJA2_PRIVATE_LIBS_INT ${CONAN_BOOST_PACKAGE_NAME} fmt::fmt RapidJSON::RapidJSON nlohmann_json::nlohmann_json)
set(JINJA2_PUBLIC_LIBS_INT nonstd::expected-lite nonstd::variant-lite nonstd::optional-lite nonstd::string-view-lite)

0 comments on commit dae174c

Please sign in to comment.