Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Ogg
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
8
Issues
8
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
Ogg
Commits
6c24f238
Commit
6c24f238
authored
May 16, 2015
by
stopiccot
Committed by
Ralph Giles
May 27, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CMake script to build ogg.
Signed-off-by:
Ralph Giles
<
giles@mozilla.com
>
parent
fbe55b0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
94 additions
and
0 deletions
+94
-0
CMakeLists.txt
CMakeLists.txt
+94
-0
No files found.
CMakeLists.txt
0 → 100644
View file @
6c24f238
cmake_minimum_required
(
VERSION 2.8.7
)
project
(
libogg
)
# Required modules
include
(
GNUInstallDirs
)
include
(
CheckIncludeFiles
)
# Build options
option
(
BUILD_SHARED_LIBS
"Build shared library"
OFF
)
if
(
APPLE
)
option
(
BUILD_FRAMEWORK
"Build Framework bundle for OSX"
OFF
)
endif
()
# Extract project version from configure.ac
file
(
READ configure.ac CONFIGURE_AC_CONTENTS
)
string
(
REGEX MATCH
"AC_INIT
\\
(
\\
[libogg
\\
],
\\
[([0-9]*).([0-9]*).([0-9]*)"
DUMMY
${
CONFIGURE_AC_CONTENTS
}
)
set
(
PROJECT_VERSION_MAJOR
${
CMAKE_MATCH_1
}
)
set
(
PROJECT_VERSION_MINOR
${
CMAKE_MATCH_2
}
)
set
(
PROJECT_VERSION_PATCH
${
CMAKE_MATCH_3
}
)
set
(
PROJECT_VERSION
${
PROJECT_VERSION_MAJOR
}
.
${
PROJECT_VERSION_MINOR
}
.
${
PROJECT_VERSION_PATCH
}
)
# Extract so library version from configure.ac
string
(
REGEX MATCH
"LIB_AGE=([0-9]*)"
DUMMY
${
CONFIGURE_AC_CONTENTS
}
)
set
(
LIB_AGE
${
CMAKE_MATCH_1
}
)
string
(
REGEX MATCH
"LIB_REVISION=([0-9]*)"
DUMMY
${
CONFIGURE_AC_CONTENTS
}
)
set
(
LIB_REVISION
${
CMAKE_MATCH_1
}
)
message
(
STATUS
"Configuring
${
PROJECT_NAME
}
${
PROJECT_VERSION
}
"
)
message
(
STATUS
"Shared library version 0.
${
LIB_AGE
}
.
${
LIB_REVISION
}
"
)
# Configure config_type.h
check_include_files
(
inttypes.h INCLUDE_INTTYPES_H
)
check_include_files
(
stdint.h INCLUDE_STDINT_H
)
check_include_files
(
sys/types.h INCLUDE_SYS_TYPES_H
)
set
(
SIZE16 int16_t
)
set
(
USIZE16 uint16_t
)
set
(
SIZE32 int32_t
)
set
(
USIZE32 uint32_t
)
set
(
SIZE64 int64_t
)
configure_file
(
include/ogg/config_types.h.in include/ogg/config_types.h @ONLY
)
set
(
OGG_HEADERS
include/ogg/ogg.h
include/ogg/os_types.h
)
set
(
OGG_SOURCES
src/bitwise.c
src/framing.c
)
if
(
MSVC
)
list
(
APPEND OGG_SOURCES win32/ogg.def
)
endif
()
if
(
BUILD_FRAMEWORK
)
set
(
BUILD_SHARED_LIBS TRUE
)
endif
()
include_directories
(
include
)
add_library
(
ogg
${
OGG_HEADERS
}
${
OGG_SOURCES
}
)
set_target_properties
(
ogg PROPERTIES SOVERSION
"0.
${
LIB_AGE
}
.
${
LIB_REVISION
}
"
)
if
(
BUILD_FRAMEWORK
)
set_target_properties
(
ogg PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION
${
PROJECT_VERSION
}
MACOSX_FRAMEWORK_IDENTIFIER org.xiph.ogg
MACOSX_FRAMEWORK_SHORT_VERSION_STRING
${
PROJECT_VERSION
}
MACOSX_FRAMEWORK_BUNDLE_VERSION
${
PROJECT_VERSION
}
XCODE_ATTRIBUTE_INSTALL_PATH
"@rpath"
PUBLIC_HEADER
"
${
OGG_HEADERS
}
"
OUTPUT_NAME Ogg
)
endif
()
# Configure pkg-config files
function
(
configure_pkg_config_file pkg_config_file_in
)
set
(
prefix
${
CMAKE_INSTALL_PREFIX
}
)
set
(
exec_prefix
${
CMAKE_INSTALL_FULL_BINDIR
}
)
set
(
libdir
${
CMAKE_INSTALL_FULL_LIBDIR
}
)
set
(
includedir
${
CMAKE_INSTALL_FULL_INCLUDEDIR
}
)
set
(
VERSION
${
PROJECT_VERSION
}
)
string
(
REPLACE
".in"
""
pkg_config_file
${
pkg_config_file_in
}
)
configure_file
(
${
pkg_config_file_in
}
${
pkg_config_file
}
@ONLY
)
endfunction
()
configure_pkg_config_file
(
ogg.pc.in
)
install
(
FILES include/ogg/ogg.h include/ogg/os_types.h include/ogg/config_types.h DESTINATION
${
CMAKE_INSTALL_FULL_INCLUDEDIR
}
)
install
(
TARGETS ogg RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
LIBRARY DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
FRAMEWORK DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
)
install
(
FILES ogg.pc DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/pkgconfig
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment