Transaction: 062d0ce05e0f302a2fe5c4b7d14b908fa26d45a2

Included in block 45,107,626 at 2020/07/14 20:43:18 (UTC).

Transaction overview

Loading...
Transaction info
transaction_id 062d0ce05e0f302a2fe5c4b7d14b908fa26d45a2
ref_block_num 18,840
block_num45,107,626
ref_block_prefix 3,276,850,808
expiration2020/07/14T20:53:12
transaction_num 0
extensions[]
signatures 2011cc4f2669b1b11c1441d19f64f0fb11e618f43b3288fa3b5d45996e79abe8a11b2c566e8d7ea80902968d63bf0ad01e9b53121da3d997e5012ac2019c69c78c
operations
comment
"parent_author":"",<br>"parent_permlink":"cmake",<br>"author":"mtl1979",<br>"permlink":"how-to-force-cmake-to-link-against-static-version-of-library",<br>"title":"How to force cmake to link against static version of library...",<br>"body":"Sometimes it is necessary to force cmake project to link against static version of system library if available,<br> it can be done using following code snippets,<br> which are from cmake package for Ubuntu. Replace <code>Boost<\/code> with your own package name and <code>boost<\/code> with package name written in all minuscule (lower-case) letters.\n\nIn <code>FindBoost.cmake<\/code>:\n\nAdd before <code>find_library()<\/code>:\n```\nif(Boost_USE_STATIC_LIBS)\n set(_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES $ CMAKE_FIND_LIBRARY_SUFFIXES )\n if(WIN32)\n list(INSERT CMAKE_FIND_LIBRARY_SUFFIXES 0 .lib .a)\n else()\n set(CMAKE_FIND_LIBRARY_SUFFIXES .a)\n endif()\nendif()\n```\nFirst it will store original contents of variable <code>CMAKE_FIND_LIBRARY_SUFFIXES<\/code> to temporary variable,<br> then it will prepend known suffixes of static libraries to the variable. Original contents of the variable will be restored in the following code block.\n\nAdd after <code>find_library()<\/code>:\n```\nif(Boost_USE_STATIC_LIBS)\n set(CMAKE_FIND_LIBRARY_SUFFIXES $ _boost_ORIG_CMAKE_LIBRARY_SUFFIXES )\nendif()\n```\n\nIn <code>CMakeLists.txt<\/code>:\n```\nif(STATIC)\n set(Boost_USE_STATIC_LIBS ON)\nendif()\nfind_package(Boost REQUIRED COMPONENTS system filesystem thread date_time chrono regex serialization program_options)\n```\n\n<code>REQUIRED<\/code> means the library must be found for project configuration to succeed.\n<code>COMPONENTS<\/code> means following package components must be available.\n",<br>"json_metadata":" \"app\":\"steempeak\/2020.07.1\",<br>\"format\":\"markdown\",<br>\"tags\":[\"cmake\",<br>\"development\",<br>\"programming\" ,<br>\"image\":[ "
* The API used to generate this page is provided by @steemchiller.