Move the pkg_config_library macro to its own file

The pkg_config_library macro is a helper macro and was generating noise
on the main CMakeLists.txt file, so I moved it to another file.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-04-07 16:53:28 -03:00 committed by Dirk Hohndel
parent e56580229b
commit 057231701e
2 changed files with 8 additions and 9 deletions

View file

@ -17,16 +17,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX)
endif()
# pkgconfig for required libraries
FIND_PACKAGE(PkgConfig)
MACRO(pkg_config_library LIBNAME pcfile)
pkg_check_modules(${LIBNAME} REQUIRED ${pcfile})
include_directories(${${LIBNAME}_INCLUDE_DIRS})
link_directories(${${LIBNAME}_LIBRARY_DIRS})
add_definitions(${${LIBNAME}_CFLAGS_OTHER})
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${${LIBNAME}_LIBRARIES})
ENDMACRO()
INCLUDE(cmake/Modules/pkgconfig_helper.cmake)
pkg_config_library(LIBXML libxml-2.0)
pkg_config_library(LIBSQLITE3 sqlite3)

View file

@ -0,0 +1,7 @@
MACRO(pkg_config_library LIBNAME pcfile)
pkg_check_modules(${LIBNAME} REQUIRED ${pcfile})
include_directories(${${LIBNAME}_INCLUDE_DIRS})
link_directories(${${LIBNAME}_LIBRARY_DIRS})
add_definitions(${${LIBNAME}_CFLAGS_OTHER})
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${${LIBNAME}_LIBRARIES})
ENDMACRO()