diff --git a/CMakeLists.txt b/CMakeLists.txt index d004451..b850dfd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/README.md b/README.md index 91825d8..9e75a83 100644 --- a/README.md +++ b/README.md @@ -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"` diff --git a/conanfile.txt b/conanfile.txt new file mode 100644 index 0000000..1337f71 --- /dev/null +++ b/conanfile.txt @@ -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 \ No newline at end of file