Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
obs-studio
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yunxiang Li
obs-studio
Commits
2cc24dcc
Commit
2cc24dcc
authored
10 years ago
by
BtbN
Browse files
Options
Downloads
Patches
Plain Diff
Add support for external jansson
parent
6ff79c38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmake/Modules/FindJansson.cmake
+63
-0
63 additions, 0 deletions
cmake/Modules/FindJansson.cmake
deps/CMakeLists.txt
+14
-1
14 additions, 1 deletion
deps/CMakeLists.txt
with
77 additions
and
1 deletion
cmake/Modules/FindJansson.cmake
0 → 100644
+
63
−
0
View file @
2cc24dcc
# Once done these will be defined:
#
# JANSSON_FOUND
# JANSSON_INCLUDE_DIRS
# JANSSON_LIBRARIES
# JANSSON_VERSION
#
if
(
JANSSON_INCLUDE_DIRS AND JANSSON_LIBRARIES
)
set
(
JANSSON_FOUND TRUE
)
else
()
find_package
(
PkgConfig QUIET
)
if
(
PKG_CONFIG_FOUND
)
pkg_check_modules
(
_JANSSON QUIET jansson
)
endif
()
if
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
set
(
_lib_suffix 64
)
else
()
set
(
_lib_suffix 32
)
endif
()
find_path
(
Jansson_INCLUDE_DIR
NAMES jansson.h
HINTS
ENV JanssonPath
${
_JANSSON_INCLUDE_DIRS
}
/usr/include /usr/local/include /opt/local/include /sw/include
)
find_library
(
Jansson_LIB
NAMES jansson libjansson
HINTS
${
Jansson_INCLUDE_DIR
}
/../lib
${
Jansson_INCLUDE_DIR
}
/lib
${
_lib_suffix
}
${
_JANSSON_LIBRARY_DIRS
}
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
)
if
(
JANSSON_VERSION
)
set
(
_JANSSON_VERSION_STRING
"
${
JANSSON_VERSION
}
"
)
elseif
(
_JANSSON_FOUND AND _JANSSON_VERSION
)
set
(
_JANSSON_VERSION_STRING
"
${
_JANSSON_VERSION
}
"
)
elseif
(
EXISTS
"
${
Jansson_INCLUDE_DIR
}
/jansson.h"
)
file
(
STRINGS
"
${
Jansson_INCLUDE_DIR
}
/jansson.h"
_jansson_version_parse
REGEX
"#define[
\t
]+JANSSON_VERSION[
\t
]+.+"
)
string
(
REGEX REPLACE
".*#define[
\t
]+JANSSON_VERSION[
\t
]+
\"
(.+)
\"
.*"
"
\\
1"
_JANSSON_VERSION_STRING
"
${
_jansson_version_parse
}
"
)
else
()
message
(
WARNING
"Failed to find Jansson version"
)
set
(
_JANSSON_VERSION_STRING
"unknown"
)
endif
()
set
(
JANSSON_INCLUDE_DIRS
${
Jansson_INCLUDE_DIR
}
CACHE PATH
"Jansson include dir"
)
set
(
JANSSON_LIBRARIES
${
Jansson_LIB
}
CACHE STRING
"Jansson libraries"
)
set
(
JANSSON_VERSION
"
${
_JANSSON_VERSION_STRING
}
"
CACHE STRING
"Jansson version"
)
find_package_handle_standard_args
(
Jansson
FOUND_VAR JANSSON_FOUND
REQUIRED_VARS Jansson_LIB Jansson_INCLUDE_DIR
VERSION_VAR JANSSON_VERSION
)
mark_as_advanced
(
Jansson_INCLUDE_DIR Jansson_LIB
)
endif
()
This diff is collapsed.
Click to expand it.
deps/CMakeLists.txt
+
14
−
1
View file @
2cc24dcc
add_subdirectory
(
w32-pthreads
)
add_subdirectory
(
w32-pthreads
)
add_subdirectory
(
glad
)
add_subdirectory
(
glad
)
add_subdirectory
(
jansson
)
find_package
(
Jansson 2.5 QUIET
)
if
(
NOT JANSSON_FOUND
)
message
(
STATUS
"Jansson >=2.5 not found, building bundled version"
)
add_subdirectory
(
jansson
)
else
()
message
(
STATUS
"Using system Jansson library"
)
add_library
(
jansson UNKNOWN IMPORTED
)
set_property
(
TARGET jansson PROPERTY
IMPORTED_LOCATION
"
${
JANSSON_LIBRARIES
}
"
INTERFACE_INCLUDE_DIRECTORIES
"
${
JANSSON_INCLUDE_DIRS
}
"
)
endif
()
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