diff --git a/features/cmake/__init__.py b/features/cmake/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/features/cmake/find_package/__init__.py b/features/cmake/find_package/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/features/cmake/find_package/exported_targets_multiconfig/README.md b/features/cmake/find_package/exported_targets_multiconfig/README.md deleted file mode 100644 index a3c32120..00000000 --- a/features/cmake/find_package/exported_targets_multiconfig/README.md +++ /dev/null @@ -1,85 +0,0 @@ -Using non-intrusive multi-config CMake with exported targets & find_package -=========================================================================== - -In this example ---------------- - -We are using CMake to declare, export and install the targets of a `bye` library that depends on a `hello` library. -Then using Conan to manage the packages and using these libraries in a project. - -**NOTE**: *This is not* the recommended way to use Conan based on ``find_package`` (look at the "cons") but indeed a possibility. - -Everything is based on the ``find_package`` feature and working with multi-config packages (Release/Debug) to avoid -installing the dependencies every time we change from Debug to Release in the Visual Studio IDE. - - - We have a "hello" library consumed by a "bye" library and a "project" that uses the "bye" function. - - The "hello" library exports its own ``helloTargets.cmake`` files, everything is pure CMake, every time we call - CMake with a different build type CMake exports a ``helloTargets-{build_type}.cmake`` script. - - The conan recipe uses the same binary package for any ``build_type``, by removing the ``build_type`` setting. - - The conan recipe at the ``build`` method invokes CMake both for Release and Debug, generating for the same package. - - The same for the "bye" library. - - -Some useful details of this example ------------------------------------- - - - The ``CMakeLists.txt`` of the consumer project (at folder project) calls only ``find_package`` to manage - the dependencies transparently (both with ``bye`` and ``hello``): - -``` -cmake_minimum_required(VERSION 3.0) -project(PackageTest CXX) - -find_package(bye CONFIG) -add_executable(example example.cpp) -target_link_libraries(example bye::bye) -``` - - - The ``CMakeLists.txt`` files for ``bye`` and ``hello`` are quite similar, the same code except the library name and - dependencies are changed in the first part. So you could use a similar ``CMakeLists.txt`` if you want to follow this - approach. - - It is important to add the ``CONFIG`` option to ``find_package`` so that *module mode* is explicitly skipped by CMake. This helps to - solve issues when there is for example a ``Findbye.cmake`` file in CMake's default modules directory that maybe is loaded instead of the - ``byeConfig.cmake`` generated by Conan. - - The ``helloConfig.cmake`` and ``byeConfig.cmake`` are not auto-generated. They have to manually call `find_dependency` - for all the dependencies and then include the targets. In this case, the ``bye`` library needs to find the ``hello``: - - ``` - include(CMakeFindDependencyMacro) - find_dependency(hello) - - include("${CMAKE_CURRENT_LIST_DIR}/byeTargets.cmake") - ``` - - - The recipes are not even using ``package_info()`` method for the consumers - -Pros ----- - -- If you are going to consume your packages only with CMake, this is a totally non-intrusive and decoupled mechanism. -- You don't need to change anything in the ``CMakeLists.txt`` related to Conan. -- The multi-config mechanism works good, it is very comfortable, only one ``conan install`` for the dependencies. - - -Cons ----- - - - You cannot consume Conan packages with other mechanism than ``CMake find_package``, no ``package_info`` method has been - declared. The logic for the consumer lives exclusively in the ``.cmake`` files installed by CMake, so if I want to use - any package with other build system like ``Autotools`` I won't be able to do it. - - - Any other information about the libraries that a classic ``self.cppinfo`` object might have (like a compilation flag or definition), - won't be applied to the targets automatically. - - - You need to build packages containing all the build_types in the same Conan binary package. The ``find_package`` - mechanism will find only one ``XXXConfig.cmake`` file, so all the ```XXXTarget-{build_type}``` have to be together. - - - The targets are transitive but you need to "model" the dependencies in the ``XXXConfig.cmake`` files, by calling ``find_dependency``, so you are - duplicating information that Conan already knows (dependency graph). - - -How to try it -------------- - - - Open the "build.bat" or "build.sh" to see the steps of the example. If you run it, it will create the packages for "hello" and "bye" - and will build the "project" changing the build_type and verifying that the linked dependencies are correct for the selected build_type. \ No newline at end of file diff --git a/features/cmake/find_package/exported_targets_multiconfig/__init__.py b/features/cmake/find_package/exported_targets_multiconfig/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/features/cmake/find_package/exported_targets_multiconfig/build.bat b/features/cmake/find_package/exported_targets_multiconfig/build.bat deleted file mode 100644 index 7ef40d6c..00000000 --- a/features/cmake/find_package/exported_targets_multiconfig/build.bat +++ /dev/null @@ -1,23 +0,0 @@ -pushd hello -conan create . user/channel -popd - -pushd bye -conan create . user/channel -popd - -pushd project -rd /s /q "build" -mkdir build -pushd build - -conan install .. -cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_paths.cmake -cmake --build . --config Debug -cmake --build . --config Release - -Debug\example -Release\example - -popd -popd diff --git a/features/cmake/find_package/exported_targets_multiconfig/build.sh b/features/cmake/find_package/exported_targets_multiconfig/build.sh deleted file mode 100755 index e6222df0..00000000 --- a/features/cmake/find_package/exported_targets_multiconfig/build.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -set -e -pushd hello -conan create . user/channel -popd - -pushd bye -conan create . user/channel -popd - -pushd project -rm -rf "build" -mkdir build -pushd build - -conan install .. -cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_paths.cmake -DCMAKE_BUILD_TYPE=Debug -cmake --build . -./example - -cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_paths.cmake -DCMAKE_BUILD_TYPE=Release -cmake --build . -./example - -popd -popd diff --git a/features/cmake/find_package/exported_targets_multiconfig/bye/__init__.py b/features/cmake/find_package/exported_targets_multiconfig/bye/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/features/cmake/find_package/exported_targets_multiconfig/bye/conanfile.py b/features/cmake/find_package/exported_targets_multiconfig/bye/conanfile.py deleted file mode 100644 index 26b79abf..00000000 --- a/features/cmake/find_package/exported_targets_multiconfig/bye/conanfile.py +++ /dev/null @@ -1,22 +0,0 @@ -from conans import ConanFile, CMake - - -class ByeConan(ConanFile): - name = "bye" - version = "1.0" - settings = "os", "compiler", "arch" - options = {"shared": [True, False]} - default_options = "shared=False" - generators = "cmake_paths" - exports_sources = "src/*" - requires = "hello/1.0@user/channel" - - def build(self): - for bt in ("Debug", "Release"): - cmake = CMake(self, build_type=bt) - cmake.definitions["CMAKE_TOOLCHAIN_FILE"] = "conan_paths.cmake" - cmake.definitions["CMAKE_FIND_DEBUG_MODE"] = "ON" - - cmake.configure(source_folder="src") - cmake.build() - cmake.install() diff --git a/features/cmake/find_package/exported_targets_multiconfig/bye/src/CMakeLists.txt b/features/cmake/find_package/exported_targets_multiconfig/bye/src/CMakeLists.txt deleted file mode 100644 index ab8bf944..00000000 --- a/features/cmake/find_package/exported_targets_multiconfig/bye/src/CMakeLists.txt +++ /dev/null @@ -1,58 +0,0 @@ -cmake_minimum_required(VERSION 3.0) - -# CHANGE PROJECT NAME, SOURCES AND DEPENDANT TARGETS -project(bye CXX) - -set(TARGET_NAME ${PROJECT_NAME}) -set(${TARGET_NAME}_SRC bye.cpp) -set(${TARGET_NAME}_HEADERS bye.h) -set(TARGETS_TO_FIND hello) -set(DEBUG_LIBRARY_SUFFIX "d") - - -# GENERIC PART -add_library(${TARGET_NAME} ${${TARGET_NAME}_SRC} ${${TARGET_NAME}_HEADERS}) -set_target_properties(${TARGET_NAME} PROPERTIES - PUBLIC_HEADER "${${TARGET_NAME}_HEADERS}" - OUTPUT_NAME "${TARGET_NAME}$<$:${DEBUG_LIBRARY_SUFFIX}>") - -target_include_directories(${TARGET_NAME} PUBLIC - "$" - "$/${CMAKE_INSTALL_INCLUDEDIR}>") - -foreach(dep ${TARGETS_TO_FIND}) - find_package(${dep} CONFIG) - message("BUILD TYPE: ${CMAKE_BUILD_TYPE}") - target_link_libraries(${TARGET_NAME} ${dep}::${dep}) -endforeach() - - -# Write the library and headers -install(TARGETS ${TARGET_NAME} EXPORT ${TARGET_NAME}Targets - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") - -# Export the target to be used by other projects -export(EXPORT ${TARGET_NAME}Targets - FILE "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}/${TARGET_NAME}Targets.cmake" - NAMESPACE ${TARGET_NAME}:: -) - -set(ConfigPackageLocation lib/cmake/${TARGET_NAME}) - -# Install the exported target -install(EXPORT ${TARGET_NAME}Targets - FILE ${TARGET_NAME}Targets.cmake - NAMESPACE ${TARGET_NAME}:: - DESTINATION ${ConfigPackageLocation} -) - -# Install the XXXConfig.cmake file -install( - FILES - ${TARGET_NAME}Config.cmake - DESTINATION - ${ConfigPackageLocation} -) diff --git a/features/cmake/find_package/exported_targets_multiconfig/bye/src/bye.cpp b/features/cmake/find_package/exported_targets_multiconfig/bye/src/bye.cpp deleted file mode 100644 index 9468af17..00000000 --- a/features/cmake/find_package/exported_targets_multiconfig/bye/src/bye.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include "bye.h" -#include "hello.h" - -void bye(){ - - hello(); - - #ifdef NDEBUG - std::cout << "bye World Release!" <:${DEBUG_LIBRARY_SUFFIX}>") - -target_include_directories(${TARGET_NAME} PUBLIC - "$" - "$/${CMAKE_INSTALL_INCLUDEDIR}>") - -foreach(dep ${TARGETS_TO_FIND}) - find_package(${dep} CONFIG) - target_link_libraries(${TARGET_NAME} ${dep}::${dep}) -endforeach() - - -# Write the library and headers -install(TARGETS ${TARGET_NAME} EXPORT ${TARGET_NAME}Targets - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") - -# Export the target to be used by other projects -export(EXPORT ${TARGET_NAME}Targets - FILE "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}/${TARGET_NAME}Targets.cmake" - NAMESPACE ${TARGET_NAME}:: -) - -set(ConfigPackageLocation lib/cmake/${TARGET_NAME}) - -# Install the exported target -install(EXPORT ${TARGET_NAME}Targets - FILE ${TARGET_NAME}Targets.cmake - NAMESPACE ${TARGET_NAME}:: - DESTINATION ${ConfigPackageLocation} -) - -# Install the XXXConfig.cmake file -install( - FILES - ${TARGET_NAME}Config.cmake - DESTINATION - ${ConfigPackageLocation} -) diff --git a/features/cmake/find_package/exported_targets_multiconfig/hello/src/hello.cpp b/features/cmake/find_package/exported_targets_multiconfig/hello/src/hello.cpp deleted file mode 100644 index 235428a0..00000000 --- a/features/cmake/find_package/exported_targets_multiconfig/hello/src/hello.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include "hello.h" - -void hello(){ - #ifdef NDEBUG - std::cout << "Hello World Release!" < -#include "bye.h" - -int main() { - bye(); -} diff --git a/features/cmake/find_package/find_cmake_multi_generator_targets/README.md b/features/cmake/find_package/find_cmake_multi_generator_targets/README.md deleted file mode 100644 index 258055c9..00000000 --- a/features/cmake/find_package/find_cmake_multi_generator_targets/README.md +++ /dev/null @@ -1,63 +0,0 @@ -Using non-intrusive multi-config CMake with cmake_find_package_generator_multi -============================================================================== - -In this example ---------------- - -We are using Conan to create for us the necessary ``XXXConfig.cmake`` scripts both for Release and Debug. -Everything is based on the ``find_package`` feature and working with multi-config packages (Release/Debug) to avoid -installing the dependencies every time we change from Debug to Release in the Visual Studio IDE. - - - We have a "hello" library consumed by a "bye" library and a project that uses the "bye" function. - - The "hello" library has a ``package_info()`` method declaring the "hello" library name for the consumers. - - The conan recipe uses a different binary package for any ``build_type``, one package for Debug and other for Release. - - The same for the "bye" library. - - There is a project using targets (CMake 3.x) and linking with "bye" (and hello because of the transitivity) - -Some useful details of this example ------------------------------------- - - - The ``CMakeLists.txt`` files for ``bye`` and ``hello`` are very simple, we are not installing nor exporting anything. - - It is important to add the ``CONFIG`` option to ``find_package`` so that *module mode* is explicitly skipped by CMake. This helps to - solve issues when there is for example a ``FindXXXX.cmake`` file in CMake's default modules directory that maybe is loaded instead of the - ``XXXXConfig.cmake`` generated by Conan. - - This is the one for ``bye``: - ```cmake - find_package(hello CONFIG) - add_library(bye bye.cpp) - target_link_libraries(bye hello::hello) - ``` - - - The recipes are using ``package_info()`` method for the consumers - - The recipes are using ``package()`` method to extract the libraries and headers, instead of using cmake install. - -Pros ----- - -- You can consume the conan packages for ``hello`` and ``bye`` from any build system only specifying the generator - that matches your needs. -- You don't need to change anything in the ``CMakeLists.txt`` related to Conan. -- The multi-config mechanism works good, it is very comfortable, You call ``conan install`` for debug and other for Release - and you are done. -- The generated targets are **completely transitive** and contain all the information about the dependencies. So you need - call ``find_package`` for your direct dependency packages. With the classic CMake targets, you typically need to specify one ``find_package`` - for each dependency that you need, directly or indirectly. - - -Cons ----- - - - You have to assume that the cmake scripts created by this generator **ARE NOT** the same as the `CMake` installation modules files and they - are not replaceable in most cases: - - - Because of the transitivity of the targets (you will need to change your CMakeLists if you were calling ``find_package`` for all the transitive deps) - - The name of the targets and the library name to be used at `find_package(NAME)` might be different for the "official" one. - - -How to try it -------------- - - - Open the "build.bat" or "build.sh" to see the steps of the example. If you run it, it will create the packages for "hello" and "bye" - and will build the "project" changing the build_type and verifying that the linked dependencies are correct for the selected build_type. - - If you are using Linux or Mac you can use almost the same steps in the run.bat adapted to your OSS \ No newline at end of file diff --git a/features/cmake/find_package/find_cmake_multi_generator_targets/__init__.py b/features/cmake/find_package/find_cmake_multi_generator_targets/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/features/cmake/find_package/find_cmake_multi_generator_targets/build.bat b/features/cmake/find_package/find_cmake_multi_generator_targets/build.bat deleted file mode 100644 index b4402238..00000000 --- a/features/cmake/find_package/find_cmake_multi_generator_targets/build.bat +++ /dev/null @@ -1,25 +0,0 @@ -pushd hello -conan create . user/channel -s build_type=Debug -conan create . user/channel -s build_type=Release -popd - -pushd bye -conan create . user/channel -s build_type=Debug -conan create . user/channel -s build_type=Release -popd - -pushd project - -rd /s /q "build" -mkdir build -pushd BUILD -conan install .. -s build_type=Debug -conan install .. -s build_type=Release -cmake .. -cmake --build . --config Debug -cmake --build . --config Release -Debug\example.exe -Release\example.exe - -popd -popd diff --git a/features/cmake/find_package/find_cmake_multi_generator_targets/build.sh b/features/cmake/find_package/find_cmake_multi_generator_targets/build.sh deleted file mode 100755 index ba66978a..00000000 --- a/features/cmake/find_package/find_cmake_multi_generator_targets/build.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -set -e -pushd hello -conan create . user/channel -s build_type=Debug -conan create . user/channel -s build_type=Release -popd - -pushd bye -conan create . user/channel -s build_type=Debug -conan create . user/channel -s build_type=Release -popd - -pushd project - -rm -rf "build" -mkdir build -pushd build - -conan install .. -s build_type=Debug -conan install .. -s build_type=Release - -cmake .. -DCMAKE_BUILD_TYPE=Debug -cmake --build . -./example - -cmake .. -DCMAKE_BUILD_TYPE=Release -cmake --build . -./example - -popd -popd diff --git a/features/cmake/find_package/find_cmake_multi_generator_targets/bye/__init__.py b/features/cmake/find_package/find_cmake_multi_generator_targets/bye/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/features/cmake/find_package/find_cmake_multi_generator_targets/bye/conanfile.py b/features/cmake/find_package/find_cmake_multi_generator_targets/bye/conanfile.py deleted file mode 100644 index c9e023d0..00000000 --- a/features/cmake/find_package/find_cmake_multi_generator_targets/bye/conanfile.py +++ /dev/null @@ -1,28 +0,0 @@ -from conans import ConanFile, CMake - - -class ByeConan(ConanFile): - name = "bye" - version = "1.0" - settings = "os", "compiler", "arch", "build_type" - options = {"shared": [True, False]} - default_options = "shared=False" - generators = "cmake_find_package_multi" - exports_sources = "src/*" - requires = "hello/1.0@user/channel" - - def build(self): - cmake = CMake(self) - cmake.configure(source_folder="src") - cmake.build() - - def package(self): - self.copy("*.h", dst="include", keep_path=False) - self.copy("*.lib", dst="lib", keep_path=False) - self.copy("*.dll", dst="bin", keep_path=False) - self.copy("*.so", dst="lib", keep_path=False) - self.copy("*.dylib", dst="lib", keep_path=False) - self.copy("*.a", dst="lib", keep_path=False) - - def package_info(self): - self.cpp_info.libs.append("bye") diff --git a/features/cmake/find_package/find_cmake_multi_generator_targets/bye/src/CMakeLists.txt b/features/cmake/find_package/find_cmake_multi_generator_targets/bye/src/CMakeLists.txt deleted file mode 100644 index 5c8f1feb..00000000 --- a/features/cmake/find_package/find_cmake_multi_generator_targets/bye/src/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(PackageTest CXX) - -find_package(hello CONFIG) -add_library(bye bye.cpp) -target_link_libraries(bye hello::hello) diff --git a/features/cmake/find_package/find_cmake_multi_generator_targets/bye/src/bye.cpp b/features/cmake/find_package/find_cmake_multi_generator_targets/bye/src/bye.cpp deleted file mode 100644 index 9468af17..00000000 --- a/features/cmake/find_package/find_cmake_multi_generator_targets/bye/src/bye.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include "bye.h" -#include "hello.h" - -void bye(){ - - hello(); - - #ifdef NDEBUG - std::cout << "bye World Release!" < -#include "hello.h" - -void hello(){ - #ifdef NDEBUG - std::cout << "Hello World Release!" < -#include "bye.h" - -int main() { - bye(); -} diff --git a/features/deployment/.gitignore b/features/deployment/.gitignore deleted file mode 100644 index fba716b0..00000000 --- a/features/deployment/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -build -install -md5.run diff --git a/features/deployment/CMakeLists.txt b/features/deployment/CMakeLists.txt deleted file mode 100644 index 522f31cb..00000000 --- a/features/deployment/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(MD5Encrypter) - -find_package(Poco CONFIG REQUIRED) - -add_executable(md5 md5.cpp) -target_link_libraries(md5 Poco::Poco) - -install(TARGETS md5 - RUNTIME DESTINATION bin - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib) - diff --git a/features/deployment/build.sh b/features/deployment/build.sh deleted file mode 100755 index 626c5773..00000000 --- a/features/deployment/build.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -ROOT=${PWD} -PREFIX=${PWD}/install - -mkdir -p build -pushd build - -conan install .. -s build_type=Release --build missing -cmake .. \ - -DCMAKE_PREFIX_PATH=${PWD} \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=${PREFIX} -cmake --build . --target install - -TMPDIR=`dirname $(mktemp -u -t tmp.XXXXXXXXXX)` -curl "https://github.com/megastep/makeself/releases/download/release-2.4.0/makeself-2.4.0.run" --output $TMPDIR/makeself.run -L -chmod +x $TMPDIR/makeself.run -$TMPDIR/makeself.run --target $TMPDIR/makeself - -python ${ROOT}/deploy.py $PREFIX - -$TMPDIR/makeself/makeself.sh $PREFIX ${ROOT}/md5.run "conan-generated makeself.sh" "./conan-entrypoint.sh" - -popd - diff --git a/features/deployment/conanfile.txt b/features/deployment/conanfile.txt deleted file mode 100644 index 6bbb9abe..00000000 --- a/features/deployment/conanfile.txt +++ /dev/null @@ -1,10 +0,0 @@ -[generators] -cmake_find_package_multi -json - -[requires] -poco/1.9.4 - -[options] -*:shared=True - diff --git a/features/deployment/deploy.py b/features/deployment/deploy.py deleted file mode 100755 index 6c50ca48..00000000 --- a/features/deployment/deploy.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 - -from __future__ import print_function -import os -import json -import sys -from distutils.dir_util import copy_tree - -def get_dirs(): - data = json.load(open("conanbuildinfo.json")) - dep_lib_dirs = dict() - dep_bin_dirs = dict() - for dep in data["dependencies"]: - root = dep["rootpath"] - lib_paths = dep["lib_paths"] - bin_paths = dep["bin_paths"] - for lib_path in lib_paths: - if os.listdir(lib_path): - lib_dir = os.path.relpath(lib_path, root) - dep_lib_dirs[lib_path] = lib_dir - for bin_path in bin_paths: - if os.listdir(bin_path): - bin_dir = os.path.relpath(bin_path, root) - dep_bin_dirs[bin_path] = bin_dir - return dep_lib_dirs, dep_bin_dirs - -def chmod_plus_x(name): - if os.name == 'posix': - os.chmod(name, os.stat(name).st_mode | 0o111) - -def create_entry_point(destdir, dep_lib_dirs, dep_bin_dirs): - executable = "md5" - varname = "$PWD" - def _format_dirs(dirs): - return ":".join(["%s/%s" % (varname, d) for d in dirs]) - path = _format_dirs(set(dep_bin_dirs.values())) - ld_library_path = _format_dirs(set(dep_lib_dirs.values())) - exe = varname + "/" + executable - content = """#!/usr/bin/env bash -set -ex -export PATH=$PATH:{path} -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{ld_library_path} -pushd $(dirname {exe}) -$(basename {exe}) -popd -""".format(path=path, - ld_library_path=ld_library_path, - exe=exe) - entrypoint = os.path.join(destdir, "conan-entrypoint.sh") - with open(entrypoint, "w") as f: - f.write(content) - chmod_plus_x(entrypoint) - -def copy_files(destdir, dep_lib_dirs, dep_bin_dirs): - for src_lib_dir, dst_lib_dir in dep_lib_dirs.items(): - copy_tree(src_lib_dir, os.path.join(destdir, dst_lib_dir)) - for src_bin_dir, dst_bin_dir in dep_bin_dirs.items(): - copy_tree(src_bin_dir, os.path.join(destdir, dst_bin_dir)) - -def main(argv): - dep_lib_dirs, dep_bin_dirs = get_dirs() - print(dep_lib_dirs, dep_bin_dirs) - copy_files(argv[1], dep_lib_dirs, dep_bin_dirs) - create_entry_point(argv[1], dep_lib_dirs, dep_bin_dirs) - -if __name__ == '__main__': - main(sys.argv) diff --git a/features/deployment/md5.cpp b/features/deployment/md5.cpp deleted file mode 100644 index 87412ae2..00000000 --- a/features/deployment/md5.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "Poco/MD5Engine.h" -#include "Poco/DigestStream.h" - -#include - -int main(int argc, char** argv) -{ - Poco::MD5Engine md5; - std::string s = "abcdefghijklmnopqrstuvwxyz"; - Poco::DigestOutputStream ds(md5); - ds << s; - ds.close(); - std::cout << "MD5 of \"" << s << "\":" << std::endl; - std::cout << Poco::DigestEngine::digestToHex(md5.digest()) << std::endl; - return 0; -} diff --git a/features/editable/cmake/.gitignore b/features/editable/cmake/.gitignore deleted file mode 100644 index 8654e205..00000000 --- a/features/editable/cmake/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -hello/build -say/build -conanbuildinfo.txt -conaninfo.txt -graph_info.json -conan.lock diff --git a/features/editable/cmake/build.bat b/features/editable/cmake/build.bat deleted file mode 100644 index e47ca9eb..00000000 --- a/features/editable/cmake/build.bat +++ /dev/null @@ -1,51 +0,0 @@ -@ECHO ON - -RMDIR /Q /S say\build -RMDIR /Q /S hello\build - -REM Put say package in editable mode, and build it -conan editable add say/ say/0.1@user/channel - -PUSHD "say" -REM It is very important to install 2 configurations, if you are building later the 2 configs, so the toolchain is multi-config (runtime libs) -REM There is a bug in 1.40, this needs to be done in the root folder -conan install . -s build_type=Release -conan install . -s build_type=Debug -MKDIR "build" -PUSHD "build" -cmake .. -DCMAKE_TOOLCHAIN_FILE=conan/conan_toolchain.cmake -cmake --build . --config Release -cmake --build . --config Debug -POPD -POPD - -REM Build hello consumer -MKDIR "hello/build" -PUSHD "hello/build" -conan install .. -s build_type=Release -conan install .. -s build_type=Debug -cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -cmake --build . --config Release -cmake --build . --config Debug -"Release/hello.exe" -"Debug/hello.exe" -POPD - -REM Do a modification in the source code of the editable say -PUSHD "say/build" -COPY ..\src\say2.cpp ..\src\say.cpp /Y -TOUCH ..\src\say.cpp -cmake --build . --config Release -cmake --build . --config Debug -POPD - -REM Build and execute the consumer depending on the editable -PUSHD "hello/build" -cmake --build . --config Release -cmake --build . --config Debug -"Release/hello.exe" -"Debug/hello.exe" -POPD - - -conan editable remove say/0.1@user/channel diff --git a/features/editable/cmake/build.sh b/features/editable/cmake/build.sh deleted file mode 100755 index a6a2145a..00000000 --- a/features/editable/cmake/build.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -set -e -set -x - -rm -rf say/cmake-build-release -rm -rf hello/cmake-build-release - - -conan editable add say/ say/0.1@user/channel - -pushd say -conan install . -pushd cmake-build-release -cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=conan/conan_toolchain.cmake -cmake --build . -popd -popd - -mkdir hello/cmake-build-release -pushd hello/cmake-build-release -conan install .. -cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -cmake --build . -./hello -popd - -# Modification to code -pushd say/cmake-build-release -cp ../src/say2.cpp ../src/say.cpp -cmake --build . -popd - -# build consumer again -pushd hello/cmake-build-release -cmake --build . -./hello -popd - -conan editable remove say/0.1@user/channel diff --git a/features/editable/cmake/hello/CMakeLists.txt b/features/editable/cmake/hello/CMakeLists.txt deleted file mode 100644 index a6fd70a5..00000000 --- a/features/editable/cmake/hello/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) - -project(Hello) - -find_package(say REQUIRED) - -add_executable(hello src/hello.cpp) -target_link_libraries(hello say::say) \ No newline at end of file diff --git a/features/editable/cmake/hello/conanfile.txt b/features/editable/cmake/hello/conanfile.txt deleted file mode 100644 index 77700d0d..00000000 --- a/features/editable/cmake/hello/conanfile.txt +++ /dev/null @@ -1,6 +0,0 @@ -[requires] -say/0.1@user/channel - -[generators] -CMakeToolchain -CMakeDeps \ No newline at end of file diff --git a/features/editable/cmake/hello/src/hello.cpp b/features/editable/cmake/hello/src/hello.cpp deleted file mode 100644 index 4d962b91..00000000 --- a/features/editable/cmake/hello/src/hello.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "say.h" - -int main() { - say(); -} \ No newline at end of file diff --git a/features/editable/cmake/say/CMakeLists.txt b/features/editable/cmake/say/CMakeLists.txt deleted file mode 100644 index e920d50b..00000000 --- a/features/editable/cmake/say/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(say CXX) - -add_library(say src/say.cpp) - -set_target_properties(say PROPERTIES PUBLIC_HEADER "src/say.h") -install(TARGETS say DESTINATION "." - PUBLIC_HEADER DESTINATION include - RUNTIME DESTINATION bin - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - ) diff --git a/features/editable/cmake/say/conanfile.py b/features/editable/cmake/say/conanfile.py deleted file mode 100644 index 486ab5ea..00000000 --- a/features/editable/cmake/say/conanfile.py +++ /dev/null @@ -1,46 +0,0 @@ -from conans import ConanFile -from conan.tools.cmake import CMakeToolchain, CMake -from conan.tools.layout import cmake_layout - - -class SayConan(ConanFile): - name = "say" - version = "0.1" - - # Optional metadata - license = "" - author = " " - url = "" - description = "" - topics = ("", "", "") - - # Binary configuration - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} - - # Sources are located in the same place as this recipe, copy them to the recipe - exports_sources = "CMakeLists.txt", "src/*" - - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - def layout(self): - cmake_layout(self) - - def generate(self): - tc = CMakeToolchain(self) - tc.generate() - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def package(self): - cmake = CMake(self) - cmake.install() - - def package_info(self): - self.cpp_info.libs = ["say"] diff --git a/features/editable/cmake/say/src/say.cpp b/features/editable/cmake/say/src/say.cpp deleted file mode 100644 index 5d7df08b..00000000 --- a/features/editable/cmake/say/src/say.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include -#include "say.h" - -void say(){ - #ifdef NDEBUG - std::cout << "say/0.1: Hello World Release!\n"; - #else - std::cout << "say/0.1: Hello World Debug!\n"; - #endif - - // ARCHITECTURES - #ifdef _M_X64 - std::cout << " say/0.1: _M_X64 defined\n"; - #endif - - #ifdef _M_IX86 - std::cout << " say/0.1: _M_IX86 defined\n"; - #endif - - #if __i386__ - std::cout << " say/0.1: __i386__ defined\n"; - #endif - - #if __x86_64__ - std::cout << " say/0.1: __x86_64__ defined\n"; - #endif - - // Libstdc++ - #if defined _GLIBCXX_USE_CXX11_ABI - std::cout << " say/0.1: _GLIBCXX_USE_CXX11_ABI "<< _GLIBCXX_USE_CXX11_ABI << "\n"; - #endif - - // COMPILER VERSIONS - #if _MSC_VER - std::cout << " say/0.1: _MSC_VER" << _MSC_VER<< "\n"; - #endif - - #if _MSVC_LANG - std::cout << " say/0.1: _MSVC_LANG" << _MSVC_LANG<< "\n"; - #endif - - #if __cplusplus - std::cout << " say/0.1: __cplusplus" << __cplusplus<< "\n"; - #endif - - #if __INTEL_COMPILER - std::cout << " say/0.1: __INTEL_COMPILER" << __INTEL_COMPILER<< "\n"; - #endif - - #if __GNUC__ - std::cout << " say/0.1: __GNUC__" << __GNUC__<< "\n"; - #endif - - #if __GNUC_MINOR__ - std::cout << " say/0.1: __GNUC_MINOR__" << __GNUC_MINOR__<< "\n"; - #endif - - #if __clang_major__ - std::cout << " say/0.1: __clang_major__" << __clang_major__<< "\n"; - #endif - - #if __clang_minor__ - std::cout << " say/0.1: __clang_minor__" << __clang_minor__<< "\n"; - #endif - - #if __apple_build_version__ - std::cout << " say/0.1: __apple_build_version__" << __apple_build_version__<< "\n"; - #endif - - // SUBSYSTEMS - - #if __MSYS__ - std::cout << " say/0.1: __MSYS__" << __MSYS__<< "\n"; - #endif - - #if __MINGW32__ - std::cout << " say/0.1: __MINGW32__" << __MINGW32__<< "\n"; - #endif - - #if __MINGW64__ - std::cout << " say/0.1: __MINGW64__" << __MINGW64__<< "\n"; - #endif - - #if __CYGWIN__ - std::cout << " say/0.1: __CYGWIN__" << __CYGWIN__<< "\n"; - #endif -} diff --git a/features/editable/cmake/say/src/say.h b/features/editable/cmake/say/src/say.h deleted file mode 100644 index 54d92ac1..00000000 --- a/features/editable/cmake/say/src/say.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#ifdef WIN32 - #define say_EXPORT __declspec(dllexport) -#else - #define say_EXPORT -#endif - -say_EXPORT void say(); diff --git a/features/editable/cmake/say/src/say2.cpp b/features/editable/cmake/say/src/say2.cpp deleted file mode 100644 index a44b9561..00000000 --- a/features/editable/cmake/say/src/say2.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include -#include "say.h" - -void say(){ - #ifdef NDEBUG - std::cout << "say/0.1: Bye World Release!\n"; - #else - std::cout << "say/0.1: Bye World Debug!\n"; - #endif - - // ARCHITECTURES - #ifdef _M_X64 - std::cout << " say/0.1: _M_X64 defined\n"; - #endif - - #ifdef _M_IX86 - std::cout << " say/0.1: _M_IX86 defined\n"; - #endif - - #if __i386__ - std::cout << " say/0.1: __i386__ defined\n"; - #endif - - #if __x86_64__ - std::cout << " say/0.1: __x86_64__ defined\n"; - #endif - - // Libstdc++ - #if defined _GLIBCXX_USE_CXX11_ABI - std::cout << " say/0.1: _GLIBCXX_USE_CXX11_ABI "<< _GLIBCXX_USE_CXX11_ABI << "\n"; - #endif - - // COMPILER VERSIONS - #if _MSC_VER - std::cout << " say/0.1: _MSC_VER" << _MSC_VER<< "\n"; - #endif - - #if _MSVC_LANG - std::cout << " say/0.1: _MSVC_LANG" << _MSVC_LANG<< "\n"; - #endif - - #if __cplusplus - std::cout << " say/0.1: __cplusplus" << __cplusplus<< "\n"; - #endif - - #if __INTEL_COMPILER - std::cout << " say/0.1: __INTEL_COMPILER" << __INTEL_COMPILER<< "\n"; - #endif - - #if __GNUC__ - std::cout << " say/0.1: __GNUC__" << __GNUC__<< "\n"; - #endif - - #if __GNUC_MINOR__ - std::cout << " say/0.1: __GNUC_MINOR__" << __GNUC_MINOR__<< "\n"; - #endif - - #if __clang_major__ - std::cout << " say/0.1: __clang_major__" << __clang_major__<< "\n"; - #endif - - #if __clang_minor__ - std::cout << " say/0.1: __clang_minor__" << __clang_minor__<< "\n"; - #endif - - #if __apple_build_version__ - std::cout << " say/0.1: __apple_build_version__" << __apple_build_version__<< "\n"; - #endif - - // SUBSYSTEMS - - #if __MSYS__ - std::cout << " say/0.1: __MSYS__" << __MSYS__<< "\n"; - #endif - - #if __MINGW32__ - std::cout << " say/0.1: __MINGW32__" << __MINGW32__<< "\n"; - #endif - - #if __MINGW64__ - std::cout << " say/0.1: __MINGW64__" << __MINGW64__<< "\n"; - #endif - - #if __CYGWIN__ - std::cout << " say/0.1: __CYGWIN__" << __CYGWIN__<< "\n"; - #endif -} diff --git a/features/emscripten/.gitignore b/features/emscripten/.gitignore deleted file mode 100644 index 76b68eb3..00000000 --- a/features/emscripten/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -bin -conaninfo.txt -conanbuildinfo.txt -conan_imports_manifest.txt -activate.ps1 -activate.bat -activate.sh -deactivate.ps1 -deactivate.bat -deactivate.sh diff --git a/features/emscripten/CMakeLists.txt b/features/emscripten/CMakeLists.txt deleted file mode 100644 index 50c8898a..00000000 --- a/features/emscripten/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -project(conan-hello-emscripten) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_executable(${PROJECT_NAME} main.cpp) - -target_include_directories(${PROJECT_NAME} PRIVATE ${CONAN_INCLUDE_DIRS}) -target_link_libraries(${PROJECT_NAME} PRIVATE ${CONAN_LIBS}) - -set_target_properties(${PROJECT_NAME} PROPERTIES - SUFFIX ".html" - LINK_FLAGS "--emrun") - -install(TARGETS ${PROJECT_NAME} - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) - -install(FILES - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.js - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.wasm - DESTINATION bin) diff --git a/features/emscripten/build.bat b/features/emscripten/build.bat deleted file mode 100755 index f1ad5257..00000000 --- a/features/emscripten/build.bat +++ /dev/null @@ -1,5 +0,0 @@ -@echo off - -conan remove conan-hello-emscripten/* -f -conan create . conan/testing --profile:host=emscripten.profile --profile:build=default --build missing -conan install conanfile.txt --profile:host=emscripten.profile --profile:build=default --build missing diff --git a/features/emscripten/build.sh b/features/emscripten/build.sh deleted file mode 100755 index 7a5b149c..00000000 --- a/features/emscripten/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -conan remove conan-hello-emscripten/* -f -conan create . conan/testing --profile:host=emscripten.profile --profile:build=default --build missing -conan install conanfile.txt --profile:host=emscripten.profile --profile:build=default diff --git a/features/emscripten/conanfile.py b/features/emscripten/conanfile.py deleted file mode 100644 index 92a9390b..00000000 --- a/features/emscripten/conanfile.py +++ /dev/null @@ -1,28 +0,0 @@ -from conans import ConanFile, CMake - - -class ConanHelloEmscripten(ConanFile): - name = "conan-hello-emscripten" - version = "1.0" - description = "hello-world example of conan usage with Emscripten" - topics = ("conan", "hello", "emscripten", "js", "javascript") - license = "MIT" - url = "https://github.com/conan-io/examples" - homepage = "https://github.com/conan-io/examples" - settings = {"os": ["Emscripten"]} - requires = "zlib/1.2.11" - exports_sources = ["CMakeLists.txt", "main.cpp"] - generators = ["cmake"] - - def _configure_cmake(self): - cmake = CMake(self) - cmake.configure() - return cmake - - def build(self): - cmake = self._configure_cmake() - cmake.build() - - def package(self): - cmake = self._configure_cmake() - cmake.install() diff --git a/features/emscripten/conanfile.txt b/features/emscripten/conanfile.txt deleted file mode 100644 index 47f9f55a..00000000 --- a/features/emscripten/conanfile.txt +++ /dev/null @@ -1,8 +0,0 @@ -[requires] -conan-hello-emscripten/1.0@conan/testing -[generators] -virtualenv -[imports] -bin, *.html -> ./bin -bin, *.wasm -> ./bin -bin, *.js -> ./bin diff --git a/features/emscripten/emscripten.profile b/features/emscripten/emscripten.profile deleted file mode 100644 index 3d3afd1a..00000000 --- a/features/emscripten/emscripten.profile +++ /dev/null @@ -1,9 +0,0 @@ -[settings] -os=Emscripten -arch=wasm -compiler=clang -compiler.version=14 -build_type=Release - -[build_requires] -emsdk/2.0.30 diff --git a/features/emscripten/main.cpp b/features/emscripten/main.cpp deleted file mode 100644 index d9a34776..00000000 --- a/features/emscripten/main.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include - -int main() -{ - std::cout << "Using zlib version: " << zlibVersion() << std::endl; -} diff --git a/features/emscripten/run.cmd b/features/emscripten/run.cmd deleted file mode 100755 index e93c47bb..00000000 --- a/features/emscripten/run.cmd +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -call activate.bat -emrun bin\conan-hello-emscripten.html diff --git a/features/emscripten/run.sh b/features/emscripten/run.sh deleted file mode 100755 index cd187a05..00000000 --- a/features/emscripten/run.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -source activate.sh -emrun ./bin/conan-hello-emscripten.html diff --git a/features/integrate_build_system/build.bat b/features/integrate_build_system/build.bat deleted file mode 100644 index f64fcd65..00000000 --- a/features/integrate_build_system/build.bat +++ /dev/null @@ -1 +0,0 @@ -python build.py \ No newline at end of file diff --git a/features/integrate_build_system/build.py b/features/integrate_build_system/build.py deleted file mode 100644 index ebe981cf..00000000 --- a/features/integrate_build_system/build.py +++ /dev/null @@ -1,20 +0,0 @@ -import os -import subprocess - - -def run(cmd): - ret = os.system(cmd) - if ret != 0: - raise Exception("Failed command: %s" % cmd) - - -def main(): - run("conan create waf-generator user/channel") - run("conan create waf-installer user/channel") - run("conan create waf-build-helper user/channel") - run("conan create waf-mylib user/channel -s compiler.cppstd=14") - run("conan create mylib-consumer waf-consumer/1.0@user/channel -s compiler.cppstd=14") - - -if __name__ == '__main__': - main() diff --git a/features/integrate_build_system/build.sh b/features/integrate_build_system/build.sh deleted file mode 100755 index 35c3146a..00000000 --- a/features/integrate_build_system/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -set -ex - -python build.py \ No newline at end of file diff --git a/features/integrate_build_system/mylib-consumer/conanfile.py b/features/integrate_build_system/mylib-consumer/conanfile.py deleted file mode 100644 index c8c83c11..00000000 --- a/features/integrate_build_system/mylib-consumer/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -import os - -from conans import ConanFile, python_requires - -waf_import = python_requires("waf-build-helper/0.1@user/channel") - - -class TestWafConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - name = "waf-consumer" - generators = "Waf" - requires = "mylib-waf/1.0@user/channel" - build_requires = "WafGen/0.1@user/channel", "waf/2.0.19@user/channel" - exports_sources = "wscript", "main.cpp" - - def build(self): - waf = waf_import.WafBuildEnvironment(self) - waf.configure() - waf.build() diff --git a/features/integrate_build_system/mylib-consumer/main.cpp b/features/integrate_build_system/mylib-consumer/main.cpp deleted file mode 100644 index aa6bda0c..00000000 --- a/features/integrate_build_system/mylib-consumer/main.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int main() { - MyLib mylib; - mylib.PrintMessage("HELLO CONAN-WAF TEST!"); - return 0; -} diff --git a/features/integrate_build_system/mylib-consumer/wscript b/features/integrate_build_system/mylib-consumer/wscript deleted file mode 100644 index f7eeb0ce..00000000 --- a/features/integrate_build_system/mylib-consumer/wscript +++ /dev/null @@ -1,19 +0,0 @@ -#! /usr/bin/env python -# encoding: utf-8 - -top = '.' -out = 'build' - - -def options(opt): - opt.load('compiler_cxx') - - -def configure(conf): - conf.load('compiler_cxx') - conf.load('waf_conan_libs_info', tooldir='.') - conf.load('waf_conan_toolchain', tooldir='.') - - -def build(bld): - bld.program(source='main.cpp', target='app', use=bld.env.CONAN_LIBS) diff --git a/features/integrate_build_system/waf-build-helper/conanfile.py b/features/integrate_build_system/waf-build-helper/conanfile.py deleted file mode 100644 index 019a2eae..00000000 --- a/features/integrate_build_system/waf-build-helper/conanfile.py +++ /dev/null @@ -1,10 +0,0 @@ -import os -import shutil -from conans import ConanFile, tools -from waf_environment import WafBuildEnvironment - - -class PythonRequires(ConanFile): - name = "waf-build-helper" - version = "0.1" - exports = "waf_environment.py" diff --git a/features/integrate_build_system/waf-build-helper/waf_environment.py b/features/integrate_build_system/waf-build-helper/waf_environment.py deleted file mode 100644 index d545c89e..00000000 --- a/features/integrate_build_system/waf-build-helper/waf_environment.py +++ /dev/null @@ -1,139 +0,0 @@ -import os -import shutil -from conans import ConanFile, tools, __version__ as conan_version -from conans.client.build.compiler_flags import libcxx_flag, libcxx_define, format_defines -from conans.model.version import Version -from conans.errors import ConanException - - -class WafBuildEnvironment(object): - def __init__(self, conanfile): - self._conanfile = conanfile - self._settings = self._conanfile.settings - self._arch = self._ss("arch") - self._os = self._ss("os") - self._compiler = self._ss("compiler") - self._compiler_version = self._ss("compiler.version") - self._compiler_libcxx = self._ss("compiler.libcxx") - self._compiler_cppstd = self._ss("compiler.cppstd") - self._build_type = self._ss("build_type") - self._compiler_runtime = self._ss("compiler.runtime") - self._arch_conan2waf = {'x86': 'x86', 'x86_64': 'x64'} - - def _gcc_ver_conan2waf(self, conan_version): - version = [v for v in conan_version.split('.', 3)] - while len(version) < 3: - version.append('0') - return "('{}', '{}', '{}')".format(version[0], version[1], version[2]) - - def _libcxx_flags(self, compiler, libcxx): - lib_flags = [] - if libcxx: - if conan_version >= Version("1.26"): - stdlib_define = libcxx_define(self._settings) - cxxf = libcxx_flag(self._settings) - else: - stdlib_define = libcxx_define(compiler=compiler, libcxx=libcxx) - cxxf = libcxx_flag(compiler=compiler, libcxx=libcxx) - - lib_flags.extend(format_defines([stdlib_define])) - if cxxf: - lib_flags.append(cxxf) - - return lib_flags - - def _cppstd_flag(self): - if conan_version >= Version("1.24"): - return tools.cppstd_flag(self._settings) - else: - from conans.client.build.cppstd_flags import cppstd_flag, cppstd_from_settings - compiler = self._settings.get_safe("compiler") - compiler_version = self._settings.get_safe("compiler.version") - cppstd = cppstd_from_settings(self._settings) - return cppstd_flag(compiler, compiler_version, cppstd) - - - def _toolchain_content(self): - sections = [] - sections.append("def configure(conf):") - sections.append(" if not conf.env.CXXFLAGS:") - sections.append(" conf.env.CXXFLAGS = []") - sections.append(" if not conf.env.LINKFLAGS:") - sections.append(" conf.env.LINKFLAGS = []") - if "Visual Studio" in self._compiler: - # first we set the options for the compiler, then load - if self._compiler_version: - sections.append(" conf.env.MSVC_VERSION = '{}.0'".format( - self._compiler_version)) - try: - sections.append(" conf.env.MSVC_TARGETS = '{}'".format( - self._arch_conan2waf[self._arch])) - except KeyError: - raise ConanException( - "Architecture '%s' not supported" % self._arch) - - sections.append(" conf.env.CXXFLAGS.append('/{}')".format( - self._compiler_runtime)) - - sections.append(" conf.env.CXXFLAGS.extend(['/EHsc'])") - if self._build_type == "Debug": - sections.append(" conf.env.CXXFLAGS.extend(['/Zi', '/FS'])") - sections.append(" conf.env.LINKFLAGS.extend(['/DEBUG'])") - elif self._build_type == "Release": - sections.append( - " conf.env.CXXFLAGS.extend(['/O2', '/Ob1', '/DNDEBUG'])") - else: - sections.append(" conf.env.CC_VERSION = {}".format( - self._gcc_ver_conan2waf(self._compiler_version))) - - cxxf = self._libcxx_flags( - compiler=self._compiler, libcxx=self._compiler_libcxx) - cxxf.append(self._cppstd_flag()) - for flag in cxxf: - sections.append( - " conf.env.CXXFLAGS.append('{}')".format(flag)) - - if self._build_type == "Debug": - sections.append(" conf.env.CXXFLAGS.extend(['-g'])") - elif self._build_type == "Release": - sections.append(" conf.env.CXXFLAGS.extend(['-O3'])") - sections.append("\n") - return "\n".join(sections) - - def _save_toolchain_file(self): - filename = "waf_conan_toolchain.py" - content = self._toolchain_content() - output_path = self._conanfile.build_folder - with open(os.path.join(output_path, filename), 'w') as output_file: - output_file.write(content) - self._conanfile.output.info("Waf Toolchain File created: %s" % (filename)) - - def configure(self, args=None): - self._save_toolchain_file() - args = args or [] - command = "waf configure " + " ".join(arg for arg in args) - if self._compiler_version and "Visual Studio" in self._compiler: - command = command + \ - '--msvc_version="msvc {}.0"'.format(self._compiler_version) - with tools.vcvars(self._settings): - self._run(command) - - def build(self, args=None): - args = args or [] - command = "waf build " + " ".join(arg for arg in args) - with tools.vcvars(self._settings): - self._run(command) - - def _run(self, command): - try: - self._conanfile.run(command) - except Exception as e: - raise ConanException("Error running: {} ({})".format(command, str(e))) - - def _ss(self, setname): - """safe setting""" - return self._settings.get_safe(setname) - - def _so(self, setname): - """safe option""" - return self._conanfile.options.get_safe(setname) diff --git a/features/integrate_build_system/waf-generator/conanfile.py b/features/integrate_build_system/waf-generator/conanfile.py deleted file mode 100644 index c062b830..00000000 --- a/features/integrate_build_system/waf-generator/conanfile.py +++ /dev/null @@ -1,36 +0,0 @@ -from conans.model import Generator -from conans import ConanFile - - -class Waf(Generator): - def _remove_lib_extension(self, libs): - return [lib[0:-4] if lib.endswith(".lib") else lib for lib in libs] - - @property - def filename(self): - return "waf_conan_libs_info.py" - - @property - def content(self): - sections = [] - sections.append("def configure(ctx):") - conan_libs = [] - for dep_name, info in self.deps_build_info.dependencies: - if dep_name not in self.conanfile.build_requires: - dep_name = dep_name.replace("-", "_") - sections.append(" ctx.env.INCLUDES_{} = {}".format( - dep_name, info.include_paths)) - sections.append(" ctx.env.LIBPATH_{} = {}".format( - dep_name, info.lib_paths)) - sections.append(" ctx.env.LIB_{} = {}".format( - dep_name, self._remove_lib_extension(info.libs))) - conan_libs.append(dep_name) - sections.append(" ctx.env.CONAN_LIBS = {}".format(conan_libs)) - sections.append("") - return "\n".join(sections) - - -class WafGeneratorPackage(ConanFile): - name = "WafGen" - version = "0.1" - license = "MIT" diff --git a/features/integrate_build_system/waf-installer/LICENSE b/features/integrate_build_system/waf-installer/LICENSE deleted file mode 100644 index 57a9831c..00000000 --- a/features/integrate_build_system/waf-installer/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/features/integrate_build_system/waf-installer/conanfile.py b/features/integrate_build_system/waf-installer/conanfile.py deleted file mode 100644 index f283badb..00000000 --- a/features/integrate_build_system/waf-installer/conanfile.py +++ /dev/null @@ -1,31 +0,0 @@ -from conans import ConanFile, tools -import os - - -class WAFInstallerConan(ConanFile): - name = "waf" - version = "2.0.19" - description = "Waf is a Python-based build system" - settings = "os_build" - homepage = "https://gitlab.com/ita1024/waf" - license = "BSD" - exports_sources = ["LICENSE"] - - def build(self): - source_url = "https://waf.io/waf-%s" % (self.version) - self.output.warn("Downloading Waf build system: %s" % (source_url)) - tools.download(source_url, "waf") - if self.settings.os_build == "Windows": - tools.download( - "https://gitlab.com/ita1024/waf/raw/waf-{}/utils/waf.bat".format(self.version), "waf.bat") - elif self.settings.os_build == "Linux" or self.settings.os_build == "Macos": - self.run("chmod 755 waf") - - def package(self): - self.copy(pattern="LICENSE", src='.', dst="licenses") - self.copy('waf', src='.', dst="bin", keep_path=False) - self.copy('waf.bat', src='.', dst="bin", keep_path=False) - - def package_info(self): - self.output.info("Using Waf %s version" % self.version) - self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/features/integrate_build_system/waf-mylib/conanfile.py b/features/integrate_build_system/waf-mylib/conanfile.py deleted file mode 100644 index c9b045ae..00000000 --- a/features/integrate_build_system/waf-mylib/conanfile.py +++ /dev/null @@ -1,33 +0,0 @@ -import os -from conans import ConanFile, python_requires - - -class MyLibConan(ConanFile): - python_requires("waf-build-helper/0.1@user/channel") - settings = "os", "compiler", "build_type", "arch" - name = "mylib-waf" - version = "1.0" - license = "MIT" - author = "Conan Team" - description = "Just a simple example of using Conan to package a Waf lib" - topics = ("conan", "libs", "Waf") - exports = "LICENSE" - exports_sources = "wscript", "src/mylib.cpp", "include/mylib.hpp" - build_requires = "waf/2.0.19@user/channel" - - def build(self): - waf = self.python_requires["waf-build-helper"].module.WafBuildEnvironment(self) - waf.configure() - waf.build() - - def package(self): - self.copy("*.hpp", dst="include", src="include", keep_path=False) - self.copy("*.lib", dst="lib", src="build", keep_path=False) - self.copy("*.dll", dst="bin", keep_path=False) - self.copy("*.dylib*", dst="lib", src="build", keep_path=False) - self.copy("*.so", dst="lib", src="build", keep_path=False) - self.copy("*.a", dst="lib", src="build", keep_path=False) - self.copy("LICENSE", dst="licenses", src=".", keep_path=False) - - def package_info(self): - self.cpp_info.libs = ["mylib"] diff --git a/features/integrate_build_system/waf-mylib/include/mylib.hpp b/features/integrate_build_system/waf-mylib/include/mylib.hpp deleted file mode 100644 index 8ba6b50f..00000000 --- a/features/integrate_build_system/waf-mylib/include/mylib.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#include - -class MyLib -{ -public: - MyLib() = default; - ~MyLib () = default; - void PrintMessage(const std::string& message); -}; - diff --git a/features/integrate_build_system/waf-mylib/src/mylib.cpp b/features/integrate_build_system/waf-mylib/src/mylib.cpp deleted file mode 100644 index 60278124..00000000 --- a/features/integrate_build_system/waf-mylib/src/mylib.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "../include/mylib.hpp" - -#include - -void MyLib::PrintMessage(const std::string & message) -{ - std::cout << message << std::endl; -} - diff --git a/features/integrate_build_system/waf-mylib/wscript b/features/integrate_build_system/waf-mylib/wscript deleted file mode 100644 index 3ef16c6c..00000000 --- a/features/integrate_build_system/waf-mylib/wscript +++ /dev/null @@ -1,18 +0,0 @@ -#! /usr/bin/env python -# encoding: utf-8 - -top = '.' -out = 'build' - - -def options(opt): - opt.load('compiler_cxx') - - -def configure(conf): - conf.load('compiler_cxx') - conf.load('waf_conan_toolchain', tooldir='.') - - -def build(bld): - bld.stlib(target='mylib', source='./src/mylib.cpp') diff --git a/features/lockfiles/build_order/app1/conanfile.py b/features/lockfiles/build_order/app1/conanfile.py deleted file mode 100644 index ed4b623e..00000000 --- a/features/lockfiles/build_order/app1/conanfile.py +++ /dev/null @@ -1,7 +0,0 @@ - -from conans import ConanFile - -required_conan_version = ">=1.28" - -class App1Conan(ConanFile): - requires = "libd/[>0.0 <1.0]@user/testing" diff --git a/features/lockfiles/build_order/app2/conanfile.py b/features/lockfiles/build_order/app2/conanfile.py deleted file mode 100644 index adcdddea..00000000 --- a/features/lockfiles/build_order/app2/conanfile.py +++ /dev/null @@ -1,7 +0,0 @@ - -from conans import ConanFile - -required_conan_version = ">=1.28" - -class App2Conan(ConanFile): - requires = "libc/[>0.0 <1.0]@user/testing" diff --git a/features/lockfiles/build_order/build.bat b/features/lockfiles/build_order/build.bat deleted file mode 100644 index f64fcd65..00000000 --- a/features/lockfiles/build_order/build.bat +++ /dev/null @@ -1 +0,0 @@ -python build.py \ No newline at end of file diff --git a/features/lockfiles/build_order/build.py b/features/lockfiles/build_order/build.py deleted file mode 100644 index d49fbf2b..00000000 --- a/features/lockfiles/build_order/build.py +++ /dev/null @@ -1,108 +0,0 @@ -import os, json, shutil -import subprocess -from contextlib import contextmanager - - -def run(cmd, assert_error=False): - print("*********** Running: %s" % cmd) - ret = os.system(cmd) - if ret == 0 and assert_error: - raise Exception("Command unexpectedly succedeed: %s" % cmd) - if ret != 0 and not assert_error: - raise Exception("Failed command: %s" % cmd) - -def load(filename): - with open(filename, "r") as f: - return f.read() - -def rm(path): - if os.path.isfile(path): - os.remove(path) - elif os.path.isdir(path): - shutil.rmtree(path) - -@contextmanager -def chdir(path): - current_path = os.getcwd() - try: - os.chdir(path) - yield - finally: - os.chdir(current_path) - -@contextmanager -def setenv(key, value): - old_value = os.environ.get(key) - os.environ[key] = value - try: - yield - finally: - if old_value is not None: - os.environ[key] = old_value - - -def clean(): - rm("tmp") - rm("app1.lock") - rm("app2.lock") - rm("build_order.json") - rm("build_order2.json") - - -def build_order(): - clean() - - run("conan config set general.default_package_id_mode=full_version_mode") - run("conan export liba liba/0.1@user/testing") - run("conan export libb libb/0.1@user/testing") - run("conan export libc libc/0.1@user/testing") - run("conan export libd libd/0.1@user/testing") - run("conan export app1 app1/0.1@user/testing") - run("conan export app2 app2/0.1@user/testing") - - run("conan lock create --reference=app1/0.1@user/testing --lockfile-out=app1.lock") - print(load("app1.lock")) - run("conan lock build-order app1.lock --json=build_order.json") - print(load("build_order.json")) - - run("conan install app1/0.1@user/testing --build=missing") - run("conan install app2/0.1@user/testing --build=missing") - - run("conan lock create --reference=app1/0.1@user/testing --lockfile-out=app1.lock") - print(load("app1.lock")) - run("conan lock build-order app1.lock --json=build_order.json") - print(load("build_order.json")) # Empty [] - - run("conan lock create --reference=app1/0.1@user/testing --lockfile-out=app1.lock --build") - print(load("app1.lock")) - run("conan lock build-order app1.lock --json=build_order.json") - print(load("build_order.json")) # All deps - - # Modifying libb outside the version range - run("conan create libb libb/2.0@user/testing") - run("conan lock create --reference=app1/0.1@user/testing --lockfile-out=app1.lock") - print(load("app1.lock")) - run("conan lock build-order app1.lock --json=build_order.json") - print(load("build_order.json")) - - # Modifying libb, what needs to be built? - run("conan create libb libb/0.2@user/testing") - run("conan lock create --reference=app1/0.1@user/testing --lockfile-out=app1.lock") - print(load("app1.lock")) - run("conan lock build-order app1.lock --json=build_order.json") - print(load("build_order.json")) - run("conan lock create --reference=app2/0.1@user/testing --lockfile-out=app2.lock") - print(load("app2.lock")) - run("conan lock build-order app2.lock --json=build_order2.json") - print(load("build_order2.json")) - - - - clean() - - -if __name__ == '__main__': - home = os.path.abspath(os.path.join(os.path.dirname(__file__), "tmp")) - with setenv("CONAN_USER_HOME", home): - build_order() - diff --git a/features/lockfiles/build_order/build.sh b/features/lockfiles/build_order/build.sh deleted file mode 100755 index 35c3146a..00000000 --- a/features/lockfiles/build_order/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -set -ex - -python build.py \ No newline at end of file diff --git a/features/lockfiles/build_order/liba/conanfile.py b/features/lockfiles/build_order/liba/conanfile.py deleted file mode 100644 index 8c0c87a4..00000000 --- a/features/lockfiles/build_order/liba/conanfile.py +++ /dev/null @@ -1,6 +0,0 @@ -from conans import ConanFile, tools - -required_conan_version = ">=1.28" - -class PkgaConan(ConanFile): - pass diff --git a/features/lockfiles/build_order/libb/conanfile.py b/features/lockfiles/build_order/libb/conanfile.py deleted file mode 100644 index 43ab94e5..00000000 --- a/features/lockfiles/build_order/libb/conanfile.py +++ /dev/null @@ -1,6 +0,0 @@ -from conans import ConanFile - -required_conan_version = ">=1.28" - -class LibBConan(ConanFile): - requires = "liba/[>0.0 <1.0]@user/testing" diff --git a/features/lockfiles/build_order/libc/conanfile.py b/features/lockfiles/build_order/libc/conanfile.py deleted file mode 100644 index 50e1ddcd..00000000 --- a/features/lockfiles/build_order/libc/conanfile.py +++ /dev/null @@ -1,6 +0,0 @@ -from conans import ConanFile - -required_conan_version = ">=1.28" - -class LibCConan(ConanFile): - requires = "liba/[>0.0 <1.0]@user/testing" diff --git a/features/lockfiles/build_order/libd/conanfile.py b/features/lockfiles/build_order/libd/conanfile.py deleted file mode 100644 index 7db1904b..00000000 --- a/features/lockfiles/build_order/libd/conanfile.py +++ /dev/null @@ -1,7 +0,0 @@ - -from conans import ConanFile - -required_conan_version = ">=1.28" - -class LibDConan(ConanFile): - requires = "libb/[>0.0 <1.0]@user/testing", "libc/[>0.0 <1.0]@user/testing" diff --git a/features/lockfiles/ci/.gitignore b/features/lockfiles/ci/.gitignore deleted file mode 100644 index 3fc3532b..00000000 --- a/features/lockfiles/ci/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -release/ -bo.json \ No newline at end of file diff --git a/features/lockfiles/ci/app1/conanfile.py b/features/lockfiles/ci/app1/conanfile.py deleted file mode 100644 index 7b434ceb..00000000 --- a/features/lockfiles/ci/app1/conanfile.py +++ /dev/null @@ -1,8 +0,0 @@ - -from conans import ConanFile - -required_conan_version = ">=1.28" - -class App1Conan(ConanFile): - settings = "build_type" - requires = "libd/[>0.0 <1.0]@user/testing" diff --git a/features/lockfiles/ci/app2/conanfile.py b/features/lockfiles/ci/app2/conanfile.py deleted file mode 100644 index 1c905a99..00000000 --- a/features/lockfiles/ci/app2/conanfile.py +++ /dev/null @@ -1,8 +0,0 @@ - -from conans import ConanFile - -required_conan_version = ">=1.28" - -class App2Conan(ConanFile): - settings = "build_type" - requires = "libc/[>0.0 <1.0]@user/testing" diff --git a/features/lockfiles/ci/build.bat b/features/lockfiles/ci/build.bat deleted file mode 100644 index f64fcd65..00000000 --- a/features/lockfiles/ci/build.bat +++ /dev/null @@ -1 +0,0 @@ -python build.py \ No newline at end of file diff --git a/features/lockfiles/ci/build.py b/features/lockfiles/ci/build.py deleted file mode 100755 index 301e19db..00000000 --- a/features/lockfiles/ci/build.py +++ /dev/null @@ -1,120 +0,0 @@ -import os, json, shutil -import subprocess -from contextlib import contextmanager - - -def run(cmd, assert_error=False): - print("*********** Running: %s" % cmd) - ret = os.system(cmd) - if ret == 0 and assert_error: - raise Exception("Command unexpectedly succedeed: %s" % cmd) - if ret != 0 and not assert_error: - raise Exception("Failed command: %s" % cmd) - -def load(filename): - with open(filename, "r") as f: - return f.read() - -def save(filename, content): - with open(filename, "w") as f: - return f.write(content) - - -def rm(path): - if os.path.isfile(path): - os.remove(path) - elif os.path.isdir(path): - shutil.rmtree(path) - -@contextmanager -def chdir(path): - current_path = os.getcwd() - try: - os.chdir(path) - yield - finally: - os.chdir(current_path) - -@contextmanager -def setenv(key, value): - old_value = os.environ.get(key) - os.environ[key] = value - try: - yield - finally: - if old_value is not None: - os.environ[key] = old_value - - -def clean(): - rm("tmp") - rm("locks") - rm("bo_release.json") - rm("bo_debug.json") - - -def ci_pipeline(): - clean() - run("conan config set general.default_package_id_mode=full_version_mode") - for config in ("Release", "Debug"): - run("conan create liba liba/0.1@user/testing -s build_type=%s" % config) - run("conan create libb libb/0.1@user/testing -s build_type=%s" % config) - run("conan create libc libc/0.1@user/testing -s build_type=%s" % config) - run("conan create libd libd/0.1@user/testing -s build_type=%s" % config) - run("conan create app1 app1/0.1@user/testing -s build_type=%s" % config) - run("conan create app2 app2/0.1@user/testing -s build_type=%s" % config) - - # A developer does some change to the libb - with chdir("libb"): - libb = load("conanfile.py") - libb = libb + "# Some changes" - save("conanfile.py", libb) - - run("conan lock create conanfile.py --name=libb --version=0.2 " - "--user=user --channel=testing --lockfile-out=../locks/libb_deps_base.lock --base") - - # Even if liba gets a new 0.2 version, the lockfile will avoid it - run("conan create liba liba/0.2@user/testing") - with chdir("libb"): - # This will be useful to capture the revision - run("conan export . libb/0.2@user/testing --lockfile=../locks/libb_deps_base.lock " - "--lockfile-out=../locks/libb_base.lock") - print(load("../locks/libb_base.lock")) - # Capture the configuration lockfiles, one per configuration - run("conan lock create conanfile.py --name=libb --version=0.2 " - "--user=user --channel=testing --lockfile=../locks/libb_base.lock --lockfile-out=../locks/libb_deps_debug.lock -s build_type=Debug") - run("conan lock create conanfile.py --name=libb --version=0.2 " - "--user=user --channel=testing --lockfile=../locks/libb_base.lock --lockfile-out=../locks/libb_deps_release.lock") - # Now build libb - run("conan create . libb/0.2@user/testing --lockfile=../locks/libb_deps_release.lock") - run("conan create . libb/0.2@user/testing --lockfile=../locks/libb_deps_debug.lock") - - # Capture the app1 base lockfile - run("conan lock create --reference=app1/0.1@user/testing --lockfile=locks/libb_base.lock " - "--lockfile-out=locks/app1_base.lock --base") - # And one lockfile per configuration - run("conan lock create --reference=app1/0.1@user/testing --lockfile=locks/app1_base.lock " - "--lockfile-out=locks/app1_release.lock") - run("conan lock create --reference=app1/0.1@user/testing --lockfile=locks/app1_base.lock " - "--lockfile-out=locks/app1_debug.lock -s build_type=Debug") - - run("conan lock build-order locks/app1_release.lock --json=bo_release.json") - run("conan lock build-order locks/app1_debug.lock --json=bo_debug.json") - build_order_release = json.loads(load("bo_release.json")) - build_order_debug = json.loads(load("bo_debug.json")) - - for level in build_order_release: - for item in level: - ref, pid, context, id_ = item - print(item) - run("conan install %s --build=%s --lockfile=locks/app1_release.lock " - "--lockfile-out=locks/app1_release_updated.lock" % (ref, ref)) - run("conan lock update locks/app1_release.lock locks/app1_release_updated.lock") - - print(load("locks/app1_release.lock")) - clean() - -if __name__ == '__main__': - home = os.path.abspath(os.path.join(os.path.dirname(__file__), "tmp")) - with setenv("CONAN_USER_HOME", home): - ci_pipeline() diff --git a/features/lockfiles/ci/build.sh b/features/lockfiles/ci/build.sh deleted file mode 100755 index 421641ed..00000000 --- a/features/lockfiles/ci/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -set -ex - -python build.py diff --git a/features/lockfiles/ci/liba/conanfile.py b/features/lockfiles/ci/liba/conanfile.py deleted file mode 100644 index 040b059a..00000000 --- a/features/lockfiles/ci/liba/conanfile.py +++ /dev/null @@ -1,6 +0,0 @@ -from conans import ConanFile, tools - -required_conan_version = ">=1.28.0" - -class PkgaConan(ConanFile): - settings = "build_type" diff --git a/features/lockfiles/ci/libb/conanfile.py b/features/lockfiles/ci/libb/conanfile.py deleted file mode 100644 index 580d6395..00000000 --- a/features/lockfiles/ci/libb/conanfile.py +++ /dev/null @@ -1,7 +0,0 @@ -from conans import ConanFile - -required_conan_version = ">=1.28" - -class LibBConan(ConanFile): - settings = "build_type" - requires = "liba/[>0.0 <1.0]@user/testing" diff --git a/features/lockfiles/ci/libc/conanfile.py b/features/lockfiles/ci/libc/conanfile.py deleted file mode 100644 index 19335859..00000000 --- a/features/lockfiles/ci/libc/conanfile.py +++ /dev/null @@ -1,7 +0,0 @@ -from conans import ConanFile - -required_conan_version = ">=1.28" - -class LibCConan(ConanFile): - settings = "build_type" - requires = "liba/[>0.0 <1.0]@user/testing" diff --git a/features/lockfiles/ci/libd/conanfile.py b/features/lockfiles/ci/libd/conanfile.py deleted file mode 100644 index bfef28b1..00000000 --- a/features/lockfiles/ci/libd/conanfile.py +++ /dev/null @@ -1,8 +0,0 @@ - -from conans import ConanFile - -required_conan_version = ">=1.28" - -class LibDConan(ConanFile): - settings = "build_type" - requires = "libb/[>0.0 <1.0]@user/testing", "libc/[>0.0 <1.0]@user/testing" diff --git a/features/lockfiles/intro/build.bat b/features/lockfiles/intro/build.bat deleted file mode 100644 index f64fcd65..00000000 --- a/features/lockfiles/intro/build.bat +++ /dev/null @@ -1 +0,0 @@ -python build.py \ No newline at end of file diff --git a/features/lockfiles/intro/build.py b/features/lockfiles/intro/build.py deleted file mode 100644 index c33b42f8..00000000 --- a/features/lockfiles/intro/build.py +++ /dev/null @@ -1,158 +0,0 @@ -import os, json, shutil, sys -import platform -import subprocess -from contextlib import contextmanager - - -def run(cmd, assert_error=False): - print("*********** Running: %s" % cmd) - ret = os.system(cmd) - if ret == 0 and assert_error: - raise Exception("Command unexpectedly succedeed: %s" % cmd) - if ret != 0 and not assert_error: - raise Exception("Failed command: %s" % cmd) - -def load(filename): - with open(filename, "r") as f: - return f.read() - -def rm(path): - if os.path.isfile(path): - os.remove(path) - elif os.path.isdir(path): - shutil.rmtree(path) - -@contextmanager -def chdir(path): - current_path = os.getcwd() - try: - os.chdir(path) - yield - finally: - os.chdir(current_path) - -@contextmanager -def setenv(key, value): - old_value = os.environ.get(key) - os.environ[key] = value - try: - yield - finally: - if old_value is not None: - os.environ[key] = old_value - - -def clean(): - rm("tmp") - rm("pkgb/build") - rm("pkgb/locks") - rm("consume") - run("conan remove '*' -f") - -def single_config(): - clean() - - run("conan config set general.default_package_id_mode=full_version_mode") - run("conan create pkga pkga/0.1@user/testing") - - with chdir("pkgb"): - run("conan lock create conanfile.py --user=user --channel=testing --lockfile-out=locks/pkgb_deps.lock") - print(load("locks/pkgb_deps.lock")) - - run("conan create pkga pkga/0.2@user/testing") - - os.makedirs("pkgb/build") - with chdir("pkgb/build"): - run("conan install ..") - if platform.system() == "Windows": - run('cmake ../src -G "{}"'.format(os.getenv("CMAKE_GENERATOR"))) - else: - run("cmake ../src -DCMAKE_BUILD_TYPE=Release") - run("cmake --build . --config Release") - run(os.sep.join(["bin", "greet"])) - - run("conan install .. --lockfile=../locks/pkgb_deps.lock") - run("cmake --build . --config Release") - run(os.sep.join(["bin", "greet"])) - - run("conan install .. --lockfile=../locks/pkgb_deps.lock --build=pkga", assert_error=True) - - with chdir("pkgb"): - run("conan create . user/stable --lockfile=locks/pkgb_deps.lock", assert_error=True) - run("conan create . user/testing --lockfile=locks/pkgb_deps.lock --lockfile-out=locks/pkgb.lock") - print(load("locks/pkgb.lock")) - run("conan create . user/testing --lockfile=locks/pkgb.lock", assert_error=True) - run("conan create . user/testing --lockfile=locks/pkgb_deps.lock") - - os.makedirs("consume") - with chdir("consume"): - run("conan install pkgb/0.1@user/testing --lockfile=../pkgb/locks/pkgb.lock") - run(os.sep.join(["bin", "greet"])) - - clean() - -def multi_config(): - # Multi-configuration - clean() - - run("conan create pkga pkga/0.1@user/testing") - run("conan create pkga pkga/0.1@user/testing -s build_type=Debug") - - with chdir("pkgb"): - run("conan lock create conanfile.py --user=user --channel=testing --lockfile-out=locks/pkgb_release.lock") - run("conan lock create conanfile.py --user=user --channel=testing --lockfile-out=locks/pkgb_debug.lock -s build_type=Debug") - rm("locks") - run("conan lock create conanfile.py --user=user --channel=testing --lockfile-out=locks/pkgb_base.lock --base") - run("conan lock create conanfile.py --user=user --channel=testing --lockfile=locks/pkgb_base.lock --lockfile-out=locks/pkgb_deps_debug.lock -s build_type=Debug") - run("conan lock create conanfile.py --user=user --channel=testing --lockfile=locks/pkgb_base.lock --lockfile-out=locks/pkgb_deps_release.lock") - print(load("locks/pkgb_base.lock")) - print(load("locks/pkgb_deps_release.lock")) - print(load("locks/pkgb_deps_debug.lock")) - - run("conan create pkga pkga/0.2@user/testing") - run("conan create pkga pkga/0.2@user/testing -s build_type=Debug") - - os.makedirs("pkgb/build") - with chdir("pkgb/build"): - for config in ("Release", "Debug"): - run("conan install .. --lockfile=../locks/pkgb_deps_%s.lock -s build_type=%s" % (config.lower(), config), assert_error=True) - run("conan install .. --lockfile=../locks/pkgb_deps_%s.lock" % config.lower()) - if platform.system() == "Windows": - run('cmake ../src -G "{}"'.format(os.getenv("CMAKE_GENERATOR"))) - else: - run("cmake ../src -DCMAKE_BUILD_TYPE=%s" % config) - run("cmake --build . --config %s" % config) - run(os.sep.join(["bin", "greet"])) - run("conan install .. -s build_type=%s" % config) - run("cmake --build . --config %s" % config) - run(os.sep.join(["bin", "greet"])) - - run("conan install .. --lockfile=../locks/pkgb_deps_%s.lock --build=pkga" % config.lower(), assert_error=True) - - - with chdir("pkgb"): - for config in ("Release", "Debug"): - run("conan create . user/stable --lockfile=locks/pkgb_deps_%s.lock" % config.lower(), assert_error=True) - run("conan create . user/testing --lockfile=locks/pkgb_deps_%s.lock --lockfile-out=locks/pkgb_%s.lock" % (config.lower(), config.lower())) - print(load("locks/pkgb_%s.lock" % config.lower())) - run("conan create . user/testing --lockfile=locks/pkgb_%s.lock" % config.lower(), assert_error=True) - - os.makedirs("consume") - with chdir("consume"): - for config in ("Release", "Debug"): - run("conan install pkgb/0.1@user/testing --lockfile=../pkgb/locks/pkgb_%s.lock" % config.lower()) - run(os.sep.join(["bin", "greet"])) - - clean() - - -if __name__ == '__main__': - home = os.path.abspath(os.path.join(os.path.dirname(__file__), "tmp")) - with setenv("CONAN_USER_HOME", home): - if platform.system() == "Windows": - if not os.getenv("CMAKE_GENERATOR"): - print("CMAKE_GENERATOR environment variable not defined. " - "Please define the CMake generator in the CMAKE_GENERATOR environment variable.") - sys.exit() - single_config() - multi_config() diff --git a/features/lockfiles/intro/build.sh b/features/lockfiles/intro/build.sh deleted file mode 100755 index 35c3146a..00000000 --- a/features/lockfiles/intro/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -set -ex - -python build.py \ No newline at end of file diff --git a/features/lockfiles/intro/pkga/conanfile.py b/features/lockfiles/intro/pkga/conanfile.py deleted file mode 100644 index 9aa36086..00000000 --- a/features/lockfiles/intro/pkga/conanfile.py +++ /dev/null @@ -1,14 +0,0 @@ -from conans import ConanFile, tools - -required_conan_version = ">=1.28" - -class PkgaConan(ConanFile): - settings = "build_type" - exports_sources = "src/*" - - def build(self): - tools.replace_in_file("src/helloa.h", "%V%", self.version) - tools.replace_in_file("src/helloa.h", "%BT%", str(self.settings.build_type)) - - def package(self): - self.copy("*.h", dst="include", src="src") diff --git a/features/lockfiles/intro/pkga/src/helloa.h b/features/lockfiles/intro/pkga/src/helloa.h deleted file mode 100644 index ae3f72bf..00000000 --- a/features/lockfiles/intro/pkga/src/helloa.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once -#include - -inline void helloA(){ - std::cout << "HelloA %V% %BT%\n"; -} diff --git a/features/lockfiles/intro/pkgb/conanfile.py b/features/lockfiles/intro/pkgb/conanfile.py deleted file mode 100644 index f2d803b1..00000000 --- a/features/lockfiles/intro/pkgb/conanfile.py +++ /dev/null @@ -1,34 +0,0 @@ -from conans import ConanFile, CMake - -required_conan_version = ">=1.28" - -class PkgbConan(ConanFile): - name = "pkgb" - version = "0.1" - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False]} - default_options = {"shared": False} - generators = "cmake" - exports_sources = "src/*" - requires = "pkga/[>0.0]@user/testing" - - def build(self): - cmake = CMake(self) - cmake.configure(source_folder="src") - cmake.build() - - def package(self): - self.copy("*.h", dst="include", src="src") - self.copy("*.lib", dst="lib", keep_path=False) - self.copy("*.dll", dst="bin", keep_path=False) - self.copy("*.dylib*", dst="lib", keep_path=False) - self.copy("*.so", dst="lib", keep_path=False) - self.copy("*.a", dst="lib", keep_path=False) - self.copy("greet*", dst="bin", src="bin", keep_path=False) - - def deploy(self): - self.copy("*", dst="bin", src="bin", keep_path=False) - self.copy_deps("*", dst="bin", src="bin", keep_path=False) - - def package_info(self): - self.cpp_info.libs = ["pkgb"] diff --git a/features/lockfiles/intro/pkgb/src/CMakeLists.txt b/features/lockfiles/intro/pkgb/src/CMakeLists.txt deleted file mode 100644 index 7b24b734..00000000 --- a/features/lockfiles/intro/pkgb/src/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -project(MyHello CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_library(pkgb hello.cpp) - -add_executable(greet greet.cpp) -target_link_libraries(greet PRIVATE pkgb) diff --git a/features/lockfiles/intro/pkgb/src/greet.cpp b/features/lockfiles/intro/pkgb/src/greet.cpp deleted file mode 100644 index 46f8f2ff..00000000 --- a/features/lockfiles/intro/pkgb/src/greet.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include "hellob.h" - -int main(){ - helloB(); - #ifdef NDEBUG - std::cout << "Greetings Release!" < -#include "hellob.h" -#include "helloa.h" - -void helloB(){ - helloA(); - #ifdef NDEBUG - std::cout << "HelloB Release!" < -#include "hello.h" - -void hello(){ - #ifdef NDEBUG - std::cout << "Hello World Release!" < -#include "hello.h" - -void hello(){ - #if !defined NDEBUG - std::cout << "Hello World Debug!" << std::endl; - #else - std::cout << "Hello World Release!" << std::endl; - #endif -} diff --git a/features/multi_config/hello.h b/features/multi_config/hello.h deleted file mode 100644 index f8a8424b..00000000 --- a/features/multi_config/hello.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#ifdef WIN32 - #define HELLO_EXPORT __declspec(dllexport) -#else - #define HELLO_EXPORT -#endif - -HELLO_EXPORT void hello(); diff --git a/features/multi_config/test_package/CMakeLists.txt b/features/multi_config/test_package/CMakeLists.txt deleted file mode 100644 index fe93e804..00000000 --- a/features/multi_config/test_package/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(PackageTest CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_executable(example example.cpp) -if (CONAN_SETTINGS_BUILD_TYPE STREQUAL "Debug") - message("CONAN_LIBS_DEBUG: ${CONAN_LIBS_DEBUG}") - target_link_libraries(example ${CONAN_LIBS_DEBUG}) -else() - message("CONAN_LIBS_RELEASE: ${CONAN_LIBS_RELEASE}") - target_link_libraries(example ${CONAN_LIBS_RELEASE}) -endif() diff --git a/features/multi_config/test_package/conanfile.py b/features/multi_config/test_package/conanfile.py deleted file mode 100644 index 025e3bcf..00000000 --- a/features/multi_config/test_package/conanfile.py +++ /dev/null @@ -1,19 +0,0 @@ -import os -from six import StringIO -from conans import ConanFile, CMake - - -class HelloTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - os.chdir("bin") - output = StringIO() - self.run(".%sexample" % os.sep, run_environment=True, output=output) - assert ("Hello World {}!".format(str(self.settings.build_type)) in output.getvalue()), output.getvalue() diff --git a/features/multi_config/test_package/example.cpp b/features/multi_config/test_package/example.cpp deleted file mode 100644 index 4a5549c5..00000000 --- a/features/multi_config/test_package/example.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include -#include "hello.h" - -int main() { - hello(); -} diff --git a/features/package_development_flow/build.bat b/features/package_development_flow/build.bat deleted file mode 100644 index e0f7748e..00000000 --- a/features/package_development_flow/build.bat +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO ON - -RMDIR /Q /S tmp - -conan source . --source-folder=tmp/source -conan install . --install-folder=tmp/build -conan build . --source-folder=tmp/source --build-folder=tmp/build -conan package . --source-folder=tmp/source --build-folder=tmp/build --package-folder=tmp/package - -REM NOTE: Use --force to prevent ERROR: Package already exists -conan export-pkg . user/testing --source-folder=tmp/source --build-folder=tmp/build --force - -REM You can also test the package that was just exported -conan test test_package Hello/1.0@user/testing - -REM Finally, run a full create, does all of the above + test_package -conan create . user/testing diff --git a/features/package_development_flow/build.sh b/features/package_development_flow/build.sh deleted file mode 100755 index 49ace031..00000000 --- a/features/package_development_flow/build.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -set -e -set -x - -rm -rf tmp - -conan source . --source-folder=tmp/source -conan install . --install-folder=tmp/build -conan build . --source-folder=tmp/source --build-folder=tmp/build -conan package . --source-folder=tmp/source --build-folder=tmp/build --package-folder=tmp/package - -# NOTE: Use --force to prevent ERROR: Package already exists -conan export-pkg . user/testing --source-folder=tmp/source --build-folder=tmp/build --force - -# You can also test the package that was just exported -conan test test_package Hello/1.0@user/testing - -# Finally, run a full create, does all of the above + test_package -conan create . user/testing diff --git a/features/package_development_flow/conanfile.py b/features/package_development_flow/conanfile.py deleted file mode 100644 index 11579013..00000000 --- a/features/package_development_flow/conanfile.py +++ /dev/null @@ -1,48 +0,0 @@ -from conans import ConanFile, CMake, tools - - -class HelloConan(ConanFile): - name = "Hello" - version = "1.0" - license = "" - author = " " - url = "" - description = "" - topics = ("", "", "") - settings = "os", "compiler", "build_type", "arch" - options = {"shared": [True, False]} - default_options = "shared=False" - generators = "cmake" - - def source(self): - self.run("git clone https://github.com/conan-io/hello.git") - self.run("cd hello") - # This small hack might be useful to guarantee proper /MT /MD linkage - # in MSVC if the packaged project doesn't have variables to set it - # properly - tools.replace_in_file("hello/CMakeLists.txt", "PROJECT(HelloWorld)", - '''PROJECT(HelloWorld) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup()''') - - def build(self): - cmake = CMake(self) - cmake.configure(source_folder="hello") - cmake.build() - - # Explicit way: - # self.run('cmake %s/hello %s' - # % (self.source_folder, cmake.command_line)) - # self.run("cmake --build . %s" % cmake.build_config) - - def package(self): - self.copy("*.h", dst="include", src="hello") - self.copy("*hello.lib", dst="lib", keep_path=False) - self.copy("*.dll", dst="bin", keep_path=False) - self.copy("*.so", dst="lib", keep_path=False) - self.copy("*.dylib", dst="lib", keep_path=False) - self.copy("*.a", dst="lib", keep_path=False) - - def package_info(self): - self.cpp_info.libs = ["hello"] - diff --git a/features/package_development_flow/test_package/CMakeLists.txt b/features/package_development_flow/test_package/CMakeLists.txt deleted file mode 100644 index ad6dc6eb..00000000 --- a/features/package_development_flow/test_package/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(PackageTest CXX) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_executable(example example.cpp) -target_link_libraries(example ${CONAN_LIBS}) - -# CTest is a testing tool that can be used to test your project. -# enable_testing() -# add_test(NAME example -# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin -# COMMAND example) diff --git a/features/package_development_flow/test_package/conanfile.py b/features/package_development_flow/test_package/conanfile.py deleted file mode 100644 index c8b87833..00000000 --- a/features/package_development_flow/test_package/conanfile.py +++ /dev/null @@ -1,25 +0,0 @@ -import os - -from conans import ConanFile, CMake, tools - - -class HelloTestConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake" - - def build(self): - cmake = CMake(self) - # Current dir is "test_package/build/" and CMakeLists.txt is - # in "test_package" - cmake.configure() - cmake.build() - - def imports(self): - self.copy("*.dll", dst="bin", src="bin") - self.copy("*.dylib*", dst="bin", src="lib") - self.copy('*.so*', dst='bin', src='lib') - - def test(self): - if not tools.cross_building(self.settings): - os.chdir("bin") - self.run(".%sexample" % os.sep) diff --git a/features/package_development_flow/test_package/example.cpp b/features/package_development_flow/test_package/example.cpp deleted file mode 100644 index 4a5549c5..00000000 --- a/features/package_development_flow/test_package/example.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include -#include "hello.h" - -int main() { - hello(); -} diff --git a/features/python_requires/reuse_conanfile/build.bat b/features/python_requires/reuse_conanfile/build.bat deleted file mode 100644 index 23c8a4fd..00000000 --- a/features/python_requires/reuse_conanfile/build.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO ON - -conan create pyreq user/channel -conan create consumer user/channel diff --git a/features/python_requires/reuse_conanfile/build.sh b/features/python_requires/reuse_conanfile/build.sh deleted file mode 100755 index a2d879be..00000000 --- a/features/python_requires/reuse_conanfile/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -conan create pyreq user/channel -conan create consumer user/channel diff --git a/features/python_requires/reuse_conanfile/consumer/conanfile.py b/features/python_requires/reuse_conanfile/consumer/conanfile.py deleted file mode 100644 index 4b970624..00000000 --- a/features/python_requires/reuse_conanfile/consumer/conanfile.py +++ /dev/null @@ -1,13 +0,0 @@ -from conans import ConanFile, CMake, python_requires - - -base = python_requires("pyreq/version@user/channel") - -class ConsumerConan(base.get_conanfile()): - name = "consumer" - version = base.get_version() - - # All the recipe attributes and methods are defined in - # the python_requires imported source, it is a very - # easy way to share all the business logic across - # all the recipes in the same company diff --git a/features/python_requires/reuse_conanfile/consumer/src/hello.cpp b/features/python_requires/reuse_conanfile/consumer/src/hello.cpp deleted file mode 100644 index 235428a0..00000000 --- a/features/python_requires/reuse_conanfile/consumer/src/hello.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include "hello.h" - -void hello(){ - #ifdef NDEBUG - std::cout << "Hello World Release!" < -#include -#include "say.h" - -void say(std::string msg){ - #ifdef NDEBUG - std::cout << "Release: " << msg < - -void say(std::string msg); \ No newline at end of file diff --git a/libraries/dear-imgui/basic/.gitignore b/libraries/dear-imgui/basic/.gitignore deleted file mode 100644 index 9c29bcef..00000000 --- a/libraries/dear-imgui/basic/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -bindings/ -build/ \ No newline at end of file diff --git a/libraries/dear-imgui/basic/CMakeLists.txt b/libraries/dear-imgui/basic/CMakeLists.txt deleted file mode 100644 index 9917ea61..00000000 --- a/libraries/dear-imgui/basic/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(dear-imgui-conan CXX) - -set(CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}) -set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}) - -# CONFIG option is important so that CMake doesnt search for modules into the default modules directory -find_package(imgui CONFIG) -find_package(glfw3 CONFIG) -find_package(glew CONFIG) - -add_executable( dear-imgui-conan - main.cpp - opengl_shader.cpp - file_manager.cpp - opengl_shader.h - file_manager.h - bindings/imgui_impl_glfw.cpp - bindings/imgui_impl_opengl3.cpp - bindings/imgui_impl_glfw.h - bindings/imgui_impl_opengl3.h - assets/simple-shader.vs - assets/simple-shader.fs ) - -add_custom_command(TARGET dear-imgui-conan - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/assets/simple-shader.vs ${PROJECT_BINARY_DIR} - COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/assets/simple-shader.fs ${PROJECT_BINARY_DIR} -) - -target_compile_definitions(dear-imgui-conan PUBLIC IMGUI_IMPL_OPENGL_LOADER_GLEW) -target_link_libraries(dear-imgui-conan imgui::imgui GLEW::glew_s glfw::glfw) diff --git a/libraries/dear-imgui/basic/README.md b/libraries/dear-imgui/basic/README.md deleted file mode 100644 index 61516266..00000000 --- a/libraries/dear-imgui/basic/README.md +++ /dev/null @@ -1,31 +0,0 @@ -## Conan Dear ImGui example - -1. Install conan: https://docs.conan.io/en/latest/installation.html -2. Clone this repo: `git clone https://github.com/conan-io/examples.git` -3. Install dependencies, compile and run - -## Windows with Visual Studio: - -```bash -cd examples/libraries/dear-imgui/basic -mkdir build -cd build -conan install .. -s build_type=Release -conan install .. -s build_type=Debug -cmake .. -G "Visual Studio 15 2017 Win64" -cmake --build . --config Release -cd Release -dear-imgui-conan -``` - -## Linux: - -```bash -cd examples/libraries/dear-imgui/basic -mkdir build -cd build -conan install .. -s build_type=Release -cmake .. -DCMAKE_BUILD_TYPE=Release -cmake --build . -./dear-imgui-conan -``` diff --git a/libraries/dear-imgui/basic/assets/simple-shader.fs b/libraries/dear-imgui/basic/assets/simple-shader.fs deleted file mode 100644 index b392169e..00000000 --- a/libraries/dear-imgui/basic/assets/simple-shader.fs +++ /dev/null @@ -1,11 +0,0 @@ -#version 330 core - -out vec4 FragColor; - -in vec3 vertexColor; -uniform vec3 color; - -void main() -{ - FragColor = vec4(color*vertexColor,1.0); -} diff --git a/libraries/dear-imgui/basic/assets/simple-shader.vs b/libraries/dear-imgui/basic/assets/simple-shader.vs deleted file mode 100644 index 42777049..00000000 --- a/libraries/dear-imgui/basic/assets/simple-shader.vs +++ /dev/null @@ -1,18 +0,0 @@ -#version 330 core - -layout (location = 0) in vec3 position; -layout (location = 1) in vec3 color; - -out vec3 vertexColor; - -uniform float rotation; -uniform vec2 translation; - -void main() -{ - vec2 rotated_pos; - rotated_pos.x = translation.x + position.x*cos(rotation) - position.y*sin(rotation); - rotated_pos.y = translation.y + position.x*sin(rotation) + position.y*cos(rotation); - gl_Position = vec4(rotated_pos.x, rotated_pos.y, position.z, 1.0); - vertexColor = color; -} diff --git a/libraries/dear-imgui/basic/build.bat b/libraries/dear-imgui/basic/build.bat deleted file mode 100644 index 4d941ff8..00000000 --- a/libraries/dear-imgui/basic/build.bat +++ /dev/null @@ -1,14 +0,0 @@ -if "%CMAKE_GENERATOR%"=="" ( - ECHO CMAKE_GENERATOR environment variable not defined. Please define the CMake generator in the CMAKE_GENERATOR environment variable. -) -else ( - @ECHO ON - - RMDIR /Q /S build - MKDIR build - PUSHD build - - conan install .. - cmake .. -G "%CMAKE_GENERATOR%" - cmake --build . --config Release -) diff --git a/libraries/dear-imgui/basic/build.sh b/libraries/dear-imgui/basic/build.sh deleted file mode 100755 index 56d26a90..00000000 --- a/libraries/dear-imgui/basic/build.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -set -e -set -x - -rm -rf build -mkdir build -pushd build - -export CONAN_SYSREQUIRES_MODE=enabled -conan install .. --build=missing -cmake .. -DCMAKE_BUILD_TYPE=Release -cmake --build . diff --git a/libraries/dear-imgui/basic/conanfile.txt b/libraries/dear-imgui/basic/conanfile.txt deleted file mode 100644 index 90ca7413..00000000 --- a/libraries/dear-imgui/basic/conanfile.txt +++ /dev/null @@ -1,16 +0,0 @@ -[requires] -imgui/1.74 -glfw/3.3.2 -glew/2.1.0 - -[generators] -cmake_find_package_multi - -[options] -glew:shared=False - -[imports] -./res/bindings, imgui_impl_glfw.cpp -> ../bindings -./res/bindings, imgui_impl_opengl3.cpp -> ../bindings -./res/bindings, imgui_impl_glfw.h -> ../bindings -./res/bindings, imgui_impl_opengl3.h -> ../bindings \ No newline at end of file diff --git a/libraries/dear-imgui/basic/file_manager.cpp b/libraries/dear-imgui/basic/file_manager.cpp deleted file mode 100644 index 3f4dbe01..00000000 --- a/libraries/dear-imgui/basic/file_manager.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "file_manager.h" - -FileManager::FileManager() -{ -} - -FileManager::~FileManager() -{ -} - -std::string FileManager::read(const std::string& filename) { - std::ifstream file; - file.exceptions (std::ifstream::failbit | std::ifstream::badbit); - std::stringstream file_stream; - try { - file.open(filename.c_str()); - file_stream << file.rdbuf(); - file.close(); - } - catch (std::ifstream::failure e) { - std::cout << "Error reading Shader File!" << std::endl; - } - return file_stream.str(); -} diff --git a/libraries/dear-imgui/basic/file_manager.h b/libraries/dear-imgui/basic/file_manager.h deleted file mode 100644 index 74d22d3e..00000000 --- a/libraries/dear-imgui/basic/file_manager.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -class FileManager -{ -public: - FileManager(); - ~FileManager(); - static std::string read(const std::string& filename); -}; - diff --git a/libraries/dear-imgui/basic/main.cpp b/libraries/dear-imgui/basic/main.cpp deleted file mode 100644 index f9fb75ea..00000000 --- a/libraries/dear-imgui/basic/main.cpp +++ /dev/null @@ -1,186 +0,0 @@ -#include "imgui.h" -#include "bindings/imgui_impl_glfw.h" -#include "bindings/imgui_impl_opengl3.h" -#include "opengl_shader.h" -#include "file_manager.h" -#include -#include -#include - -#include // Initialize with glewInit() - -// Include glfw3.h after our OpenGL definitions -#include - -#define PI 3.14159265358979323846 - -static void glfw_error_callback(int error, const char *description) -{ - fprintf(stderr, "Glfw Error %d: %s\n", error, description); -} - -void render_conan_logo() -{ - ImDrawList *draw_list = ImGui::GetWindowDrawList(); - float sz = 300.0f; - static ImVec4 col1 = ImVec4(68.0 / 255.0, 83.0 / 255.0, 89.0 / 255.0, 1.0f); - static ImVec4 col2 = ImVec4(40.0 / 255.0, 60.0 / 255.0, 80.0 / 255.0, 1.0f); - static ImVec4 col3 = ImVec4(50.0 / 255.0, 65.0 / 255.0, 82.0 / 255.0, 1.0f); - static ImVec4 col4 = ImVec4(20.0 / 255.0, 40.0 / 255.0, 60.0 / 255.0, 1.0f); - const ImVec2 p = ImGui::GetCursorScreenPos(); - float x = p.x + 4.0f, y = p.y + 4.0f; - draw_list->AddQuadFilled(ImVec2(x, y + 0.25 * sz), ImVec2(x + 0.5 * sz, y + 0.5 * sz), ImVec2(x + sz, y + 0.25 * sz), ImVec2(x + 0.5 * sz, y), ImColor(col1)); - draw_list->AddQuadFilled(ImVec2(x, y + 0.25 * sz), ImVec2(x + 0.5 * sz, y + 0.5 * sz), ImVec2(x + 0.5 * sz, y + 1.0 * sz), ImVec2(x, y + 0.75 * sz), ImColor(col2)); - draw_list->AddQuadFilled(ImVec2(x + 0.5 * sz, y + 0.5 * sz), ImVec2(x + sz, y + 0.25 * sz), ImVec2(x + sz, y + 0.75 * sz), ImVec2(x + 0.5 * sz, y + 1.0 * sz), ImColor(col3)); - draw_list->AddLine(ImVec2(x + 0.75 * sz, y + 0.375 * sz), ImVec2(x + 0.75 * sz, y + 0.875 * sz), ImColor(col4)); - draw_list->AddBezierCurve(ImVec2(x + 0.72 * sz, y + 0.24 * sz), ImVec2(x + 0.68 * sz, y + 0.15 * sz), ImVec2(x + 0.48 * sz, y + 0.13 * sz), ImVec2(x + 0.39 * sz, y + 0.17 * sz), ImColor(col4), 10, 18); - draw_list->AddBezierCurve(ImVec2(x + 0.39 * sz, y + 0.17 * sz), ImVec2(x + 0.2 * sz, y + 0.25 * sz), ImVec2(x + 0.3 * sz, y + 0.35 * sz), ImVec2(x + 0.49 * sz, y + 0.38 * sz), ImColor(col4), 10, 18); -} - -void create_triangle(unsigned int &vbo, unsigned int &vao, unsigned int &ebo) -{ - - // create the triangle - float triangle_vertices[] = { - 0.0f, 0.25f, 0.0f, // position vertex 1 - 1.0f, 0.0f, 0.0f, // color vertex 1 - 0.25f, -0.25f, 0.0f, // position vertex 1 - 0.0f, 1.0f, 0.0f, // color vertex 1 - -0.25f, -0.25f, 0.0f, // position vertex 1 - 0.0f, 0.0f, 1.0f, // color vertex 1 - }; - unsigned int triangle_indices[] = { - 0, 1, 2}; - glGenVertexArrays(1, &vao); - glGenBuffers(1, &vbo); - glGenBuffers(1, &ebo); - glBindVertexArray(vao); - glBindBuffer(GL_ARRAY_BUFFER, vbo); - glBufferData(GL_ARRAY_BUFFER, sizeof(triangle_vertices), triangle_vertices, GL_STATIC_DRAW); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(triangle_indices), triangle_indices, GL_STATIC_DRAW); - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), (void *)0); - glEnableVertexAttribArray(0); - glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), (void *)(3 * sizeof(float))); - glEnableVertexAttribArray(1); - glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindVertexArray(0); -} - -int main(int, char **) -{ - // Setup window - glfwSetErrorCallback(glfw_error_callback); - if (!glfwInit()) - return 1; - - // Decide GL+GLSL versions -#if __APPLE__ - // GL 3.2 + GLSL 150 - const char *glsl_version = "#version 150"; - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); - glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // 3.2+ only - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // Required on Mac -#else - // GL 3.0 + GLSL 130 - const char *glsl_version = "#version 130"; - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); - //glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // 3.2+ only - //glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // 3.0+ only -#endif - - // Create window with graphics context - GLFWwindow *window = glfwCreateWindow(1280, 720, "Dear ImGui - Conan", NULL, NULL); - if (window == NULL) - return 1; - glfwMakeContextCurrent(window); - glfwSwapInterval(1); // Enable vsync - - bool err = glewInit() != GLEW_OK; - - if (err) - { - fprintf(stderr, "Failed to initialize OpenGL loader!\n"); - return 1; - } - - int screen_width, screen_height; - glfwGetFramebufferSize(window, &screen_width, &screen_height); - glViewport(0, 0, screen_width, screen_height); - - // create our geometries - unsigned int vbo, vao, ebo; - create_triangle(vbo, vao, ebo); - - // init shader - Shader triangle_shader; - triangle_shader.init(FileManager::read("simple-shader.vs"), FileManager::read("simple-shader.fs")); - - // Setup Dear ImGui context - IMGUI_CHECKVERSION(); - ImGui::CreateContext(); - ImGuiIO &io = ImGui::GetIO(); - // Setup Platform/Renderer bindings - ImGui_ImplGlfw_InitForOpenGL(window, true); - ImGui_ImplOpenGL3_Init(glsl_version); - // Setup Dear ImGui style - ImGui::StyleColorsDark(); - - while (!glfwWindowShouldClose(window)) - { - glfwPollEvents(); - glClearColor(0.45f, 0.55f, 0.60f, 1.00f); - glClear(GL_COLOR_BUFFER_BIT); - - // feed inputs to dear imgui, start new frame - ImGui_ImplOpenGL3_NewFrame(); - ImGui_ImplGlfw_NewFrame(); - ImGui::NewFrame(); - - // rendering our geometries - triangle_shader.use(); - glBindVertexArray(vao); - glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, 0); - glBindVertexArray(0); - - // render your GUI - ImGui::Begin("Triangle Position/Color"); - static float rotation = 0.0; - ImGui::SliderFloat("rotation", &rotation, 0, 2 * PI); - static float translation[] = {0.0, 0.0}; - ImGui::SliderFloat2("position", translation, -1.0, 1.0); - static float color[4] = { 1.0f,1.0f,1.0f,1.0f }; - // pass the parameters to the shader - triangle_shader.setUniform("rotation", rotation); - triangle_shader.setUniform("translation", translation[0], translation[1]); - // color picker - ImGui::ColorEdit3("color", color); - // multiply triangle's color with this color - triangle_shader.setUniform("color", color[0], color[1], color[2]); - ImGui::End(); - - ImGui::Begin("Conan logo"); - render_conan_logo(); - ImGui::End(); - // Render dear imgui into screen - ImGui::Render(); - ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); - - int display_w, display_h; - glfwGetFramebufferSize(window, &display_w, &display_h); - glViewport(0, 0, display_w, display_h); - glfwSwapBuffers(window); - } - - // Cleanup - ImGui_ImplOpenGL3_Shutdown(); - ImGui_ImplGlfw_Shutdown(); - ImGui::DestroyContext(); - - glfwDestroyWindow(window); - glfwTerminate(); - - return 0; -} diff --git a/libraries/dear-imgui/basic/opengl_shader.cpp b/libraries/dear-imgui/basic/opengl_shader.cpp deleted file mode 100644 index cd33229e..00000000 --- a/libraries/dear-imgui/basic/opengl_shader.cpp +++ /dev/null @@ -1,99 +0,0 @@ -#include "opengl_shader.h" - -#include -#include -#include -#include -#include - -Shader::Shader() { -} - -void Shader::init(const std::string& vertex_code, const std::string& fragment_code) { - vertex_code_ = vertex_code; - fragment_code_ = fragment_code; - compile(); - link(); -} - -void Shader::compile() { - const char* vcode = vertex_code_.c_str(); - vertex_id_ = glCreateShader(GL_VERTEX_SHADER); - glShaderSource(vertex_id_, 1, &vcode, NULL); - glCompileShader(vertex_id_); - - const char* fcode = fragment_code_.c_str(); - fragment_id_ = glCreateShader(GL_FRAGMENT_SHADER); - glShaderSource(fragment_id_, 1, &fcode, NULL); - glCompileShader(fragment_id_); - checkCompileErr(); -} - -void Shader::link() { - id_ = glCreateProgram(); - glAttachShader(id_, vertex_id_); - glAttachShader(id_, fragment_id_); - glLinkProgram(id_); - checkLinkingErr(); - glDeleteShader(vertex_id_); - glDeleteShader(fragment_id_); -} - -void Shader::use() { - glUseProgram(id_); -} - -template<> -void Shader::setUniform(const std::string& name, int val) { - glUniform1i(glGetUniformLocation(id_, name.c_str()), val); -} - -template<> -void Shader::setUniform(const std::string& name, bool val) { - glUniform1i(glGetUniformLocation(id_, name.c_str()), val); -} - -template<> -void Shader::setUniform(const std::string& name, float val) { - glUniform1f(glGetUniformLocation(id_, name.c_str()), val); -} - -template<> -void Shader::setUniform(const std::string& name, float val1, float val2) { - glUniform2f(glGetUniformLocation(id_, name.c_str()), val1, val2); -} - -template<> -void Shader::setUniform(const std::string& name, float val1, float val2, float val3) { - glUniform3f(glGetUniformLocation(id_, name.c_str()), val1, val2, val3); -} - -template<> -void Shader::setUniform(const std::string& name, float* val) { - glUniformMatrix4fv(glGetUniformLocation(id_, name.c_str()), 1, GL_FALSE, val); -} - -void Shader::checkCompileErr() { - int success; - char infoLog[1024]; - glGetShaderiv(vertex_id_, GL_COMPILE_STATUS, &success); - if (!success) { - glGetShaderInfoLog(vertex_id_, 1024, NULL, infoLog); - std::cout << "Error compiling Vertex Shader:\n" << infoLog << std::endl; - } - glGetShaderiv(fragment_id_, GL_COMPILE_STATUS, &success); - if (!success) { - glGetShaderInfoLog(fragment_id_, 1024, NULL, infoLog); - std::cout << "Error compiling Fragment Shader:\n" << infoLog << std::endl; - } -} - -void Shader::checkLinkingErr() { - int success; - char infoLog[1024]; - glGetProgramiv(id_, GL_LINK_STATUS, &success); - if (!success) { - glGetProgramInfoLog(id_, 1024, NULL, infoLog); - std::cout << "Error Linking Shader Program:\n" << infoLog << std::endl; - } -} diff --git a/libraries/dear-imgui/basic/opengl_shader.h b/libraries/dear-imgui/basic/opengl_shader.h deleted file mode 100644 index a4d1b8ab..00000000 --- a/libraries/dear-imgui/basic/opengl_shader.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef opengl_shader_hpp -#define opengl_shader_hpp - -#include -#include - -class Shader -{ -public: - Shader(); - void init(const std::string& vertex_code, const std::string& fragment_code); - void use(); - template void setUniform(const std::string& name, T val); - template void setUniform(const std::string& name, T val1, T val2); - template void setUniform(const std::string& name, T val1, T val2, T val3); - -private: - void checkCompileErr(); - void checkLinkingErr(); - void compile(); - void link(); - unsigned int vertex_id_, fragment_id_, id_; - std::string vertex_code_; - std::string fragment_code_; -}; - -#endif /* opengl_shader_hpp */ diff --git a/libraries/folly/basic/CMakeLists.txt b/libraries/folly/basic/CMakeLists.txt deleted file mode 100644 index 3d55df2c..00000000 --- a/libraries/folly/basic/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.1.3) -project(folly_example CXX) - -set(CMAKE_VERBOSE_MAKEFILE ON) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_executable(${PROJECT_NAME} main.cpp) -target_link_libraries(${PROJECT_NAME} CONAN_PKG::folly) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14) \ No newline at end of file diff --git a/libraries/folly/basic/README.md b/libraries/folly/basic/README.md deleted file mode 100644 index 4ffa8316..00000000 --- a/libraries/folly/basic/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# Conan Folly Example - -## Folly example using Conan for blog post - -- Conan.io blog: https://blog.conan.io -- Blog post about Folly: https://blog.conan.io/2018/11/19/Using-Facebook-Folly-with-Conan.html - -#### How to build -To build this project using cmake: - - git clone https://github.com/conan-io/examples.git conan-examples - cd conan-examples/libraries/folly/basic - mkdir build && cd build - conan install .. - cmake .. - cmake --build . - bin/folly_example - -#### Requirements -- CMake >=3.1.3 -- C++ compiler with C++14 support (Folly requirement) -- Conan >=1.9.1 diff --git a/libraries/folly/basic/build.bat b/libraries/folly/basic/build.bat deleted file mode 100644 index ed93b256..00000000 --- a/libraries/folly/basic/build.bat +++ /dev/null @@ -1,16 +0,0 @@ -if "%CMAKE_GENERATOR%"=="" ( - ECHO CMAKE_GENERATOR environment variable not defined. Please define the CMake generator in the CMAKE_GENERATOR environment variable. -) -else ( - @ECHO ON - - RMDIR /Q /S build - MKDIR build - PUSHD build - - conan install .. - cmake .. -G "%CMAKE_GENERATOR%" - cmake --build . --config Release - - bin\folly_example.exe -) diff --git a/libraries/folly/basic/build.sh b/libraries/folly/basic/build.sh deleted file mode 100755 index 1bd5aa9f..00000000 --- a/libraries/folly/basic/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -e -set -x - -rm -rf build -mkdir build -pushd build - -conan install .. --build=missing -cmake .. -DCMAKE_BUILD_TYPE=Release -cmake --build . - -bin/folly_example diff --git a/libraries/folly/basic/conanfile.txt b/libraries/folly/basic/conanfile.txt deleted file mode 100644 index 071fff3d..00000000 --- a/libraries/folly/basic/conanfile.txt +++ /dev/null @@ -1,6 +0,0 @@ -[requires] -folly/2020.08.10.00 -openssl/1.1.1k - -[generators] -cmake \ No newline at end of file diff --git a/libraries/folly/basic/main.cpp b/libraries/folly/basic/main.cpp deleted file mode 100644 index 6b0ada85..00000000 --- a/libraries/folly/basic/main.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -static void print_uri(const folly::fbstring& value) { - const folly::Uri uri(value); - const auto authority = folly::format("The authority from {} is {}", uri.fbstr(), uri.authority()); - std::cout << authority << std::endl; -} - -int main() { - folly::ThreadedExecutor executor; - folly::Promise promise; - folly::Future future = promise.getSemiFuture().via(&executor); - folly::Future unit = std::move(future).thenValue(print_uri); - promise.setValue("https://conan.io/"); - std::move(unit).get(); - return EXIT_SUCCESS; -} diff --git a/libraries/imgui-opencv-poco/.gitignore b/libraries/imgui-opencv-poco/.gitignore deleted file mode 100644 index 8571d98a..00000000 --- a/libraries/imgui-opencv-poco/.gitignore +++ /dev/null @@ -1,371 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -.vscode/ -build/ -CMakeLists.txt.user -CMakeCache.txt -CMakeFiles -CMakeScripts -Testing -Makefile -cmake_install.cmake -install_manifest.txt -compile_commands.json -CTestTestfile.cmake -_deps - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ -imgui.ini -include/imgui_impl_glfw.h -include/imgui_impl_opengl3.h -src/imgui_impl_glfw.cpp -src/imgui_impl_opengl3.cpp -msvc/conan -msvc/include -msvc/src diff --git a/libraries/imgui-opencv-poco/CMakeLists.txt b/libraries/imgui-opencv-poco/CMakeLists.txt deleted file mode 100644 index b505e9ca..00000000 --- a/libraries/imgui-opencv-poco/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -# set minimum cmake version -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) - -# project name and language -project(imgui-opencv LANGUAGES CXX) -set(CMAKE_CXX_STANDARD 11) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) - -add_executable(imgui-opencv - app/main.cpp - src/imgui_impl_glfw.cpp - src/imgui_impl_opengl3.cpp - src/gui_renderer.cpp - src/downloader.cpp - include/imgui_impl_glfw.h - include/imgui_impl_opengl3.h - include/gui_renderer.hpp - include/downloader.h -) - -target_link_libraries(imgui-opencv ${CONAN_LIBS}) \ No newline at end of file diff --git a/libraries/imgui-opencv-poco/README.md b/libraries/imgui-opencv-poco/README.md deleted file mode 100644 index 5ff4eb1f..00000000 --- a/libraries/imgui-opencv-poco/README.md +++ /dev/null @@ -1,37 +0,0 @@ -## imgui - opencv - -Just a simple demo to add opencv, imgui and poco libraries to a project using Conan.io -The program will download a picture from the Internet and apply a threshold to the image with the desired level through an slider. - -![use](https://raw.githubusercontent.com/conan-io/examples/master/libraries/imgui-opencv-poco/data/screen-capture.gif) - -## How to use: - -This project provides 2 build systems. CMake one should work for all platforms. It also integrates a Visual Studio project, only -for those interested in the pure Visual Studio integration without using CMake, but not mandatory, you can use the CMake one for -Windows and having CMake compile with Visual Studio compiler. - -1. Install conan: https://docs.conan.io/en/latest/installation.html -2. Clone this repo: `git clone https://github.com/conan-io/examples.git` -3. `cd libraries/imgui-opencv-poco` - -For CMake - -4. `mkdir build && cd build` -5. `conan install ..` -6. `conan build ..` -7. `./bin/imgui-opencv` - -For Visual Studio 16 2019 - -4. `cd msvc` -5. `conan install .. -g=MSBuildDeps -if=conan` -6. Open msvc.sln -7. Change to Release and x64 configuration in IDE -8. Build solution & run - - -#### App running -* You can use a custom url to load your image -* Click 'Open' to open the image -* Apply a threshold with the slider diff --git a/libraries/imgui-opencv-poco/app/main.cpp b/libraries/imgui-opencv-poco/app/main.cpp deleted file mode 100644 index 826894ce..00000000 --- a/libraries/imgui-opencv-poco/app/main.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// demo application to run a shader that -// opens an image from the internet -// and applies a threshold -// using Imgui, Opencv and Poco - -#include "../include/gui_renderer.hpp" - -int main(int, char **) -{ - GUIRenderer renderer; - renderer.InitGUI(); - renderer.Render(); - return 0; -} diff --git a/libraries/imgui-opencv-poco/conanfile.py b/libraries/imgui-opencv-poco/conanfile.py deleted file mode 100644 index 48285142..00000000 --- a/libraries/imgui-opencv-poco/conanfile.py +++ /dev/null @@ -1,25 +0,0 @@ -from conans import ConanFile, CMake - - -class ImguiOpencvDemo(ConanFile): - settings = "os", "compiler", "build_type", "arch" - requires = "imgui/1.79",\ - "glfw/3.3.2",\ - "glew/2.1.0",\ - "opencv/2.4.13.7",\ - "poco/1.10.1" - - generators = "cmake" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def imports(self): - self.copy("*.dll", dst="bin", src="bin") - self.copy("*.dylib*", dst="bin", src="lib") - self.copy("imgui_impl_glfw.cpp", dst="../src", src="./res/bindings") - self.copy("imgui_impl_opengl3.cpp", dst="../src", src="./res/bindings") - self.copy("imgui_impl_glfw.h*", dst="../include", src="./res/bindings") - self.copy("imgui_impl_opengl3.h*", dst="../include", src="./res/bindings") diff --git a/libraries/imgui-opencv-poco/data/bird.jpeg b/libraries/imgui-opencv-poco/data/bird.jpeg deleted file mode 100644 index abd74103..00000000 Binary files a/libraries/imgui-opencv-poco/data/bird.jpeg and /dev/null differ diff --git a/libraries/imgui-opencv-poco/data/screen-capture.gif b/libraries/imgui-opencv-poco/data/screen-capture.gif deleted file mode 100644 index 4fdd121f..00000000 Binary files a/libraries/imgui-opencv-poco/data/screen-capture.gif and /dev/null differ diff --git a/libraries/imgui-opencv-poco/include/downloader.h b/libraries/imgui-opencv-poco/include/downloader.h deleted file mode 100644 index 65fa12ab..00000000 --- a/libraries/imgui-opencv-poco/include/downloader.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once - -#include -#include "Poco/URIStreamOpener.h" -#include "Poco/StreamCopier.h" -#include "Poco/Path.h" -#include "Poco/URI.h" -#include "Poco/Exception.h" -#include "Poco/SharedPtr.h" -#include "Poco/Net/HTTPStreamFactory.h" -#include "Poco/Net/HTTPSStreamFactory.h" -#include "Poco/Net/FTPStreamFactory.h" -#include "Poco/Net/SSLManager.h" -#include "Poco/Net/AcceptCertificateHandler.h" -#include "Poco/Net/PrivateKeyPassphraseHandler.h" -#include -#include -#include - -using Poco::Exception; -using Poco::Path; -using Poco::SharedPtr; -using Poco::StreamCopier; -using Poco::URI; -using Poco::URIStreamOpener; -using Poco::Net::AcceptCertificateHandler; -using Poco::Net::Context; -using Poco::Net::FTPStreamFactory; -using Poco::Net::HTTPSStreamFactory; -using Poco::Net::HTTPStreamFactory; -using Poco::Net::InvalidCertificateHandler; -using Poco::Net::SSLManager; - -class Downloader -{ -public: - Downloader(); - ~Downloader(void); - std::string DownloadFile(const std::string &url); -}; diff --git a/libraries/imgui-opencv-poco/include/gui_renderer.hpp b/libraries/imgui-opencv-poco/include/gui_renderer.hpp deleted file mode 100644 index 0997f4f2..00000000 --- a/libraries/imgui-opencv-poco/include/gui_renderer.hpp +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include -#include "imgui.h" -#include "../include/imgui_impl_glfw.h" -#include "../include/imgui_impl_opengl3.h" -#include -#include - -#include "../include/downloader.h" - -#include -#include -#include - -#if defined(_MSC_VER) && (_MSC_VER >= 1900) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) -#pragma comment(lib, "legacy_stdio_definitions") -#endif - -class GUIRenderer -{ -public: - GUIRenderer(); - ~GUIRenderer(void); - int InitGUI(); - void Render(); - void ShowImage(); - void UpdateTexture(); - -private: - GLFWwindow *window_; - GLuint texture_id_; - int image_width_, image_height_; - Downloader downloader_; - cv::Mat resized_image_; - cv::Mat thresholded_image_; - int threshold_; -}; diff --git a/libraries/imgui-opencv-poco/msvc/msvc.sln b/libraries/imgui-opencv-poco/msvc/msvc.sln deleted file mode 100644 index a60df157..00000000 --- a/libraries/imgui-opencv-poco/msvc/msvc.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30907.101 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msvc", "msvc.vcxproj", "{0A07CFE2-658B-4348-A811-5112E7AEF058}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0A07CFE2-658B-4348-A811-5112E7AEF058}.Debug|x64.ActiveCfg = Debug|x64 - {0A07CFE2-658B-4348-A811-5112E7AEF058}.Debug|x64.Build.0 = Debug|x64 - {0A07CFE2-658B-4348-A811-5112E7AEF058}.Debug|x86.ActiveCfg = Debug|Win32 - {0A07CFE2-658B-4348-A811-5112E7AEF058}.Debug|x86.Build.0 = Debug|Win32 - {0A07CFE2-658B-4348-A811-5112E7AEF058}.Release|x64.ActiveCfg = Release|x64 - {0A07CFE2-658B-4348-A811-5112E7AEF058}.Release|x64.Build.0 = Release|x64 - {0A07CFE2-658B-4348-A811-5112E7AEF058}.Release|x86.ActiveCfg = Release|Win32 - {0A07CFE2-658B-4348-A811-5112E7AEF058}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {5BD4CE16-B58A-4BD0-B73A-352720C0F134} - EndGlobalSection -EndGlobal diff --git a/libraries/imgui-opencv-poco/msvc/msvc.vcxproj b/libraries/imgui-opencv-poco/msvc/msvc.vcxproj deleted file mode 100644 index 61f79727..00000000 --- a/libraries/imgui-opencv-poco/msvc/msvc.vcxproj +++ /dev/null @@ -1,156 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {0a07cfe2-658b-4348-a811-5112e7aef058} - msvc - 10.0 - - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - true - - - false - - - true - - - false - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(SolutionDir)\include;$(SolutionDir)\..\include;%(AdditionalIncludeDirectories) - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(SolutionDir)\include;$(SolutionDir)\..\include;%(AdditionalIncludeDirectories) - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(SolutionDir)\include;$(SolutionDir)\..\include;%(AdditionalIncludeDirectories) - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - $(SolutionDir)\include;$(SolutionDir)\..\include;%(AdditionalIncludeDirectories) - - - Console - true - true - true - - - - - - - - - - - - - \ No newline at end of file diff --git a/libraries/imgui-opencv-poco/msvc/msvc.vcxproj.filters b/libraries/imgui-opencv-poco/msvc/msvc.vcxproj.filters deleted file mode 100644 index 197b829b..00000000 --- a/libraries/imgui-opencv-poco/msvc/msvc.vcxproj.filters +++ /dev/null @@ -1,34 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/libraries/imgui-opencv-poco/src/downloader.cpp b/libraries/imgui-opencv-poco/src/downloader.cpp deleted file mode 100644 index 01acc8fc..00000000 --- a/libraries/imgui-opencv-poco/src/downloader.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "downloader.h" -#include - -Downloader::Downloader(void) -{ - HTTPStreamFactory::registerFactory(); - FTPStreamFactory::registerFactory(); - HTTPSStreamFactory::registerFactory(); - Poco::Net::initializeSSL(); -} - -Downloader::~Downloader(void) -{ - Poco::Net::uninitializeSSL(); -} - -std::string Downloader::DownloadFile(const std::string &url) -{ - Path path(url); - std::string filename = ""; - try - { - SharedPtr pCertHandler = new AcceptCertificateHandler(false); - Context::Ptr pContext = new Context(Context::CLIENT_USE, ""); - SSLManager::instance().initializeClient(0, pCertHandler, pContext); - URI uri(url); - std::unique_ptr pStr(URIStreamOpener::defaultOpener().open(uri)); - std::ofstream fileStream; - filename = path.getFileName(); - fileStream.open(filename, std::ios::out | std::ios::trunc | std::ios::binary); - StreamCopier::copyStream(*pStr.get(), fileStream); - fileStream.close(); - } - catch (Exception &exc) - { - std::cerr << exc.displayText() << std::endl; - filename = ""; - } - return filename; -} diff --git a/libraries/imgui-opencv-poco/src/gui_renderer.cpp b/libraries/imgui-opencv-poco/src/gui_renderer.cpp deleted file mode 100644 index cf1afe98..00000000 --- a/libraries/imgui-opencv-poco/src/gui_renderer.cpp +++ /dev/null @@ -1,152 +0,0 @@ -#include "gui_renderer.hpp" - -static void glfw_error_callback(int error, const char *description) -{ - fprintf(stderr, "Glfw Error %d: %s\n", error, description); -} - -GUIRenderer::GUIRenderer(void) : texture_id_(-1), threshold_(127) -{ -} - -GUIRenderer::~GUIRenderer(void) -{ -} - -int GUIRenderer::InitGUI() -{ - glfwSetErrorCallback(glfw_error_callback); - if (!glfwInit()) - return 1; - - // Decide GL+GLSL versions -#if __APPLE__ - // GL 3.2 + GLSL 150 - const char *glsl_version = "#version 150"; - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); - glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // 3.2+ only - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // Required on Mac -#else - // GL 3.0 + GLSL 130 - const char *glsl_version = "#version 130"; - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); - //glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // 3.2+ only - //glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // 3.0+ only -#endif - - // Create window with graphics context - window_ = glfwCreateWindow(1280, 720, "imgui-opencv demo", NULL, NULL); - if (window_ == NULL) - return 1; - glfwMakeContextCurrent(window_); - glfwSwapInterval(1); // Enable vsync - - // Initialize OpenGL loader - bool err = glewInit() != GLEW_OK; - if (err) - { - fprintf(stderr, "Failed to initialize OpenGL loader!\n"); - return 1; - } - // Setup Dear ImGui context - IMGUI_CHECKVERSION(); - ImGui::CreateContext(); - ImGuiIO &io = ImGui::GetIO(); - (void)io; - ImGui::StyleColorsDark(); - // Setup Platform/Renderer bindings - ImGui_ImplGlfw_InitForOpenGL(window_, true); - ImGui_ImplOpenGL3_Init(glsl_version); - return 0; -} - -void GUIRenderer::UpdateTexture() -{ - unsigned char *data = thresholded_image_.ptr(); - image_width_ = thresholded_image_.cols; - image_height_ = thresholded_image_.rows; - if (texture_id_ == -1) - glGenTextures(1, &texture_id_); - glBindTexture(GL_TEXTURE_2D, texture_id_); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image_width_, image_height_, 0, GL_BGR, GL_UNSIGNED_BYTE, data); - glGenerateMipmap(GL_TEXTURE_2D); -} - -void GUIRenderer::ShowImage() -{ - ImGui::Begin("Image"); - // Image downloaded from: https://www.pexels.com/photo/green-bird-1661179/ - static char image_url[256] = "https://raw.githubusercontent.com/conan-io/examples/master/libraries/imgui-opencv-poco/data/bird.jpeg"; - ImGui::InputText("URL:", image_url, IM_ARRAYSIZE(image_url)); - ImGui::SameLine(); - if (ImGui::Button("Open")) - { - std::string filename = ""; - try - { - filename = downloader_.DownloadFile(std::string(image_url)); - } - catch (Exception &exc) - { - std::cerr << exc.displayText() << std::endl; - } - if (filename != "") - { - cv::Mat image = cv::imread(filename.c_str()); - if (!image.empty()) - { - int resized_width = 640; - double scale = static_cast(resized_width)/image.size().width; - cv::resize(image, resized_image_, cv::Size(0, 0), scale, scale); - resized_image_.copyTo(thresholded_image_); - UpdateTexture(); - } - } - } - if (texture_id_ != -1) - { - ImVec2 canvas_size = ImVec2(image_width_, image_height_); - ImGui::ImageButton((void *)(intptr_t)texture_id_, canvas_size, ImVec2(0, 0), ImVec2(1, 1), 0); - ImGui::PushItemWidth(300); - if (ImGui::SliderInt("threshold level", &threshold_, 0, 255)) - { - cv::threshold(resized_image_, thresholded_image_, threshold_, 255, cv::THRESH_BINARY); - UpdateTexture(); - } - } - ImGui::End(); -} - -void GUIRenderer::Render() -{ - while (!glfwWindowShouldClose(window_)) - { - glfwPollEvents(); - ImGui_ImplOpenGL3_NewFrame(); - ImGui_ImplGlfw_NewFrame(); - ImGui::NewFrame(); - - ShowImage(); - - ImGui::Render(); - int display_w, display_h; - glfwMakeContextCurrent(window_); - glfwGetFramebufferSize(window_, &display_w, &display_h); - glViewport(0, 0, display_w, display_h); - glClearColor(0.45, 0.56, 0.67, 1); - glClear(GL_COLOR_BUFFER_BIT); - ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); - glfwMakeContextCurrent(window_); - glfwSwapBuffers(window_); - } - ImGui_ImplOpenGL3_Shutdown(); - ImGui_ImplGlfw_Shutdown(); - ImGui::DestroyContext(); - glfwDestroyWindow(window_); - glfwTerminate(); -} diff --git a/libraries/poco/md5/CMakeLists.txt b/libraries/poco/md5/CMakeLists.txt deleted file mode 100644 index ae4521f2..00000000 --- a/libraries/poco/md5/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(MD5Encrypter) - -if(CMAKE_VERSION VERSION_LESS 3.0.0) - include(CheckCXXCompilerFlag) - check_cxx_compiler_flag(-std=c++11 COMPILER_SUPPORTS_CXX11) - check_cxx_compiler_flag(-std=c++0x COMPILER_SUPPORTS_CXX0X) - if(COMPILER_SUPPORTS_CXX11) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - elseif(COMPILER_SUPPORTS_CXX0X) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") - endif() -else() - SET(CMAKE_CXX_STANDARD 11) - SET(CMAKE_CXX_STANDARD_REQUIRED ON) -endif() - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -add_executable(md5 md5.cpp) -target_link_libraries(md5 ${CONAN_LIBS}) diff --git a/libraries/poco/md5/README.md b/libraries/poco/md5/README.md deleted file mode 100644 index 27938ecf..00000000 --- a/libraries/poco/md5/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# Poco MD5 Example - -Example of and MD5 calculation app using POCO C++ libraries installed with Conan C/C++ package manager. - -Mostly used to run the conan.io getting started: https://docs.conan.io/en/latest/getting_started.html - -## Compiling steps - -1. Create a build directory: - - ``` - $ mkdir build && cd build - ``` - -2. Install dependencies (Poco -> OpenSSL -> zlib): - - ``` - $ conan install .. - ``` - -3. Configure the CMake project (Using MSVC 16 in this example): - - ``` - $ cmake .. -G "Visual Studio 16 2019" - ``` - -4. Build it: - - ``` - $ cmake --build . --config Release - ``` - -5. Run the application: - - ``` - $ .\bin\md5.exe - c3fcd3d76192e4007dfb496cca67e13b - ``` diff --git a/libraries/poco/md5/build.bat b/libraries/poco/md5/build.bat deleted file mode 100755 index 593451a1..00000000 --- a/libraries/poco/md5/build.bat +++ /dev/null @@ -1,16 +0,0 @@ -if "%CMAKE_GENERATOR%"=="" ( - ECHO CMAKE_GENERATOR environment variable not defined. Please define the CMake generator in the CMAKE_GENERATOR environment variable. -) -else ( - @ECHO ON - - RMDIR /Q /S build - MKDIR build - PUSHD build - - conan install .. - cmake .. -G "%CMAKE_GENERATOR%" - cmake --build . --config Release - - bin\md5.exe -) diff --git a/libraries/poco/md5/build.sh b/libraries/poco/md5/build.sh deleted file mode 100755 index a3236b46..00000000 --- a/libraries/poco/md5/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -e -set -x - -rm -rf build -mkdir build -pushd build - -conan install .. --build=missing -cmake .. -DCMAKE_BUILD_TYPE=Release -cmake --build . - -bin/md5 diff --git a/libraries/poco/md5/conanfile.txt b/libraries/poco/md5/conanfile.txt deleted file mode 100644 index b02de91d..00000000 --- a/libraries/poco/md5/conanfile.txt +++ /dev/null @@ -1,5 +0,0 @@ -[requires] -poco/1.9.4 - -[generators] -cmake \ No newline at end of file diff --git a/libraries/poco/md5/md5.cpp b/libraries/poco/md5/md5.cpp deleted file mode 100644 index 3ff4e33f..00000000 --- a/libraries/poco/md5/md5.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "Poco/MD5Engine.h" -#include "Poco/DigestStream.h" - -#include - - -int main(int argc, char** argv) -{ - Poco::MD5Engine md5; - Poco::DigestOutputStream ds(md5); - ds << "abcdefghijklmnopqrstuvwxyz"; - ds.close(); - std::cout << Poco::DigestEngine::digestToHex(md5.digest()) << std::endl; - return 0; -} \ No newline at end of file diff --git a/libraries/protobuf/serialization/CMakeLists.txt b/libraries/protobuf/serialization/CMakeLists.txt deleted file mode 100644 index 797d8307..00000000 --- a/libraries/protobuf/serialization/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 3.1.2) -project(sensor CXX) - -set(CMAKE_VERBOSE_MAKEFILE ON) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(Protobuf REQUIRED) - -protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS sensor.proto) -protobuf_generate_python(PROTO_PYS sensor.proto) - -add_executable(${PROJECT_NAME} main.cc ${PROTO_SRCS} ${PROTO_HDRS}) -target_link_libraries(${PROJECT_NAME} PUBLIC CONAN_PKG::protobuf) -target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}) -set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) - -add_custom_target(proto_python ALL DEPENDS ${PROTO_PYS}) \ No newline at end of file diff --git a/libraries/protobuf/serialization/README.md b/libraries/protobuf/serialization/README.md deleted file mode 100644 index e34ab479..00000000 --- a/libraries/protobuf/serialization/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Conan Protobuf Example - -## Protobuf example using Conan for blog post - -- Conan.io blog: https://blog.conan.io - -#### How to build -To build this project using cmake: - - git clone https://github.com/conan-io/examples.git conan-examples - cd conan-examples/libraries/protobuf/serialization - mkdir build && cd build - conan install .. - cmake .. - cmake --build . - bin/sensor - -#### Requirements -- CMake >=3.1.3 -- C++ compiler with C++11 support (Protobuf requirement) -- Conan >=1.9.1 diff --git a/libraries/protobuf/serialization/__init__.py b/libraries/protobuf/serialization/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/libraries/protobuf/serialization/build.bat b/libraries/protobuf/serialization/build.bat deleted file mode 100644 index 9f7095f8..00000000 --- a/libraries/protobuf/serialization/build.bat +++ /dev/null @@ -1,20 +0,0 @@ -if "%CMAKE_GENERATOR%"=="" ( - ECHO CMAKE_GENERATOR environment variable not defined. Please define the CMake generator in the CMAKE_GENERATOR environment variable. -) -else ( - @ECHO ON - - RMDIR /Q /S build - MKDIR build - PUSHD build - - conan install .. - cmake .. -G "%CMAKE_GENERATOR%" - cmake --build . --config Release - - bin\sensor.exe - - pip install protobuf - python ../main.py - pip uninstall -y protobuf -) diff --git a/libraries/protobuf/serialization/build.sh b/libraries/protobuf/serialization/build.sh deleted file mode 100755 index 06507f04..00000000 --- a/libraries/protobuf/serialization/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -set -e -set -x - -rm -rf build -mkdir build -pushd build - -conan install .. --build=missing -cmake .. -DCMAKE_BUILD_TYPE=Release -cmake --build . - -bin/sensor - -pip install protobuf -python ../main.py -pip uninstall -y protobuf diff --git a/libraries/protobuf/serialization/conanfile.txt b/libraries/protobuf/serialization/conanfile.txt deleted file mode 100644 index 0bb7fce0..00000000 --- a/libraries/protobuf/serialization/conanfile.txt +++ /dev/null @@ -1,5 +0,0 @@ -[requires] -protobuf/3.17.1 - -[generators] -cmake diff --git a/libraries/protobuf/serialization/main.cc b/libraries/protobuf/serialization/main.cc deleted file mode 100644 index ac6e57ea..00000000 --- a/libraries/protobuf/serialization/main.cc +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include -#include "sensor.pb.h" - -int main() { - Sensor sensor; - sensor.set_name("Laboratory"); - sensor.set_temperature(23.4); - sensor.set_humidity(68); - sensor.set_door(Sensor_SwitchLevel_OPEN); - - std::cout << "Serialize " << sensor.name() << " to sensor.data\n"; - std::ofstream ofs("sensor.data"); - sensor.SerializeToOstream(&ofs); - - return 0; -} - - diff --git a/libraries/protobuf/serialization/main.py b/libraries/protobuf/serialization/main.py deleted file mode 100644 index ab60cc1a..00000000 --- a/libraries/protobuf/serialization/main.py +++ /dev/null @@ -1,15 +0,0 @@ -import os -from build.sensor_pb2 import Sensor - -if __name__ == "__main__": - with open("sensor.data", 'rb') as file: - content = file.read() - - print("Retrieve Sensor object from sensor.data") - sensor = Sensor() - sensor.ParseFromString(content) - door = "Open" if sensor.door else "Closed" - print("Sensor name: {}".format(sensor.name)) - print("Sensor temperature: {}".format(sensor.temperature)) - print("Sensor humidity: {}".format(sensor.humidity)) - print("Sensor door: {}".format(door)) diff --git a/libraries/protobuf/serialization/sensor.proto b/libraries/protobuf/serialization/sensor.proto deleted file mode 100644 index a279327c..00000000 --- a/libraries/protobuf/serialization/sensor.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto2"; -message Sensor { - required string name = 1; - required double temperature = 2; - required int32 humidity = 3; - - enum SwitchLevel { - CLOSED = 0; - OPEN = 1; - } - required SwitchLevel door = 4; -} -