Validated conan v2 migration
All checks were successful
JCS-Prod/RSE-Texture/pipeline/pr-master This commit looks good
JCS-Prod/RSE-Texture/pipeline/head This commit looks good

This commit is contained in:
JackCarterSmith 2024-05-18 20:04:58 +02:00
parent d302d7ebd5
commit 0c8282ab5d
Signed by: JackCarterSmith
GPG Key ID: 832E52F4E23F8F24
2 changed files with 13 additions and 31 deletions

1
.gitignore vendored
View File

@ -75,3 +75,4 @@ install_manifest.txt
compile_commands.json compile_commands.json
CTestTestfile.cmake CTestTestfile.cmake
_deps _deps
CMakeUserPresets.json

View File

@ -44,45 +44,26 @@ Due to issue with copyrights, I can't provide samples... You need to extract HMT
Necessary libs (provided only in windows release) for running and for compiling. Necessary libs (provided only in windows release) for running and for compiling.
- libpng (1.6.37) - [zlib](https://www.zlib.net/) (1.2.13)
- [libpng](http://www.libpng.org/pub/png/libpng.html) (1.6.40)
### Compiling ### Compiling
You can compile on both Windows (MinGW) or native Linux system thanks to CMake, you only need to adjust your dependencies on Windows or use Conan packages manager (https://conan.io). I've a preference for compiling libraries by hand, mainly for backward compatibility, but I recommend using Conan packages manager (https://conan.io) for simplicity.
libpng16-dev distrib package can be used on debian/ubuntu.
To compile, just clone and launch cmake:
```shell ```shell
cmake . conan install -of build . --build=missing -pr:b=default -pr:h=default
make
make install
```
On Windows system, I can suggest you to use Conan support to help you with dependencies:
```shell
mkdir build
cd build cd build
conan install .. --build=missing cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles"
cmake .. -G "MinGW Makefiles"
make
```
If you want to do it manually without Conan support, you will probably need to specify the dependency flags for CMake. Ex:
`cmake.exe -D"ZLIB_INCLUDE_DIR=zlib/1.2.12/include" -D"ZLIB_LIBRARY=zlib/1.2.12/lib/libzlib.dll.a" -D"PNG_PNG_INCLUDE_DIR=libpng/1.6.37/include" -D"PNG_LIBRARY=libpng/1.6.37/lib/libpng.dll.a" . -G "MinGW Makefiles"`
We can also use cross-compilation (after installing `mingw64` and `cmake` packages on your distrib):
```shell
mkdir build && cd build
cmake -DGNU_HOST=x86_64-w64-mingw32 \
-DCMAKE_TOOLCHAIN_FILE=../mingw_cross_toolchain.cmake \
-D"ZLIB_INCLUDE_DIR=zlib/1.2.12/include" \
-D"ZLIB_LIBRARY=zlib/1.2.12/lib/libzlib.dll.a" \
-D"PNG_PNG_INCLUDE_DIR=libpng/1.6.37/include" \
-D"PNG_LIBRARY=libpng/1.6.37/lib/libpng.dll.a" \
..
cmake --build . cmake --build .
``` ```
On Windows environment, you can use MinGW `-G "MinGW Makefiles"` or Ninja `-G "Ninja"` as CMake generator.
### Compiling (HARDCORE)
If you want to do it manually without Conan, you will probably need to specify the dependency flags for CMake. Ex:
`cmake.exe -D"ZLIB_INCLUDE_DIR=zlib/1.2.13/include" -D"ZLIB_LIBRARY=zlib/1.2.13/lib/libzlib.dll.a" -D"PNG_PNG_INCLUDE_DIR=libpng/1.6.40/include" -D"PNG_LIBRARY=libpng/1.6.40/lib/libpng.dll.a" . -G "MinGW Makefiles"`
I've tested cross-compilation too, but since I want to check that Conan is working properly at each release, I've integrated it into the Jenkins flow using Conan for the cross-abstraction.