Added libpng to linux setup.

This commit is contained in:
Axel 2020-09-03 15:28:16 +02:00 committed by Marc Garcia Puig
parent 787e3bc5c2
commit 15f93a6862
2 changed files with 45 additions and 2 deletions

View File

@ -75,6 +75,11 @@ if (WIN32)
# Install zlib lib.
file(GLOB libpng_libraries "${LIBPNG_LIB_PATH}/*")
install(FILES ${libpng_libraries} DESTINATION lib)
else ()
# Install libpng library
install(DIRECTORY "${LIBPNG_INCLUDE_PATH}" DESTINATION include/system)
file(GLOB libcarla_carla_libpnglib "${LIBPNG_LIB_PATH}/*.*")
install(FILES ${libcarla_carla_libpnglib} DESTINATION lib)
endif (WIN32)
# Add sources.
@ -257,7 +262,8 @@ if (LIBCARLA_BUILD_RELEASE)
target_include_directories(carla_client${carla_target_postfix} SYSTEM PRIVATE
"${BOOST_INCLUDE_PATH}"
"${RPCLIB_INCLUDE_PATH}"
"${RECAST_INCLUDE_PATH}")
"${RECAST_INCLUDE_PATH}"
"${LIBPNG_INCLUDE_PATH}")
if (BUILD_RSS_VARIANT)
target_compile_definitions(carla_client${carla_target_postfix} PRIVATE RSS_ENABLED RSS_USE_TBB)
@ -296,7 +302,8 @@ if (LIBCARLA_BUILD_DEBUG)
target_include_directories(carla_client${carla_target_postfix}_debug SYSTEM PRIVATE
"${BOOST_INCLUDE_PATH}"
"${RPCLIB_INCLUDE_PATH}"
"${RECAST_INCLUDE_PATH}")
"${RECAST_INCLUDE_PATH}"
"${LIBPNG_INCLUDE_PATH}")
if (BUILD_RSS_VARIANT)
target_compile_definitions(carla_client${carla_target_postfix}_debug PRIVATE RSS_ENABLED RSS_USE_TBB)

View File

@ -399,6 +399,40 @@ fi
unset RECAST_BASENAME
# ==============================================================================
# -- Get and compile libpng 1.6.37 ------------------------------
# ==============================================================================
LIBPNG_VERSION=1.6.37
LIBPNG_REPO=https://sourceforge.net/projects/libpng/files/libpng16/${LIBPNG_VERSION}/libpng-${LIBPNG_VERSION}.tar.xz
LIBPNG_BASENAME=libpng-${LIBPNG_VERSION}
LIBPNG_INSTALL=${LIBPNG_BASENAME}-install
LIBPNG_INCLUDE=${PWD}/${LIBPNG_BASENAME}-install/include/libpng16
LIBPNG_LIBPATH=${PWD}/${LIBPNG_BASENAME}-install/lib
if [[ -d ${LIBPNG_INSTALL} ]] ; then
log "Libpng already installed."
else
log "Retrieving libpng."
wget ${LIBPNG_REPO}
log "Extracting libpng."
tar -xf libpng-${LIBPNG_VERSION}.tar.xz
mv ${LIBPNG_BASENAME} ${LIBPNG_BASENAME}-source
pushd ${LIBPNG_BASENAME}-source >/dev/null
./configure --prefix=${CARLA_BUILD_FOLDER}/${LIBPNG_INSTALL}
make install
popd >/dev/null
rm -Rf libpng-${LIBPNG_VERSION}.tar.xz
rm -Rf ${LIBPNG_BASENAME}-source
fi
# ==============================================================================
# -- Generate Version.h --------------------------------------------------------
# ==============================================================================
@ -495,6 +529,8 @@ elseif (CMAKE_BUILD_TYPE STREQUAL "Client")
set(BOOST_LIB_PATH "${BOOST_LIBPATH}")
set(RECAST_INCLUDE_PATH "${RECAST_INCLUDE}")
set(RECAST_LIB_PATH "${RECAST_LIBPATH}")
set(LIBPNG_INCLUDE_PATH "${LIBPNG_INCLUDE}")
set(LIBPNG_LIB_PATH "${LIBPNG_LIBPATH}")
endif ()
EOL