Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cJSON
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
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
phoenix
public
cJSON
Commits
61eb84d9
Unverified
Commit
61eb84d9
authored
3 years ago
by
Andy
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add an option for ENABLE_CJSON_VERSION_SO in CMakeLists.txt (#534)
Co-authored-by:
m00209177
<
malihu@huawei.com
>
parent
d321fa9e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+13
-8
13 additions, 8 deletions
CMakeLists.txt
README.md
+1
-0
1 addition, 0 deletions
README.md
with
14 additions
and
8 deletions
CMakeLists.txt
+
13
−
8
View file @
61eb84d9
...
...
@@ -121,6 +121,7 @@ set(SOURCES cJSON.c)
option
(
BUILD_SHARED_AND_STATIC_LIBS
"Build both shared and static libraries"
Off
)
option
(
CJSON_OVERRIDE_BUILD_SHARED_LIBS
"Override BUILD_SHARED_LIBS with CJSON_BUILD_SHARED_LIBS"
OFF
)
option
(
CJSON_BUILD_SHARED_LIBS
"Overrides BUILD_SHARED_LIBS if CJSON_OVERRIDE_BUILD_SHARED_LIBS is enabled"
ON
)
option
(
ENABLE_CJSON_VERSION_SO
"Enables cJSON so version"
ON
)
if
((
CJSON_OVERRIDE_BUILD_SHARED_LIBS AND CJSON_BUILD_SHARED_LIBS
)
OR
((
NOT CJSON_OVERRIDE_BUILD_SHARED_LIBS
)
AND BUILD_SHARED_LIBS
))
set
(
CJSON_LIBRARY_TYPE SHARED
)
...
...
@@ -162,10 +163,12 @@ if(ENABLE_TARGET_EXPORT)
install
(
EXPORT
"
${
CJSON_LIB
}
"
DESTINATION
"
${
CMAKE_INSTALL_FULL_LIBDIR
}
/cmake/cJSON"
)
endif
()
set_target_properties
(
"
${
CJSON_LIB
}
"
PROPERTIES
SOVERSION
"
${
CJSON_VERSION_SO
}
"
VERSION
"
${
PROJECT_VERSION
}
"
)
if
(
ENABLE_CJSON_VERSION_SO
)
set_target_properties
(
"
${
CJSON_LIB
}
"
PROPERTIES
SOVERSION
"
${
CJSON_VERSION_SO
}
"
VERSION
"
${
PROJECT_VERSION
}
"
)
endif
()
#cJSON_Utils
option
(
ENABLE_CJSON_UTILS
"Enable building the cJSON_Utils library."
OFF
)
...
...
@@ -207,10 +210,12 @@ if(ENABLE_CJSON_UTILS)
install
(
EXPORT
"
${
CJSON_UTILS_LIB
}
"
DESTINATION
"
${
CMAKE_INSTALL_FULL_LIBDIR
}
/cmake/cJSON"
)
endif
()
set_target_properties
(
"
${
CJSON_UTILS_LIB
}
"
PROPERTIES
SOVERSION
"
${
CJSON_UTILS_VERSION_SO
}
"
VERSION
"
${
PROJECT_VERSION
}
"
)
if
(
ENABLE_CJSON_VERSION_SO
)
set_target_properties
(
"
${
CJSON_UTILS_LIB
}
"
PROPERTIES
SOVERSION
"
${
CJSON_UTILS_VERSION_SO
}
"
VERSION
"
${
PROJECT_VERSION
}
"
)
endif
()
endif
()
# create the other package config files
...
...
This diff is collapsed.
Click to expand it.
README.md
+
1
−
0
View file @
61eb84d9
...
...
@@ -118,6 +118,7 @@ You can change the build process with a list of different options that you can p
*
`-DCMAKE_INSTALL_PREFIX=/usr`
: Set a prefix for the installation.
*
`-DENABLE_LOCALES=On`
: Enable the usage of localeconv method. ( on by default )
*
`-DCJSON_OVERRIDE_BUILD_SHARED_LIBS=On`
: Enable overriding the value of
`BUILD_SHARED_LIBS`
with
`-DCJSON_BUILD_SHARED_LIBS`
.
*
`-DENABLE_CJSON_VERSION_SO`
: Enable cJSON so version. ( on by default )
If you are packaging cJSON for a distribution of Linux, you would probably take these steps for example:
```
...
...
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