Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c5a46d0634a5
Choose a base ref
...
head repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2d2c6ee4e408
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Nov 6, 2020

  1. Copy the full SHA
    56099d6 View commit details
  2. Verified

    This commit was signed with the committer’s verified signature.
    Copy the full SHA
    755ec5b View commit details
  3. Merge pull request #279 from azonenberg/fix-yaml

    Add detection for yaml-cpp, fixes #140
    azonenberg authored Nov 6, 2020
    Copy the full SHA
    2d2c6ee View commit details
Showing with 104 additions and 2 deletions.
  1. +101 −0 cmake/FindYaml.cmake
  2. +3 −2 src/glscopeclient/CMakeLists.txt
101 changes: 101 additions & 0 deletions cmake/FindYaml.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@

#--------------------------------------------------------------------------------
# Copyright (c) 2012-2013, Lars Baehren <lbaehren@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#--------------------------------------------------------------------------------

# - Check for the presence of YAML
#
# The following variables are set when YAML is found:
# YAML_FOUND = Set to true, if all components of YAML have been found.
# YAML_INCLUDES = Include path for the header files of YAML
# YAML_LIBRARIES = Link these to use YAML
# YAML_LFLAGS = Linker flags (optional)

if (NOT YAML_FOUND)

if (NOT YAML_ROOT_DIR)
set (YAML_ROOT_DIR ${CMAKE_INSTALL_PREFIX})
endif (NOT YAML_ROOT_DIR)

##_____________________________________________________________________________
## Check for the header files

find_path (YAML_INCLUDES yaml-cpp/yaml.h yaml-cpp/node.h
HINTS ${YAML_ROOT_DIR} ${CMAKE_INSTALL_PREFIX}
PATH_SUFFIXES include
)

##_____________________________________________________________________________
## Check for the library

find_library (YAML_LIBRARIES yaml-cpp
HINTS ${YAML_ROOT_DIR} ${CMAKE_INSTALL_PREFIX}
PATH_SUFFIXES lib
)

##_____________________________________________________________________________
## Actions taken when all components have been found

find_package_handle_standard_args (YAML DEFAULT_MSG YAML_LIBRARIES YAML_INCLUDES)

if (YAML_INCLUDES AND YAML_LIBRARIES)
set (YAML_FOUND TRUE)
else (YAML_INCLUDES AND YAML_LIBRARIES)
set (YAML_FOUND FALSE)
if (NOT YAML_FIND_QUIETLY)
if (NOT YAML_INCLUDES)
message (STATUS "Unable to find YAML header files!")
endif (NOT YAML_INCLUDES)
if (NOT YAML_LIBRARIES)
message (STATUS "Unable to find YAML library files!")
endif (NOT YAML_LIBRARIES)
endif (NOT YAML_FIND_QUIETLY)
endif (YAML_INCLUDES AND YAML_LIBRARIES)

if (YAML_FOUND)
if (NOT YAML_FIND_QUIETLY)
message (STATUS "Found components for YAML")
message (STATUS "YAML_ROOT_DIR = ${YAML_ROOT_DIR}")
message (STATUS "YAML_INCLUDES = ${YAML_INCLUDES}")
message (STATUS "YAML_LIBRARIES = ${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)

## Compatibility setting
set (YAML_CPP_FOUND ${YAML_FOUND})

##_____________________________________________________________________________
## Mark advanced variables

mark_as_advanced (
YAML_ROOT_DIR
YAML_INCLUDES
YAML_LIBRARIES
)

endif (NOT YAML_FOUND)
5 changes: 3 additions & 2 deletions src/glscopeclient/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ endif()
# GLEW and OpenGL are required
find_package(GLEW REQUIRED)
find_package(OpenGL REQUIRED)
find_package(Yaml REQUIRED)

# Git is used for git-describe based version generation if we have it
find_package(Git)
@@ -19,7 +20,7 @@ if(WIN32)
endif()

#Set up include paths
include_directories(${GTKMM_INCLUDE_DIRS} ${SIGCXX_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS})
include_directories(${GTKMM_INCLUDE_DIRS} ${SIGCXX_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS} ${YAML_INCLUDES})
link_directories(${GTKMM_LIBRARY_DIRS} ${SIGCXX_LIBRARY_DIRS})

#Set up versioning (with a dummy string for now if Git isn't present)
@@ -84,7 +85,7 @@ target_link_libraries(glscopeclient
${OPENGL_LIBRARY}
${WIN_LIBS}
${GLEW_LIBRARIES}
yaml-cpp
${YAML_LIBRARIES}
)

###############################################################################