From d1b6a52fefb483ab75ec60e379d37bfd2e6aff90 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 22:38:38 +0200 Subject: Googlemock target --- indra/cmake/GoogleMock.cmake | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'indra/cmake/GoogleMock.cmake') diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index 5a00546927..58975df62e 100644 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -4,25 +4,26 @@ include(Linking) use_prebuilt_binary(googlemock) -set(GOOGLEMOCK_INCLUDE_DIRS - ${LIBS_PREBUILT_DIR}/include) +if( TARGET googlemock::googlemock ) + return() +endif() +create_target( googlemock::googlemock ) +set_target_include_dirs( googlemock::googlemock + ${LIBS_PREBUILT_DIR}/include + ) if (LINUX) # VWR-24366: gmock is underlinked, it needs gtest. - set(GOOGLEMOCK_LIBRARIES - gmock -Wl,--no-as-needed - gtest -Wl,--as-needed) + set_target_libraries( googlemock::googlemock gmock gtest) elseif(WINDOWS) - set(GOOGLEMOCK_LIBRARIES - gmock) - set(GOOGLEMOCK_INCLUDE_DIRS - ${LIBS_PREBUILT_DIR}/include - ${LIBS_PREBUILT_DIR}/include/gmock - ${LIBS_PREBUILT_DIR}/include/gmock/boost/tr1/tr1) + set_target_libraries( googlemock::googlemock gmock) + set_target_include_dirs( googlemock::googlemock + ${LIBS_PREBUILT_DIR}/include + ${LIBS_PREBUILT_DIR}/include/gmock + ${LIBS_PREBUILT_DIR}/include/gmock/boost/tr1/tr1 ) + elseif(DARWIN) - set(GOOGLEMOCK_LIBRARIES - gmock - gtest) + set_target_libraries( googlemock::googlemock gmock gtest) endif(LINUX) -- cgit v1.2.3 From 3bcb7fcc716d98a61d77477243cc3a73722ac75f Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 23:29:46 +0200 Subject: Remove noexistant include directory --- indra/cmake/GoogleMock.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/cmake/GoogleMock.cmake') diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index 58975df62e..821346ced6 100644 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -19,8 +19,7 @@ elseif(WINDOWS) set_target_libraries( googlemock::googlemock gmock) set_target_include_dirs( googlemock::googlemock ${LIBS_PREBUILT_DIR}/include - ${LIBS_PREBUILT_DIR}/include/gmock - ${LIBS_PREBUILT_DIR}/include/gmock/boost/tr1/tr1 ) + ${LIBS_PREBUILT_DIR}/include/gmock) elseif(DARWIN) set_target_libraries( googlemock::googlemock gmock gtest) -- 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/GoogleMock.cmake | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'indra/cmake/GoogleMock.cmake') diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index 821346ced6..1f161ec4ff 100644 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -2,27 +2,26 @@ include(Prebuilt) include(Linking) +include_guard() + use_prebuilt_binary(googlemock) -if( TARGET googlemock::googlemock ) - return() -endif() -create_target( googlemock::googlemock ) -set_target_include_dirs( googlemock::googlemock +create_target( ll::googlemock ) +set_target_include_dirs( ll::googlemock ${LIBS_PREBUILT_DIR}/include ) if (LINUX) # VWR-24366: gmock is underlinked, it needs gtest. - set_target_libraries( googlemock::googlemock gmock gtest) + set_target_libraries( ll::googlemock gmock gtest) elseif(WINDOWS) - set_target_libraries( googlemock::googlemock gmock) - set_target_include_dirs( googlemock::googlemock + set_target_libraries( ll::googlemock gmock) + set_target_include_dirs( ll::googlemock ${LIBS_PREBUILT_DIR}/include ${LIBS_PREBUILT_DIR}/include/gmock) elseif(DARWIN) - set_target_libraries( googlemock::googlemock gmock gtest) + set_target_libraries( ll::googlemock gmock gtest) endif(LINUX) -- 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/GoogleMock.cmake | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'indra/cmake/GoogleMock.cmake') diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index 1f161ec4ff..23558364bb 100644 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -13,15 +13,14 @@ set_target_include_dirs( ll::googlemock if (LINUX) # VWR-24366: gmock is underlinked, it needs gtest. - set_target_libraries( ll::googlemock gmock gtest) + target_link_libraries( ll::googlemock INTERFACE gmock gtest) elseif(WINDOWS) - set_target_libraries( ll::googlemock gmock) + target_link_libraries( ll::googlemock INTERFACE gmock) set_target_include_dirs( ll::googlemock ${LIBS_PREBUILT_DIR}/include ${LIBS_PREBUILT_DIR}/include/gmock) - elseif(DARWIN) - set_target_libraries( ll::googlemock gmock gtest) + target_link_libraries( ll::googlemock INTERFACE gmock gtest) endif(LINUX) -- cgit v1.2.3 From e0cf0cdfd49e5a946dcd202a083fb23f01e4f1fe Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 17 Apr 2022 18:04:57 +0200 Subject: Switch to target_include_directories All 3Ps include dirs are treated as SYSTEM, this will stop compilers stop emitting warnings from those files and greatly helps having high warning levels and not being swamped by warnings that come from external libraries. --- indra/cmake/GoogleMock.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/cmake/GoogleMock.cmake') diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index 23558364bb..01ef4de093 100644 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -7,7 +7,7 @@ include_guard() use_prebuilt_binary(googlemock) create_target( ll::googlemock ) -set_target_include_dirs( ll::googlemock +target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) @@ -16,7 +16,7 @@ if (LINUX) target_link_libraries( ll::googlemock INTERFACE gmock gtest) elseif(WINDOWS) target_link_libraries( ll::googlemock INTERFACE gmock) - set_target_include_dirs( ll::googlemock + target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ${LIBS_PREBUILT_DIR}/include/gmock) elseif(DARWIN) -- 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/GoogleMock.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake/GoogleMock.cmake') diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index 01ef4de093..2036e43dd0 100644 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -6,7 +6,7 @@ include_guard() use_prebuilt_binary(googlemock) -create_target( ll::googlemock ) +add_library( ll::googlemock INTERFACE IMPORTED ) target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) -- 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/GoogleMock.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/cmake/GoogleMock.cmake') diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index 2036e43dd0..753b972e95 100644 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -4,9 +4,13 @@ include(Linking) include_guard() -use_prebuilt_binary(googlemock) +if(USE_CONAN) + return() +endif() add_library( ll::googlemock INTERFACE IMPORTED ) +use_prebuilt_binary(googlemock) + target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) -- cgit v1.2.3 From d6b34d41afc1f77a28e60ae1f9e22b61323052fa Mon Sep 17 00:00:00 2001 From: Nicky Date: Tue, 19 Apr 2022 20:28:34 +0200 Subject: Finishing touches, making sure even with conan all needed 3ps are installed and usable. This brings the source to be able to run tests in conan mode. --- indra/cmake/GoogleMock.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'indra/cmake/GoogleMock.cmake') diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index 753b972e95..e4520fe96e 100644 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -4,16 +4,18 @@ include(Linking) include_guard() +add_library( ll::googlemock INTERFACE IMPORTED ) if(USE_CONAN) - return() + target_link_libraries( ll::googlemock INTERFACE CONAN_PKG::gtest ) + + #Not very nice, but for the moment we need this for tut.hpp + target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) + return() endif() -add_library( ll::googlemock INTERFACE IMPORTED ) use_prebuilt_binary(googlemock) -target_include_directories( ll::googlemock SYSTEM INTERFACE - ${LIBS_PREBUILT_DIR}/include - ) +target_include_directories( ll::googlemock SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) if (LINUX) # VWR-24366: gmock is underlinked, it needs gtest. -- cgit v1.2.3