Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Visual Studio examples updated to use Conan2 #100

Open
wants to merge 26 commits into
base: develop2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 6 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,92 +6,17 @@ Several Conan examples to complement the documentation and blog.

## Examples

### [Getting started with Conan](libraries/poco/md5)
### [Creating packages with Visual Studio](features/visual_studio/creating_packages)

Example how to use Conan to consume binaries.
How to create packages with Visual Studio.

Documentation: https://docs.conan.io/en/latest/getting_started.html
Documentation: https://docs.conan.io/en/latest/integrations/visual_studio/creating_packages.html

### [Package development flow](features/package_development_flow)
### [Reusing packages with Visual Studio](features/visual_studio/chat)

Example how to use Conan commands to develop a package recipe.
How to use existing packages directly from Visual Studio.

Documentation: https://docs.conan.io/en/latest/developing_packages/package_dev_flow.html

### [Workspace](features/workspace)

Example how to use Conan Workspaces.

Documentation: https://docs.conan.io/en/latest/developing_packages/workspaces.html

### [Editable Packages](features/editable)

Example how to use Conan Editable Packages.

Documentation: https://docs.conan.io/en/latest/developing_packages/editable_packages.html

### [Serializing your data with Protobuf](libraries/protobuf/serialization)

Demonstrate how to use Protobuf to serialize data between C++ and Python.

Blog Post: https://blog.conan.io/2019/03/06/Serializing-your-data-with-Protobuf.html

### [Using Facebook Folly with Conan](libraries/folly/basic)

Demonstrate how to use Folly to validate an URI using Futures, FBString, Executors, and Format.

Blog Post: https://blog.conan.io/2018/12/03/Using-Facebook-Folly-with-Conan.html

### [An introduction to Dear ImGui and how to use with Conan](libraries/dear-imgui/basic)

Demonstrate how to use Dear ImGui with Conan to add a GUI to an OpenGL3 application.

### [Exporting targets with CMake and reuse with find_package()](features/cmake/find_package/exported_targets_multiconfig)

Use CMake to declare, export and install the targets of some libraries and using Conan to reuse them with
``find_package`` and the multi-configuration project.

### [Using the cmake_find_package_multi generator](features/cmake/find_package/find_cmake_multi_generator_targets)

Demonstrate how to use the ``cmake_find_package_multi`` generator to integrate seamlessly CMake with Conan
using ``find_package`` in a multi-configuration project.


### [Multi-configuration package (N configs -> 1 package)](features/multi_config)

Example on how to create multi-configuration debug/release packages covering the N configs -> 1 package use case:

- Remove the ``build_type`` from settings.
- Have a CMake script that differentiate debug and release artifacts (``set_target_properties(hello PROPERTIES DEBUG_POSTFIX _d)``).
- Have a ``build()`` that builds both configs.
- Have a ``package_info()`` method that accounts for both configs ``self.cpp_info.debug.libs``, etc.

Documentation: https://docs.conan.io/en/latest/creating_packages/package_approaches.html#n-configs-1-package


### Lockfiles

#### [Using lockfiles in CI to rebuild a whole project](features/lockfiles/ci)

When a package in a dependency graph is modified and a new version or revision is created, it
is sometimes desired to test if that new version works well within a larger product or project,
that is, when that package is part of a larger dependency graph. The packages that depend on
the modified one might need to be rebuilt, but if something else changed, it is impossible to
achieve reproducible builds.

Using lockfiles can enforce the same upstream dependencies, to ensure reproducible builds and to re-build and test such scenarios.

Documentation: https://docs.conan.io/en/latest/versioning/lockfiles.html#how-to-use-lockfiles-in-ci

### [Integrate a build system in Conan](features/integrate_build_system)

Shows how to integrate a build-system in Conan using an *installer*, a *build-helper* and a *custom generator*.

### [Deployment](features/deployment)

Shows how to use conan ``json`` generator with custom script to automate the creation of deployable artifact ([makeself.io](https://makeself.io))

Documentation: https://docs.conan.io/en/laters/integrations/deployment.html
Documentation: https://docs.conan.io/en/latest/integrations/visual_studio/creating_packages.html#reusing-packages

## How can I reproduce the build steps?

Expand Down
38 changes: 38 additions & 0 deletions features/visual_studio/chat/build/ChatLib/ChatLib.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ChatLib", "ChatLib.vcxproj", "{B7D900AD-0D6B-4E33-B241-FFF8142D7447}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MyChat", "..\MyChat\MyChat.vcxproj", "{8EDF1257-B79E-47AF-A1AC-F7A3E47B9C79}"
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
{B7D900AD-0D6B-4E33-B241-FFF8142D7447}.Debug|x64.ActiveCfg = Debug|x64
{B7D900AD-0D6B-4E33-B241-FFF8142D7447}.Debug|x64.Build.0 = Debug|x64
{B7D900AD-0D6B-4E33-B241-FFF8142D7447}.Debug|x86.ActiveCfg = Debug|Win32
{B7D900AD-0D6B-4E33-B241-FFF8142D7447}.Debug|x86.Build.0 = Debug|Win32
{B7D900AD-0D6B-4E33-B241-FFF8142D7447}.Release|x64.ActiveCfg = Release|x64
{B7D900AD-0D6B-4E33-B241-FFF8142D7447}.Release|x64.Build.0 = Release|x64
{B7D900AD-0D6B-4E33-B241-FFF8142D7447}.Release|x86.ActiveCfg = Release|Win32
{B7D900AD-0D6B-4E33-B241-FFF8142D7447}.Release|x86.Build.0 = Release|Win32
{8EDF1257-B79E-47AF-A1AC-F7A3E47B9C79}.Debug|x64.ActiveCfg = Debug|x64
{8EDF1257-B79E-47AF-A1AC-F7A3E47B9C79}.Debug|x64.Build.0 = Debug|x64
{8EDF1257-B79E-47AF-A1AC-F7A3E47B9C79}.Debug|x86.ActiveCfg = Debug|Win32
{8EDF1257-B79E-47AF-A1AC-F7A3E47B9C79}.Debug|x86.Build.0 = Debug|Win32
{8EDF1257-B79E-47AF-A1AC-F7A3E47B9C79}.Release|x64.ActiveCfg = Release|x64
{8EDF1257-B79E-47AF-A1AC-F7A3E47B9C79}.Release|x64.Build.0 = Release|x64
{8EDF1257-B79E-47AF-A1AC-F7A3E47B9C79}.Release|x86.ActiveCfg = Release|Win32
{8EDF1257-B79E-47AF-A1AC-F7A3E47B9C79}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
145 changes: 145 additions & 0 deletions features/visual_studio/chat/build/ChatLib/ChatLib.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B7D900AD-0D6B-4E33-B241-FFF8142D7447}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ChatLib</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\conandeps.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\conandeps.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\conandeps.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\conandeps.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\chat.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\chat.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
30 changes: 30 additions & 0 deletions features/visual_studio/chat/build/ChatLib/ChatLib.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\chat.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\chat.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
29 changes: 29 additions & 0 deletions features/visual_studio/chat/build/ChatLib/ReadMe.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
========================================================================
tapia marked this conversation as resolved.
Show resolved Hide resolved
STATIC LIBRARY : ChatLib Project Overview
========================================================================

AppWizard has created this ChatLib library project for you.

No source files were created as part of your project.


ChatLib.vcxproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.

ChatLib.vcxproj.filters
This is the filters file for VC++ projects generated using an Application Wizard.
It contains information about the association between the files in your project
and the filters. This association is used in the IDE to show grouping of files with
similar extensions under a specific node (for e.g. ".cpp" files are associated with the
"Source Files" filter).

/////////////////////////////////////////////////////////////////////////////
Other notes:

AppWizard uses "TODO:" comments to indicate parts of the source code you
should add to or customize.

/////////////////////////////////////////////////////////////////////////////
Loading