mirror of
https://github.com/boostorg/json.git
synced 2025-05-10 09:43:52 +00:00
When building outside of boost, boost_json now supports the install option of cmake. This patch produces a full, correct install which obeys CMAKE_INSTALL_PREFIX and creates the correct config.cmake files in order to construct the target Boost::json This config will automatically find Boost::system using the standard cmake find_package command
25 lines
786 B
CMake
25 lines
786 B
CMake
# C++ standard.
|
|
set(CMAKE_CXX_EXTENSIONS OFF CACHE STRING "")
|
|
|
|
# Static library linkage.
|
|
set(BUILD_SHARED_LIBS OFF CACHE STRING "")
|
|
add_definitions(-DBOOST_ALL_STATIC_LINK=1)
|
|
|
|
# Interprocedural optimization.
|
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON CACHE STRING "")
|
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL ON CACHE STRING "")
|
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON CACHE STRING "")
|
|
|
|
# Compiler definitions.
|
|
if(WIN32)
|
|
add_definitions(-D_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_WARNINGS)
|
|
endif()
|
|
|
|
# Project options.
|
|
set(BOOST_JSON_BUILD_BENCHMARKS ON CACHE STRING "")
|
|
|
|
# Detect Boost tree.
|
|
if(NOT DEFINED BOOST_JSON_IN_BOOST_TREE AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/../../../../Jamroot")
|
|
set(BOOST_JSON_IN_BOOST_TREE ON CACHE STRING "")
|
|
endif()
|