2010-11-12 00:51:46 +08:00
|
|
|
#use pkg-config to find various modues
|
2020-03-23 06:46:50 +08:00
|
|
|
find_package(PkgConfig QUIET)
|
2010-11-12 00:51:46 +08:00
|
|
|
|
|
|
|
IF(PKG_CONFIG_FOUND)
|
|
|
|
PKG_CHECK_MODULES(CAIRO cairo)
|
|
|
|
PKG_CHECK_MODULES(POPPLER poppler-glib)
|
|
|
|
|
|
|
|
IF (POPPLER_FOUND)
|
|
|
|
|
|
|
|
INCLUDE(CheckCXXSourceRuns)
|
|
|
|
|
|
|
|
SET(CMAKE_REQUIRED_INCLUDES ${POPPLER_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
# Do step by step checking,
|
|
|
|
CHECK_CXX_SOURCE_RUNS("
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <poppler.h>
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
#ifdef POPPLER_HAS_CAIRO
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
#else
|
|
|
|
return EXIT_FAILURE
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
" POPPLER_HAS_CAIRO)
|
|
|
|
|
|
|
|
IF (NOT POPPLER_HAS_CAIRO)
|
|
|
|
SET(POPPLER_FOUND FALSE)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
# IF (POPPLER_FOUND AND (NOT POPPLER_LIBRARIES OR NOT POPPLER_INCLUDE_DIRS) )
|
|
|
|
# SET(POPPLER_FOUND FALSE)
|
|
|
|
# ENDIF()
|
|
|
|
|
|
|
|
ENDIF()
|