diff --git a/CMakeLists.txt b/CMakeLists.txt index 1328491d3..219c20461 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ endif() list( APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ) include( FindPackageHandleStandardArgs ) +include(FindPkgConfig) # Produce a warning if XP support will be missing when building a 32 bit target for MSVC. if( MSVC ) @@ -320,7 +321,7 @@ else() set( GME_LIBRARIES gme ) endif() -set( LZMA_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lzma/C" ) +pkg_check_modules(LZMA REQUIRED clzma) if( NOT CMAKE_CROSSCOMPILING ) if( NOT CROSS_EXPORTS ) @@ -338,7 +339,6 @@ install(DIRECTORY docs/ DESTINATION ${INSTALL_DOCS_PATH} COMPONENT "Documentation") -add_subdirectory( lzma ) add_subdirectory( tools ) add_subdirectory( dumb ) add_subdirectory( gdtoa ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 993952e8d..ea222f12a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -460,7 +460,7 @@ add_custom_target( revision_check ALL message( STATUS "Fluid synth libs: ${FLUIDSYNTH_LIBRARIES}" ) set( ZDOOM_LIBS ${ZDOOM_LIBS} "${ZLIB_LIBRARIES}" "${JPEG_LIBRARIES}" "${BZIP2_LIBRARIES}" "${GME_LIBRARIES}" "${CMAKE_DL_LIBS}" ) -include_directories( "${ZLIB_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GME_INCLUDE_DIR}" ) +include_directories( "${ZLIB_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIRS}" "${JPEG_INCLUDE_DIR}" "${GME_INCLUDE_DIR}" ) if( SNDFILE_FOUND ) set( ZDOOM_LIBS ${ZDOOM_LIBS} "${SNDFILE_LIBRARIES}" ) @@ -1285,7 +1285,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") set( ZDOOM_LIBS ${ZDOOM_LIBS} nsl socket) endif() -target_link_libraries( zdoom ${ZDOOM_LIBS} gdtoa dumb lzma ) +target_link_libraries( zdoom ${ZDOOM_LIBS} gdtoa dumb ${LZMA_LIBRARIES}) include_directories( . g_statusbar diff --git a/tools/zipdir/CMakeLists.txt b/tools/zipdir/CMakeLists.txt index 6a36b2cb5..75cadf47e 100644 --- a/tools/zipdir/CMakeLists.txt +++ b/tools/zipdir/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required( VERSION 2.8.7 ) if( NOT CMAKE_CROSSCOMPILING ) - include_directories( "${ZLIB_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" ) + include_directories( "${ZLIB_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIRS}" ) add_executable( zipdir zipdir.c ) - target_link_libraries( zipdir ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} lzma ) + target_link_libraries( zipdir ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} ${LZMA_LDFLAGS}) set( CROSS_EXPORTS ${CROSS_EXPORTS} zipdir PARENT_SCOPE ) endif()