Add libmagic wrapper

Also builds separate static library linuxdeploy_util providing old util
header and new magic wrapper.
This commit is contained in:
TheAssassin
2018-06-03 02:09:24 +02:00
parent b64270c37b
commit 22df875849
7 changed files with 116 additions and 2 deletions

View File

@@ -7,8 +7,11 @@ file(GLOB HEADERS ${PROJECT_SOURCE_DIR}/include/linuxdeploy/core/*.h)
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED COMPONENTS filesystem regex)
find_package(Threads)
find_package(LibMagic)
find_package(PkgConfig)
pkg_check_modules(magick++ REQUIRED IMPORTED_TARGET Magick++)
@@ -19,9 +22,8 @@ execute_process(
)
add_library(linuxdeploy_core STATIC elf.cpp log.cpp appdir.cpp desktopfile.cpp ${HEADERS})
target_link_libraries(linuxdeploy_core PUBLIC Boost::filesystem Boost::regex subprocess cpp-feather-ini-parser PkgConfig::magick++ ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(linuxdeploy_core PUBLIC linuxdeploy_util Boost::filesystem Boost::regex subprocess cpp-feather-ini-parser PkgConfig::magick++ libmagic_static ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(linuxdeploy_core PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(linuxdeploy_core PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../util)
target_include_directories(linuxdeploy_core PUBLIC ${PROJECT_SOURCE_DIR}/include)
target_compile_definitions(linuxdeploy_core PUBLIC -DBOOST_NO_CXX11_SCOPED_ENUMS)