add WITH_BOOST option to build with linked Boost

This commit is contained in:
Syping 2023-04-09 21:45:58 +02:00
parent 6e38894bcc
commit 7f7b202df9
3 changed files with 27 additions and 4 deletions

View file

@ -48,7 +48,6 @@ if(APPLE)
endif()
list(APPEND GTA5VIEW_DEFINES
-DBOOST_JSON_STANDALONE
-DGTA5SYNC_CMAKE
-DGTA5SYNC_PROJECT
)
@ -140,7 +139,6 @@ set(GTA5VIEW_HEADERS
set(GTA5VIEW_INCLUDEDIR
src
src/anpro
src/json/include
src/pcg
src/uimod
)
@ -231,6 +229,29 @@ if(RAGEPHOTO_ABI_WRAPPER)
)
endif()
option(WITH_BOOST "Use linked Boost library" OFF)
if(WITH_BOOST)
find_package(Boost REQUIRED
COMPONENTS json
)
list(APPEND GTA5VIEW_LIBS
Boost::json
)
list(APPEND GTA5VIEW_DEFINES
-DGTA5SYNC_BOOST
)
list(APPEND GTA5VIEW_INCLUDEDIR
${Boost_INCLUDE_DIRS}
)
else()
list(APPEND GTA5VIEW_DEFINES
-DBOOST_JSON_STANDALONE
)
list(APPEND GTA5VIEW_INCLUDEDIR
src/json/include
)
endif()
option(WITH_DONATE "Donate menu option and donation dialog" OFF)
if(WITH_DONATE)
set(DONATE_ADDRESSES "" CACHE STRING "Donation addresses")