Skip to content

Commit

Permalink
Generated export autocommit from mamba.ru
Browse files Browse the repository at this point in the history
  • Loading branch information
GitLab Runner committed Dec 6, 2023
1 parent c19674b commit da10856
Show file tree
Hide file tree
Showing 11 changed files with 157 additions and 16 deletions.
22 changes: 22 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
*_build.counter
*build_info.h
*~
*.kdev4
*.pyc
.cproject
.project
*.o
*/debug
*/release
*/build
build
.tup
*.kch
autom4te.cache
*.deps
CMakeFiles
CMakeCache.txt
*.kate-swp
*build_info.h
config.h
docs
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)

project(wfc CXX)
project(wfc VERSION "0.9.8")

include(cmake/ci.cmake)
include(cmake/BuildInfo.cmake)
Expand All @@ -17,7 +17,7 @@ wci_submodule(NAME iow )
wci_submodule(NAME wjrpc )
wci_submodule(NAME wrtstat )

target_include_directories(wfc PUBLIC "${wfc_SOURCE_DIR}")
target_include_directories(wfc PUBLIC "$<BUILD_INTERFACE:${wfc_SOURCE_DIR}>")


if ( BUILD_TESTING )
Expand All @@ -27,3 +27,5 @@ if ( BUILD_TESTING )
add_subdirectory(examples)
endif()
endif()

include(cmake/install.cmake)
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM debian
ENV LANG ru_RU.UTF-8
ENV TZ="Europe/Moscow"
RUN apt update
RUN apt -y install g++ cmake git wget make
COPY . /prj
WORKDIR "/prj"
RUN make release
RUN make install
RUN rm -rf /prj
26 changes: 18 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ help:
@echo " make shared"
@echo " make static"
@echo " make release"
@echo " make install"
@echo " make tests"
@echo " make doc"
@echo " make cppcheck"
Expand All @@ -16,12 +15,18 @@ help:
@echo " make clean"
@echo " make update"
@echo " make upgrade"
@echo " make install"
@echo " make docker-build"
@echo " make docker-run"
@echo " make docker-rm"
@echo "Example:"
@echo " make static "
@echo " make shared VERBOSE=1 ARGS=-j5"
@echo " BUILD_SHARED_LIBS=ON make tests"
@echo " make install ARGS=\"--prefix ./build/test-install\""

CMAKE ?= cmake
PRJ = `basename ${PWD}`

doc:
rm -rf docs
Expand All @@ -36,6 +41,10 @@ init: runup
./external/cmake-ci/scripts/after_make.sh
cppcheck: runup
./external/cmake-ci/scripts/cppcheck-ci.sh
release: runup
cd build && ${CMAKE} .. -DDISABLE_WARNINGS=ON
${CMAKE} --build ./build -- $(or ${ARGS},-j4)
./external/cmake-ci/scripts/after_make.sh
static: runup
cd build && ${CMAKE} .. -DBUILD_SHARED_LIBS=OFF -DDISABLE_WARNINGS=ON
${CMAKE} --build ./build -- $(or ${ARGS},-j4)
Expand All @@ -44,13 +53,6 @@ shared: runup
cd build && ${CMAKE} .. -DBUILD_SHARED_LIBS=ON -DDISABLE_WARNINGS=ON
${CMAKE} --build ./build -- $(or ${ARGS},-j4)
./external/cmake-ci/scripts/after_make.sh
release: runup
cd build && ${CMAKE} .. -DDISABLE_WARNINGS=ON
${CMAKE} --build ./build -- $(or ${ARGS},-j4)
./external/cmake-ci/scripts/after_make.sh
install: runup
cd build && ${CMAKE} .. -DDISABLE_WARNINGS=ON
${CMAKE} --install ./build
tests: runup
cd build && ${CMAKE} .. -DBUILD_TESTING=ON
${CMAKE} --build ./build -- $(or ${ARGS},-j4)
Expand Down Expand Up @@ -86,3 +88,11 @@ update: runup
./external/cmake-ci/scripts/update.sh
upgrade: update
./external/cmake-ci/scripts/upgrade.sh
install: runup
${CMAKE} --install ./build ${ARGS}
docker-build:
docker build -t ${PRJ} -f Dockerfile.build .
docker-run:
docker run --rm -it ${PRJ}
docker-rm:
docker rmi ${PRJ}
58 changes: 58 additions & 0 deletions cmake/install.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
set(VERSION_MAJOR "${${PROJECT_NAME}_VERSION_MAJOR}")
set(VERSION_MINOR "${${PROJECT_NAME}_VERSION_MINOR}")
set(VERSION_PATCH "${${PROJECT_NAME}_VERSION_PATCH}")

message(STATUS "${PROJECT_VERSION}: ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")

if ( IS_DIRECTORY ${PROJECT_NAME} )
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config/version.hpp.in"
"${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}/version.hpp" )
endif()

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config/version.yml.in"
"${CMAKE_CURRENT_SOURCE_DIR}/version.yml" )


include(GNUInstallDirs)
include(CMakePackageConfigHelpers)

set(package_config_destination ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})

configure_package_config_file(
${CMAKE_CURRENT_LIST_DIR}/../config/projectConfig.cmake.in ${PROJECT_NAME}Config.cmake
INSTALL_DESTINATION ${package_config_destination}
)
write_basic_package_version_file(
${PROJECT_NAME}ConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)

install(
EXPORT ${PROJECT_NAME}Targets
DESTINATION ${package_config_destination}
)

install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION ${package_config_destination}
)

install(
TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Targets
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)

if ( IS_DIRECTORY ${PROJECT_SOURCE_DIR}/${PROJECT_NAME} )
install(
DIRECTORY ${PROJECT_SOURCE_DIR}/${PROJECT_NAME}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/"
PATTERN *.hpp
)
endif()

7 changes: 7 additions & 0 deletions config/projectConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@PACKAGE_INIT@

include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")

check_required_components(@PROJECT_NAME@)

add_library(fas::testing ALIAS fas_testing)
7 changes: 7 additions & 0 deletions config/version.hpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once

#define PROJECT_NAME "@PROJECT_NAME@"
#define VERSION_MAJOR "@VERSION_MAJOR@"
#define VERSION_MINOR "@VERSION_MINOR@"
#define VERSION_PATCH "@VERSION_PATCH@"

4 changes: 4 additions & 0 deletions config/version.yml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
variables:
RELEASE_TAG: "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@"
RELEASE_BRANCH: "release-@VERSION_MAJOR@.@VERSION_MINOR@"

4 changes: 4 additions & 0 deletions version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
variables:
RELEASE_TAG: "0.9.8"
RELEASE_BRANCH: "release-0.9"

22 changes: 16 additions & 6 deletions wfc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
add_library(wfc_core_vars OBJECT core/vars.cpp core/detail/private_vars.cpp)
update_ogenc(TARGETS wfc_core_vars WARNINGS -Wnull-dereference OFF)
target_link_libraries(wfc_core_vars PRIVATE iow wjson Boost::regex)
#add_library(
# wfc_core_vars
# OBJECT
# core/vars.cpp
# core/detail/private_vars.cpp
#)

#update_ogenc(TARGETS wfc_core_vars WARNINGS -Wnull-dereference OFF)

#target_link_libraries(wfc_core_vars PRIVATE iow wjson Boost::regex)

add_library(wfc
wfc.cpp
Expand All @@ -13,6 +20,8 @@ add_library(wfc
core/instance_args.cpp
core/extended_args.cpp
core/object_registry.cpp
core/vars.cpp
core/detail/private_vars.cpp
statistics/statistics.cpp
module/component.cpp
module/module.cpp
Expand All @@ -21,7 +30,8 @@ add_library(wfc
testing/testing_wfc.cpp
)

wci_targets(wfc wfc_core_vars)
#wci_targets(wfc wfc_core_vars)
wci_targets(wfc)
enable_stat(wfc)

target_compile_definitions(wfc PRIVATE -DBOOST_ASIO_NO_DEPRECATED)
Expand All @@ -41,7 +51,7 @@ target_link_libraries(
wjson
faslib
${Boost_LIBRARIES}
wfc_core_vars
# wfc_core_vars
)

add_dependencies(wfc wfc_core_vars)
#add_dependencies(wfc wfc_core_vars)
7 changes: 7 additions & 0 deletions wfc/version.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once

#define PROJECT_NAME "wfc"
#define VERSION_MAJOR "0"
#define VERSION_MINOR "9"
#define VERSION_PATCH "8"

0 comments on commit da10856

Please sign in to comment.