This is a template project for a VisualStudio 2022 CMake project which is using conan v1 for dependecies and packaging a library. It is possible to build for linux WSL1, run and debug tests on WSL1 or a remote 32-bit machine (cross build and debug).
libxml2 and gtest
conan-cmake is used
pip install conan==1.61.0
https://pypi.org/project/conan/1.61.0/
located in the .conan
folder
2-step migration to conan v2.
- Migrate recipe to conan v2 and build with conan v1
- Build with conan v2
- Select Connection/Target System: WSL:Debian
- Select Configuration: wsl-debug
- Select Startup Item (target): MyLib_ut (bin\MyLib_ut)
- Debug (hit F5)
- Test will be executed on WSL with gbd
- Select Connection/Target System: WSL:Debian
- Select Configuration: remote-debug
- Select Startup Item (target): MyLib_ut (X Debug)
- described in launch.vs.json file
- Debug (hit F5)
- All extecutables and libs get copied to the target machine
- Test will be executed on target machine with gbd
conan profile detect
conan config install .conan
CONAN_RUN_TESTS=True conan create . mylib/1.0.0@steiner/testing -u -pr:h default -s build_type=RelWithDebInfo -pr:b=default
Install the toolchain: resources/toolchains/engel-toolchain-cube3210-i686_1.26.0+rc1_amd64.deb
This toolchain was generated by crosstool-ng (https://crosstool-ng.github.io/)
The toolchain is available in: /opt/x-tools/i686-cube3210-linux-gnu/toolchain.cmake
conan create . mylib/1.0.0@steiner/testing -u -pr:h cube3210 -s build_type=RelWithDebInfo -pr:b=default
For the showcase a toolchain.cmake
was created, which uses the debian i686 cross compiler apt install g++-i686-linux-gnu
.
cp toolchain.cmake /tmp/
conan create . mylib/1.0.0@steiner/testing -u -pr:h showcase -s build_type=RelWithDebInfo -pr:b=default