From 786b291d9c6b784c7ce6ceef0e38a4ec76ea14db Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 16:32:52 +0200 Subject: Move CMake files to modernized cmake syntax, step 1. Change projects to cmake targetsto get rid of havig to hardcore include directories and link libraries in consumer projects. --- indra/cmake/Boost.cmake | 103 +++++++++++++++--------------------------------- 1 file changed, 31 insertions(+), 72 deletions(-) (limited to 'indra/cmake/Boost.cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 0a61e33532..00bfedfb71 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -1,6 +1,11 @@ # -*- cmake -*- include(Prebuilt) +if( TARGET boost::boost ) + return() +endif() +create_target( boost::boost ) + set(Boost_FIND_QUIETLY ON) set(Boost_FIND_REQUIRED ON) @@ -24,80 +29,34 @@ else (USESYSTEMLIBS) set(addrsfx "-x${ADDRESS_SIZE}") if (WINDOWS) - set(BOOST_CONTEXT_LIBRARY - optimized libboost_context-mt${addrsfx} - debug libboost_context-mt${addrsfx}-gd) - set(BOOST_FIBER_LIBRARY - optimized libboost_fiber-mt${addrsfx} - debug libboost_fiber-mt${addrsfx}-gd) - set(BOOST_FILESYSTEM_LIBRARY - optimized libboost_filesystem-mt${addrsfx} - debug libboost_filesystem-mt${addrsfx}-gd) - set(BOOST_PROGRAM_OPTIONS_LIBRARY - optimized libboost_program_options-mt${addrsfx} - debug libboost_program_options-mt${addrsfx}-gd) - set(BOOST_REGEX_LIBRARY - optimized libboost_regex-mt${addrsfx} - debug libboost_regex-mt${addrsfx}-gd) - set(BOOST_SIGNALS_LIBRARY - optimized libboost_signals-mt${addrsfx} - debug libboost_signals-mt${addrsfx}-gd) - set(BOOST_SYSTEM_LIBRARY - optimized libboost_system-mt${addrsfx} - debug libboost_system-mt${addrsfx}-gd) - set(BOOST_THREAD_LIBRARY - optimized libboost_thread-mt${addrsfx} - debug libboost_thread-mt${addrsfx}-gd) + set_target_libraries( boost::boost + libboost_context-mt${addrsfx} + libboost_fiber-mt${addrsfx} + libboost_filesystem-mt${addrsfx} + libboost_program_options-mt${addrsfx} + libboost_regex-mt${addrsfx} + libboost_system-mt${addrsfx} + libboost_thread-mt${addrsfx}) elseif (LINUX) - set(BOOST_CONTEXT_LIBRARY - optimized boost_context-mt${addrsfx} - debug boost_context-mt${addrsfx}-d) - set(BOOST_FIBER_LIBRARY - optimized boost_fiber-mt${addrsfx} - debug boost_fiber-mt${addrsfx}-d) - set(BOOST_FILESYSTEM_LIBRARY - optimized boost_filesystem-mt${addrsfx} - debug boost_filesystem-mt${addrsfx}-d) - set(BOOST_PROGRAM_OPTIONS_LIBRARY - optimized boost_program_options-mt${addrsfx} - debug boost_program_options-mt${addrsfx}-d) - set(BOOST_REGEX_LIBRARY - optimized boost_regex-mt${addrsfx} - debug boost_regex-mt${addrsfx}-d) - set(BOOST_SIGNALS_LIBRARY - optimized boost_signals-mt${addrsfx} - debug boost_signals-mt${addrsfx}-d) - set(BOOST_SYSTEM_LIBRARY - optimized boost_system-mt${addrsfx} - debug boost_system-mt${addrsfx}-d) - set(BOOST_THREAD_LIBRARY - optimized boost_thread-mt${addrsfx} - debug boost_thread-mt${addrsfx}-d) + set_target_libraries( boost::boost + boost_context-mt${addrsfx} + boost_fiber-mt${addrsfx} + boost_filesystem-mt${addrsfx} + boost_program_options-mt${addrsfx} + boost_regex-mt${addrsfx} + boost_signals-mt${addrsfx} + boost_system-mt${addrsfx} + boost_thread-mt${addrsfx}) elseif (DARWIN) - set(BOOST_CONTEXT_LIBRARY - optimized boost_context-mt${addrsfx} - debug boost_context-mt${addrsfx}-d) - set(BOOST_FIBER_LIBRARY - optimized boost_fiber-mt${addrsfx} - debug boost_fiber-mt${addrsfx}-d) - set(BOOST_FILESYSTEM_LIBRARY - optimized boost_filesystem-mt${addrsfx} - debug boost_filesystem-mt${addrsfx}-d) - set(BOOST_PROGRAM_OPTIONS_LIBRARY - optimized boost_program_options-mt${addrsfx} - debug boost_program_options-mt${addrsfx}-d) - set(BOOST_REGEX_LIBRARY - optimized boost_regex-mt${addrsfx} - debug boost_regex-mt${addrsfx}-d) - set(BOOST_SIGNALS_LIBRARY - optimized boost_signals-mt${addrsfx} - debug boost_signals-mt${addrsfx}-d) - set(BOOST_SYSTEM_LIBRARY - optimized boost_system-mt${addrsfx} - debug boost_system-mt${addrsfx}-d) - set(BOOST_THREAD_LIBRARY - optimized boost_thread-mt${addrsfx} - debug boost_thread-mt${addrsfx}-d) + set_target_libraries( boost::boost + boost_context-mt${addrsfx} + boost_fiber-mt${addrsfx} + boost_filesystem-mt${addrsfx} + boost_program_options-mt${addrsfx} + boost_regex-mt${addrsfx} + boost_signals-mt${addrsfx} + boost_system-mt${addrsfx} + boost_thread-mt${addrsfx}) endif (WINDOWS) endif (USESYSTEMLIBS) -- cgit v1.2.3 From e98a6b52ee5309715b5a3353d63cbb3ea2c8d8db Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 22:35:51 +0200 Subject: Remove boost_signals, it is not included in the 3p package. --- indra/cmake/Boost.cmake | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/cmake/Boost.cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 00bfedfb71..8e5ef66af8 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -54,7 +54,6 @@ else (USESYSTEMLIBS) boost_filesystem-mt${addrsfx} boost_program_options-mt${addrsfx} boost_regex-mt${addrsfx} - boost_signals-mt${addrsfx} boost_system-mt${addrsfx} boost_thread-mt${addrsfx}) endif (WINDOWS) -- cgit v1.2.3 From d3521b4462195cfe882b2cc8eb4e7c5e948c0fb6 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 13 Apr 2022 10:28:46 +0200 Subject: Remove obsolete and unmaintained USE_SYSTEMLIBS --- indra/cmake/Boost.cmake | 85 +++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 49 deletions(-) (limited to 'indra/cmake/Boost.cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 8e5ef66af8..2102ee3887 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -9,55 +9,42 @@ create_target( boost::boost ) set(Boost_FIND_QUIETLY ON) set(Boost_FIND_REQUIRED ON) -if (USESYSTEMLIBS) - include(FindBoost) - - set(BOOST_CONTEXT_LIBRARY boost_context-mt) - set(BOOST_FIBER_LIBRARY boost_fiber-mt) - set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt) - set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt) - set(BOOST_REGEX_LIBRARY boost_regex-mt) - set(BOOST_SIGNALS_LIBRARY boost_signals-mt) - set(BOOST_SYSTEM_LIBRARY boost_system-mt) - set(BOOST_THREAD_LIBRARY boost_thread-mt) -else (USESYSTEMLIBS) - use_prebuilt_binary(boost) - set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) - - # As of sometime between Boost 1.67 and 1.72, Boost libraries are suffixed - # with the address size. - set(addrsfx "-x${ADDRESS_SIZE}") - - if (WINDOWS) - set_target_libraries( boost::boost - libboost_context-mt${addrsfx} - libboost_fiber-mt${addrsfx} - libboost_filesystem-mt${addrsfx} - libboost_program_options-mt${addrsfx} - libboost_regex-mt${addrsfx} - libboost_system-mt${addrsfx} - libboost_thread-mt${addrsfx}) - elseif (LINUX) - set_target_libraries( boost::boost - boost_context-mt${addrsfx} - boost_fiber-mt${addrsfx} - boost_filesystem-mt${addrsfx} - boost_program_options-mt${addrsfx} - boost_regex-mt${addrsfx} - boost_signals-mt${addrsfx} - boost_system-mt${addrsfx} - boost_thread-mt${addrsfx}) - elseif (DARWIN) - set_target_libraries( boost::boost - boost_context-mt${addrsfx} - boost_fiber-mt${addrsfx} - boost_filesystem-mt${addrsfx} - boost_program_options-mt${addrsfx} - boost_regex-mt${addrsfx} - boost_system-mt${addrsfx} - boost_thread-mt${addrsfx}) - endif (WINDOWS) -endif (USESYSTEMLIBS) +use_prebuilt_binary(boost) +set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) + +# As of sometime between Boost 1.67 and 1.72, Boost libraries are suffixed +# with the address size. +set(addrsfx "-x${ADDRESS_SIZE}") + +if (WINDOWS) + set_target_libraries( boost::boost + libboost_context-mt${addrsfx} + libboost_fiber-mt${addrsfx} + libboost_filesystem-mt${addrsfx} + libboost_program_options-mt${addrsfx} + libboost_regex-mt${addrsfx} + libboost_system-mt${addrsfx} + libboost_thread-mt${addrsfx}) +elseif (LINUX) + set_target_libraries( boost::boost + boost_context-mt${addrsfx} + boost_fiber-mt${addrsfx} + boost_filesystem-mt${addrsfx} + boost_program_options-mt${addrsfx} + boost_regex-mt${addrsfx} + boost_signals-mt${addrsfx} + boost_system-mt${addrsfx} + boost_thread-mt${addrsfx}) +elseif (DARWIN) + set_target_libraries( boost::boost + boost_context-mt${addrsfx} + boost_fiber-mt${addrsfx} + boost_filesystem-mt${addrsfx} + boost_program_options-mt${addrsfx} + boost_regex-mt${addrsfx} + boost_system-mt${addrsfx} + boost_thread-mt${addrsfx}) +endif (WINDOWS) if (LINUX) set(BOOST_SYSTEM_LIBRARY ${BOOST_SYSTEM_LIBRARY} rt) -- cgit v1.2.3 From 241919e7f7986c11586a49bff53cf19c2c0e0ea6 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 13 Apr 2022 19:21:55 +0200 Subject: Rework cmake, the original plan was to maybe be able to use conan targets with the same name (that's why 3ps had names like apr::apr), but it's safer and saner to put the LL 3ps under the ll:: prefix. This also allows means it is possible to get rid of that bad "if( TRAGET ...) return() endif()" pattern and rather use include_guard(). --- indra/cmake/Boost.cmake | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'indra/cmake/Boost.cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 2102ee3887..ac6151ffe3 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -1,23 +1,17 @@ # -*- cmake -*- include(Prebuilt) -if( TARGET boost::boost ) - return() -endif() -create_target( boost::boost ) - -set(Boost_FIND_QUIETLY ON) -set(Boost_FIND_REQUIRED ON) +include_guard() +create_target( ll::boost ) use_prebuilt_binary(boost) -set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) # As of sometime between Boost 1.67 and 1.72, Boost libraries are suffixed # with the address size. set(addrsfx "-x${ADDRESS_SIZE}") if (WINDOWS) - set_target_libraries( boost::boost + set_target_libraries( ll::boost libboost_context-mt${addrsfx} libboost_fiber-mt${addrsfx} libboost_filesystem-mt${addrsfx} @@ -26,7 +20,7 @@ if (WINDOWS) libboost_system-mt${addrsfx} libboost_thread-mt${addrsfx}) elseif (LINUX) - set_target_libraries( boost::boost + set_target_libraries( ll::boost boost_context-mt${addrsfx} boost_fiber-mt${addrsfx} boost_filesystem-mt${addrsfx} @@ -36,7 +30,7 @@ elseif (LINUX) boost_system-mt${addrsfx} boost_thread-mt${addrsfx}) elseif (DARWIN) - set_target_libraries( boost::boost + set_target_libraries( ll::boost boost_context-mt${addrsfx} boost_fiber-mt${addrsfx} boost_filesystem-mt${addrsfx} -- cgit v1.2.3 From 6d0bba9c03da0d8aca5e88fcb9289cb2f89f3467 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 17 Apr 2022 17:32:14 +0200 Subject: Switch over to standard target_link_libraries (cmake requirements are high enough now). --- indra/cmake/Boost.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/cmake/Boost.cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index ac6151ffe3..e713d50fc1 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -11,7 +11,7 @@ use_prebuilt_binary(boost) set(addrsfx "-x${ADDRESS_SIZE}") if (WINDOWS) - set_target_libraries( ll::boost + target_link_libraries( ll::boost INTERFACE libboost_context-mt${addrsfx} libboost_fiber-mt${addrsfx} libboost_filesystem-mt${addrsfx} @@ -20,7 +20,7 @@ if (WINDOWS) libboost_system-mt${addrsfx} libboost_thread-mt${addrsfx}) elseif (LINUX) - set_target_libraries( ll::boost + target_link_libraries( ll::boost INTERFACE boost_context-mt${addrsfx} boost_fiber-mt${addrsfx} boost_filesystem-mt${addrsfx} @@ -30,7 +30,7 @@ elseif (LINUX) boost_system-mt${addrsfx} boost_thread-mt${addrsfx}) elseif (DARWIN) - set_target_libraries( ll::boost + target_link_libraries( ll::boost INTERFACE boost_context-mt${addrsfx} boost_fiber-mt${addrsfx} boost_filesystem-mt${addrsfx} -- cgit v1.2.3 From 363f2df4fa22b3eb95ff4603d73b7a042f3fefd1 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 17 Apr 2022 18:28:55 +0200 Subject: Remove function create_target and instead directly use add_library --- indra/cmake/Boost.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake/Boost.cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index e713d50fc1..f4f824769e 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -2,7 +2,7 @@ include(Prebuilt) include_guard() -create_target( ll::boost ) +add_library( ll::boost INTERFACE IMPORTED ) use_prebuilt_binary(boost) -- cgit v1.2.3 From 2b151e0aefd54671e1be504269f10318d303dccb Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 18 Apr 2022 18:11:43 +0200 Subject: Round one to support conan for 3P packages, this allows to build the viewer on Linux again. --- indra/cmake/Boost.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/cmake/Boost.cmake') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index f4f824769e..601a23a86d 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -2,7 +2,13 @@ include(Prebuilt) include_guard() + add_library( ll::boost INTERFACE IMPORTED ) +if( USE_CONAN ) + target_link_libraries( ll::boost INTERFACE CONAN_PKG::boost ) + target_compile_definitions( ll::boost INTERFACE BOOST_ALLOW_DEPRECATED_HEADERS BOOST_BIND_GLOBAL_PLACEHOLDERS ) + return() +endif() use_prebuilt_binary(boost) -- cgit v1.2.3