diff --git a/.gitignore b/.gitignore index 0f2e944..13620b8 100644 --- a/.gitignore +++ b/.gitignore @@ -75,3 +75,4 @@ install_manifest.txt compile_commands.json CTestTestfile.cmake _deps +CMakeUserPresets.json diff --git a/README.md b/README.md index 90d3f1b..3bc7a24 100644 --- a/README.md +++ b/README.md @@ -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. -- 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 -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). -libpng16-dev distrib package can be used on debian/ubuntu. - -To compile, just clone and launch cmake: +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. ```shell -cmake . -make -make install -``` - -On Windows system, I can suggest you to use Conan support to help you with dependencies: - -```shell -mkdir build +conan install -of build . --build=missing -pr:b=default -pr:h=default cd build -conan install .. --build=missing -cmake .. -G "MinGW Makefiles" -make +cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" +cmake --build . ``` -If you want to do it manually without Conan support, you will probably need to specify the dependency flags for CMake. Ex: +On Windows environment, you can use MinGW `-G "MinGW Makefiles"` or Ninja `-G "Ninja"` as CMake generator. -`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"` +### Compiling (HARDCORE) -We can also use cross-compilation (after installing `mingw64` and `cmake` packages on your distrib): +If you want to do it manually without Conan, you will probably need to specify the dependency flags for CMake. Ex: -```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 . -``` \ No newline at end of file +`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.