From 6efece51f99980b824b199bbeb6452f03e6736c6 Mon Sep 17 00:00:00 2001 From: Dmitry Zhulanov Date: Tue, 27 Sep 2016 00:23:14 +0700 Subject: add x-verbs support (bzr r15136.1.1) --- CMakeScripts/DefineDependsandFlags.cmake | 4 +++ CMakeScripts/Modules/Findyaml.cmake | 53 ++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 CMakeScripts/Modules/Findyaml.cmake (limited to 'CMakeScripts') diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index e3bc9258e..726e5d5db 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -387,6 +387,10 @@ list(APPEND INKSCAPE_LIBS ${SIGC++_LDFLAGS}) list(APPEND INKSCAPE_CXX_FLAGS ${SIGC++_CFLAGS_OTHER}) +find_package(yaml REQUIRED) +list(APPEND INKSCAPE_INCS_SYS ${YAML_INCLUDE_DIRS}) +list(APPEND INKSCAPE_LIBS ${YAML_LIBRARIES}) + list(REMOVE_DUPLICATES INKSCAPE_CXX_FLAGS) foreach(flag ${INKSCAPE_CXX_FLAGS}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}" CACHE STRING "" FORCE) diff --git a/CMakeScripts/Modules/Findyaml.cmake b/CMakeScripts/Modules/Findyaml.cmake new file mode 100644 index 000000000..0324c6b83 --- /dev/null +++ b/CMakeScripts/Modules/Findyaml.cmake @@ -0,0 +1,53 @@ +# - Try to find the YAML library +# Once done this will define +# +# YAML_FOUND - system has yaml +# YAML_INCLUDE_DIR - the yaml include directory +# YAML_LIBRARIES - the libraries needed to use yaml + +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (YAML_INCLUDE_DIR AND YAML_LIBRARIES) + + # in cache already + SET(YAML_FOUND TRUE) + +else (YAML_INCLUDE_DIR AND YAML_LIBRARIES) + + IF (NOT WIN32) + FIND_PACKAGE(PkgConfig) + IF (PKG_CONFIG_FOUND) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + pkg_check_modules(_YAML_PC QUIET yaml-1) + ENDIF (PKG_CONFIG_FOUND) + ENDIF (NOT WIN32) + + FIND_PATH(YAML_INCLUDE_DIR yaml123.h + /usr/include + /usr/local/include + ) + + FIND_LIBRARY(YAML_LIBRARIES NAMES yaml + PATHS + ) + + if (YAML_INCLUDE_DIR AND YAML_LIBRARIES) + set(YAML_FOUND TRUE) + endif (YAML_INCLUDE_DIR AND YAML_LIBRARIES) + + + if (YAML_FOUND) + if (NOT YAML_FIND_QUIETLY) + message(STATUS "Found YAML: ${YAML_LIBRARIES}") + endif (NOT YAML_FIND_QUIETLY) + else (YAML_FOUND) + if (YAML_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find YAML") + endif (YAML_FIND_REQUIRED) + endif (YAML_FOUND) + + MARK_AS_ADVANCED(YAML_INCLUDE_DIR YAML_LIBRARIES) + +endif (YAML_INCLUDE_DIR AND YAML_LIBRARIES) -- cgit v1.2.3 From 81364db0bc98b01319dc5ecb835a4e37b906bad2 Mon Sep 17 00:00:00 2001 From: Dmitry Zhulanov Date: Sat, 1 Oct 2016 13:05:10 +0700 Subject: disable xverb feature if WITH_YAML defined (bzr r15136.1.9) --- CMakeScripts/DefineDependsandFlags.cmake | 13 ++++++++++--- CMakeScripts/Modules/Findyaml.cmake | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'CMakeScripts') diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index 726e5d5db..daf5afd90 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -387,9 +387,16 @@ list(APPEND INKSCAPE_LIBS ${SIGC++_LDFLAGS}) list(APPEND INKSCAPE_CXX_FLAGS ${SIGC++_CFLAGS_OTHER}) -find_package(yaml REQUIRED) -list(APPEND INKSCAPE_INCS_SYS ${YAML_INCLUDE_DIRS}) -list(APPEND INKSCAPE_LIBS ${YAML_LIBRARIES}) +find_package(yaml) +if(YAML_FOUND) + set (WITH_YAML ON) + list(APPEND INKSCAPE_INCS_SYS ${YAML_INCLUDE_DIRS}) + list(APPEND INKSCAPE_LIBS ${YAML_LIBRARIES}) + add_definitions(-DWITH_YAML) +else(YAML_FOUND) + unset(WITH_YAML OFF) + message(STATUS "Could not locate the yaml library headers: xverb feature will be disabled") +endif() list(REMOVE_DUPLICATES INKSCAPE_CXX_FLAGS) foreach(flag ${INKSCAPE_CXX_FLAGS}) diff --git a/CMakeScripts/Modules/Findyaml.cmake b/CMakeScripts/Modules/Findyaml.cmake index 0324c6b83..d3f00cd13 100644 --- a/CMakeScripts/Modules/Findyaml.cmake +++ b/CMakeScripts/Modules/Findyaml.cmake @@ -24,7 +24,7 @@ else (YAML_INCLUDE_DIR AND YAML_LIBRARIES) ENDIF (PKG_CONFIG_FOUND) ENDIF (NOT WIN32) - FIND_PATH(YAML_INCLUDE_DIR yaml123.h + FIND_PATH(YAML_INCLUDE_DIR yaml.h /usr/include /usr/local/include ) -- cgit v1.2.3 From 017616c4fc99883323c2a0d6e44b88f7cd16ce2d Mon Sep 17 00:00:00 2001 From: Dmitry Zhulanov Date: Sat, 1 Oct 2016 17:08:49 +0700 Subject: fix cmake warning and remove whole xverbs code from compilation without yaml (bzr r15136.1.11) --- CMakeScripts/DefineDependsandFlags.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeScripts') diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index daf5afd90..ad2d51724 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -394,7 +394,7 @@ if(YAML_FOUND) list(APPEND INKSCAPE_LIBS ${YAML_LIBRARIES}) add_definitions(-DWITH_YAML) else(YAML_FOUND) - unset(WITH_YAML OFF) + set(WITH_YAML OFF) message(STATUS "Could not locate the yaml library headers: xverb feature will be disabled") endif() -- cgit v1.2.3 From f9a55c6269f20bfe98e1eeb0dd07f5bb3036b7ab Mon Sep 17 00:00:00 2001 From: Dmitry Zhulanov Date: Mon, 3 Oct 2016 22:19:23 +0700 Subject: beautify idents (bzr r15136.1.14) --- CMakeScripts/Modules/Findyaml.cmake | 74 ++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 39 deletions(-) (limited to 'CMakeScripts') diff --git a/CMakeScripts/Modules/Findyaml.cmake b/CMakeScripts/Modules/Findyaml.cmake index d3f00cd13..154f2ed43 100644 --- a/CMakeScripts/Modules/Findyaml.cmake +++ b/CMakeScripts/Modules/Findyaml.cmake @@ -9,45 +9,41 @@ # For details see the accompanying COPYING-CMAKE-SCRIPTS file. if (YAML_INCLUDE_DIR AND YAML_LIBRARIES) - - # in cache already - SET(YAML_FOUND TRUE) - + # in cache already + SET(YAML_FOUND TRUE) else (YAML_INCLUDE_DIR AND YAML_LIBRARIES) - - IF (NOT WIN32) - FIND_PACKAGE(PkgConfig) - IF (PKG_CONFIG_FOUND) - # use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - pkg_check_modules(_YAML_PC QUIET yaml-1) - ENDIF (PKG_CONFIG_FOUND) - ENDIF (NOT WIN32) - - FIND_PATH(YAML_INCLUDE_DIR yaml.h - /usr/include - /usr/local/include - ) - - FIND_LIBRARY(YAML_LIBRARIES NAMES yaml - PATHS - ) - - if (YAML_INCLUDE_DIR AND YAML_LIBRARIES) - set(YAML_FOUND TRUE) - endif (YAML_INCLUDE_DIR AND YAML_LIBRARIES) - - - if (YAML_FOUND) - if (NOT YAML_FIND_QUIETLY) - message(STATUS "Found YAML: ${YAML_LIBRARIES}") - endif (NOT YAML_FIND_QUIETLY) - else (YAML_FOUND) - if (YAML_FIND_REQUIRED) - message(FATAL_ERROR "Could NOT find YAML") - endif (YAML_FIND_REQUIRED) - endif (YAML_FOUND) - - MARK_AS_ADVANCED(YAML_INCLUDE_DIR YAML_LIBRARIES) + IF (NOT WIN32) + FIND_PACKAGE(PkgConfig) + IF (PKG_CONFIG_FOUND) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + pkg_check_modules(_YAML_PC QUIET yaml-1) + ENDIF (PKG_CONFIG_FOUND) + ENDIF (NOT WIN32) + + FIND_PATH(YAML_INCLUDE_DIR yaml.h + /usr/include + /usr/local/include + ) + + FIND_LIBRARY(YAML_LIBRARIES NAMES yaml + PATHS) + + if (YAML_INCLUDE_DIR AND YAML_LIBRARIES) + set(YAML_FOUND TRUE) + endif (YAML_INCLUDE_DIR AND YAML_LIBRARIES) + + + if (YAML_FOUND) + if (NOT YAML_FIND_QUIETLY) + message(STATUS "Found YAML: ${YAML_LIBRARIES}") + endif (NOT YAML_FIND_QUIETLY) + else (YAML_FOUND) + if (YAML_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find YAML") + endif (YAML_FIND_REQUIRED) + endif (YAML_FOUND) + + MARK_AS_ADVANCED(YAML_INCLUDE_DIR YAML_LIBRARIES) endif (YAML_INCLUDE_DIR AND YAML_LIBRARIES) -- cgit v1.2.3