How do I specify that CMake should use a different link_directories
value depending on whether the target is 32-bit or 64-bit? For example, 32-bit binaries need to link with 32-bit Boost, 64-bit binaries need to link with 64-bit Boost.
CMake is software designed to automate compilation on various systems. We'll need both the make tool and a C or C++ compiler to build a project. As a result, we have a 32-bit executable program linked to a 32-bit C library.
CMake handles the difficult aspects of building software such as cross-platform builds, system introspection, and user customized builds, in a simple manner that allows users to easily tailor builds for complex hardware and software systems.
You do something along these lines
if( CMAKE_SIZEOF_VOID_P EQUAL 8 ) set( BOOST_LIBRARY "/boost/win64/lib" ) else( CMAKE_SIZEOF_VOID_P EQUAL 8 ) set( BOOST_LIBRARY "/boost/win32/lib" ) endif( CMAKE_SIZEOF_VOID_P EQUAL 8 ) set( CMAKE_EXE_LINKER_FLAGS ${BOOST_LIBRARY} )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With