Added Conan PM support

This commit is contained in:
JackCarterSmith 2021-08-22 21:28:30 +02:00
parent 9f98830fce
commit 5716962abb
Signed by: JackCarterSmith
GPG Key ID: DB362B740828F843
3 changed files with 32 additions and 5 deletions

View File

@ -5,6 +5,7 @@
cmake_minimum_required(VERSION 3.1)
cmake_policy(VERSION 3.1)
set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
# define project
if(DEFINED ENV{CI})
@ -18,12 +19,14 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_SOURC
include(CheckIncludeFile)
include(CheckCSourceCompiles)
#include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
#conan_basic_setup()
# needed packages
find_package(ZLIB REQUIRED)
find_package(ZLIB 1.2.11 EXACT REQUIRED)
include_directories(${ZLIB_INCLUDE_DIR})
find_package(PNG REQUIRED)
find_package(PNG 1.6.37 EXACT REQUIRED)
include_directories(${PNG_INCLUDE_DIR})
# define src/headers files

View File

@ -43,8 +43,8 @@ Necessary libs (provided only in windows release) for running and for 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.
zlib (zlib1g) and libpng16 distrib packages can be used on debian/ubuntu.
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).
zlib-dev (zlib1g-dev) and libpng16-dev distrib packages can be used on debian/ubuntu.
To compile, just clone and launch cmake:
@ -54,7 +54,17 @@ make
make install
```
On Windows system, you will probably need to specify the dependency flags for CMake. Ex:
On Windows system, I can suggest you to use Conan support to help you with dependencies:
```shell
mkdir build
cd build
conan install .. --build=libpng --build=zlib
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.11/include" -D"ZLIB_LIBRARY=zlib/1.2.11/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"`

14
conanfile.txt Normal file
View File

@ -0,0 +1,14 @@
[requires]
zlib/1.2.11
libpng/1.6.37
[generators]
cmake
cmake_find_package
[options]
zlib:shared=True
libpng:shared=True
[imports]
bin, *.dll -> ./bin