mirror of
https://github.com/UltraCoderRU/libwebrtc.git
synced 2026-01-28 11:15:13 +00:00
Move options code to a separate CMake module
This commit is contained in:
parent
5337697608
commit
282570038c
2 changed files with 28 additions and 28 deletions
|
|
@ -10,34 +10,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
|
|||
|
||||
include(FindLibraries)
|
||||
include(Version)
|
||||
|
||||
#
|
||||
# Options, flags
|
||||
option(BUILD_TESTS "Build test binaries" OFF)
|
||||
set(NINJA_ARGS "" CACHE STRING "Ninja arguments to pass before compiling WebRTC")
|
||||
option(BUILD_SHARED_LIBS "Build WebRTC as a shared library." OFF)
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set(LIBRARY_TYPE SHARED)
|
||||
else()
|
||||
set(LIBRARY_TYPE STATIC)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Offer the user the choice of overriding the installation directories
|
||||
set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
|
||||
set(INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
|
||||
set(INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files")
|
||||
set(INSTALL_CMAKE_DIR lib/cmake/LibWebRTC CACHE PATH "Installation directory for CMake files")
|
||||
|
||||
#
|
||||
# Make relative paths absolute (needed later on)
|
||||
foreach(p LIB BIN INCLUDE CMAKE)
|
||||
set(var INSTALL_${p}_DIR)
|
||||
if(NOT IS_ABSOLUTE "${${var}}")
|
||||
set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
|
||||
endif()
|
||||
endforeach()
|
||||
include(Options)
|
||||
|
||||
#
|
||||
# Target OS
|
||||
|
|
|
|||
27
CMakeModules/Options.cmake
Normal file
27
CMakeModules/Options.cmake
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#
|
||||
# Options, flags
|
||||
option(BUILD_TESTS "Build test binaries" OFF)
|
||||
set(NINJA_ARGS "" CACHE STRING "Ninja arguments to pass before compiling WebRTC")
|
||||
option(BUILD_SHARED_LIB "Build WebRTC as a shared library." OFF)
|
||||
|
||||
if(BUILD_SHARED_LIB)
|
||||
set(LIBRARY_TYPE SHARED)
|
||||
else()
|
||||
set(LIBRARY_TYPE STATIC)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Offer the user the choice of overriding the installation directories
|
||||
set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
|
||||
set(INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
|
||||
set(INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files")
|
||||
set(INSTALL_CMAKE_DIR lib/cmake/LibWebRTC CACHE PATH "Installation directory for CMake files")
|
||||
|
||||
#
|
||||
# Make relative paths absolute (needed later on)
|
||||
foreach(p LIB BIN INCLUDE CMAKE)
|
||||
set(var INSTALL_${p}_DIR)
|
||||
if(NOT IS_ABSOLUTE "${${var}}")
|
||||
set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
|
||||
endif()
|
||||
endforeach()
|
||||
Loading…
Add table
Reference in a new issue