use pkg-config if not windows

This commit is contained in:
Martin Brodbeck 2018-08-10 10:18:26 +02:00
parent 01a2a5e0e0
commit e0e0f641e2
2 changed files with 16 additions and 8 deletions

View File

@ -2,11 +2,14 @@ set(Boost_USE_STATIC_LIBS ON)
find_package(Boost 1.62 COMPONENTS date_time REQUIRED)
find_package(SQLite3 REQUIRED)
#find_package(PkgConfig REQUIRED)
find_package(XLNT REQUIRED STATIC)
find_package(JSONCPP REQUIRED)
#pkg_check_modules(XLNT REQUIRED xlnt>=1.3)
#pkg_check_modules(JSONCPP REQUIRED jsoncpp)
if (MINGW)
find_package(XLNT REQUIRED STATIC)
find_package(JSONCPP REQUIRED)
else (MINGW)
find_package(PkgConfig REQUIRED)
pkg_check_modules(XLNT REQUIRED xlnt>=1.3)
pkg_check_modules(JSONCPP REQUIRED jsoncpp)
endif (MINGW)
set(CORE_SOURCES
database.cpp
@ -25,4 +28,4 @@ target_link_libraries(core Boost::boost Boost::date_time sqlite3 ${XLNT_LIBRARY}
if (WIN32)
target_link_libraries(core bcrypt)
endif()
target_include_directories(core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

View File

@ -2,7 +2,12 @@ set(Boost_USE_STATIC_LIBS ON)
find_package(Boost 1.62 REQUIRED)
find_package(LibUSB REQUIRED)
if (MINGW)
find_package(LibUSB REQUIRED)
else (MINGW)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBUSB REQUIRED libusb-1.0)
endif (MINGW)
set(PRINTER_SOURCES
posprinter.cpp
@ -10,4 +15,4 @@ set(PRINTER_SOURCES
add_library(printer STATIC ${PRINTER_SOURCES})
target_link_libraries(printer core ${LIBUSB_1_LIBRARIES})
target_include_directories(printer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(printer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})