Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Frida
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
Frida
Commits
72e5a09c
Commit
72e5a09c
authored
6 years ago
by
Coenen, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
added FindLibyaml.cmake
parent
56909097
No related branches found
No related tags found
1 merge request
!2
Replace yaml cpp with libyaml
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pub/CMakeLists.txt
+1
-0
1 addition, 0 deletions
pub/CMakeLists.txt
pub/cmake/modules/FindLibyaml.cmake
+91
-0
91 additions, 0 deletions
pub/cmake/modules/FindLibyaml.cmake
with
92 additions
and
0 deletions
pub/CMakeLists.txt
+
1
−
0
View file @
72e5a09c
...
...
@@ -39,6 +39,7 @@ find_package(Readline REQUIRED)
find_package
(
GSL REQUIRED
)
find_package
(
FFTW_DBL REQUIRED
)
find_package
(
YamlCpp05 REQUIRED
)
find_package
(
Libyaml REQUIRED
)
find_package
(
KWW REQUIRED
)
find_package
(
Cerf REQUIRED
)
# currently we only accept the C version of the library
find_package
(
LMFit REQUIRED
)
...
...
This diff is collapsed.
Click to expand it.
pub/cmake/modules/FindLibyaml.cmake
0 → 100644
+
91
−
0
View file @
72e5a09c
# Find libyaml with API version ?.?
#
# Usage:
# find_package(libyaml [REQUIRED] [QUIET])
#
# Sets the following variables:
# - LIBYAML_FOUND .. true if library is found
# - LIBYAML_LIBRARIES .. full path to library
# - LIBYAML_INCLUDE_DIR .. full path to include directory
#
# Honors the following optional variables:
# - LIBYAML_INCLUDE_LOC .. include directory path, to be searched before defaults
# - LIBYAML_LIBRARY_LOC .. the library's directory path, to be searched before defaults
# - LIBYAML_STATIC_LIBRARY .. if true, find the static library version
#
# Copyright 2015 Joachim Wuttke, Forschungszentrum Jülich.
# Redistribution permitted.
include
(
CheckCppIncludeFile
)
include
(
CheckCXXSourceRuns
)
# find the yaml-cpp include directory
find_path
(
LIBYAML_INCLUDE_DIR yaml/yaml.h
PATH_SUFFIXES include yaml/include yaml
PATHS
${
LIBYAML_INCLUDE_LOC
}
~/Library/Frameworks/
/Library/Frameworks/
/usr/local/
/usr/
/sw/
# Fink
/opt/local/
# DarwinPorts
/opt/csw/
# Blastwave
/opt/
)
set
(
CMAKE_REQUIRED_INCLUDES
${
LIBYAML_INCLUDE_DIR
}
)
set
(
CMAKE_REQUIRED_QUIET True
)
# detect version (see comment by sanssecours at https://github.com/jbeder/yaml-cpp/issues/604)
#find_package (PkgConfig)
#pkg_check_modules (PC_YAML-CPP QUIET yaml-cpp)
#set (YAML-CPP_VERSION ${PC_YAML-CPP_VERSION})
#if (YAML-CPP_VERSION VERSION_LESS "0.5.0")
# message(FATAL_ERROR "Found YAMLCPP version ${YAML-CPP_VERSION}; needs at least 0.5.0")
#endif()
# now look for needed yaml-cpp0.5 include files
#unset(YAMLCPP_FOUND_05 CACHE)
#check_include_file("yaml-cpp/node/detail/iterator_fwd.h" YAMLCPP_FOUND_05)
#if(${YAMLCPP_FOUND_05})
#else()
# message(FATAL_ERROR "Include file for libyaml-cpp0.5 not found")
#endif()
# attempt to find static library first if this is set
if
(
LIBYAML_STATIC_LIBRARY
)
set
(
LIBYAML_STATIC libyaml.a
)
endif
()
# find the libyaml library
find_library
(
LIBYAML_LIBRARY
NAMES
${
LIBYAML_STATIC
}
yaml
PATH_SUFFIXES lib64 lib
PATHS
${
LIBYAML_LIBRARY_LOC
}
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt
)
message
(
STATUS
"libyaml: FOUND=
${
LIBYAML_FOUND
}
, VERSION=
${
LIBYAML_VERSION
}
, LIB=
${
LIBYAML_LIBRARY
}
"
)
# try to compile, link, and run a test program
# --- outcommented because of bug in yamlcpp-0.5 [https://stackoverflow.com/questions/53234192]
# unset(YAMLCPP_RUNS CACHE)
# set(CMAKE_REQUIRED_LIBRARIES yaml-cpp)
# check_cxx_source_runs("#include \"yaml-cpp/yaml.h\"\n#include <assert.h>\nint main() {\n YAML::Node node = YAML::Load(\"[1, 2, 3]\");\n assert(node.IsSequence());\n}" YAMLCPP_RUNS)
# if(${YAMLCPP_RUNS})
# else()
# message(FATAL_ERROR "Test of libyaml-cpp failed")
# endif()
message
(
STATUS
"Found FindLibyaml:
${
LIBYAML_LIBRARY
}
"
)
mark_as_advanced
(
LIBYAML_INCLUDE_DIR LIBYAML_LIBRARY
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment