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/NVAPI.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/cmake/NVAPI.cmake') diff --git a/indra/cmake/NVAPI.cmake b/indra/cmake/NVAPI.cmake index 105f442a30..1eea96784f 100644 --- a/indra/cmake/NVAPI.cmake +++ b/indra/cmake/NVAPI.cmake @@ -5,8 +5,9 @@ set(NVAPI ON CACHE BOOL "Use NVAPI.") if (NVAPI) if (WINDOWS) + create_target( nvapi::nvapi ) + set_target_libraries( nvapi::nvapi nvapi) use_prebuilt_binary(nvapi) - set(NVAPI_LIBRARY nvapi) else (WINDOWS) set(NVAPI_LIBRARY "") endif (WINDOWS) -- 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/NVAPI.cmake | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'indra/cmake/NVAPI.cmake') diff --git a/indra/cmake/NVAPI.cmake b/indra/cmake/NVAPI.cmake index 1eea96784f..63e5dd12de 100644 --- a/indra/cmake/NVAPI.cmake +++ b/indra/cmake/NVAPI.cmake @@ -5,13 +5,9 @@ set(NVAPI ON CACHE BOOL "Use NVAPI.") if (NVAPI) if (WINDOWS) - create_target( nvapi::nvapi ) - set_target_libraries( nvapi::nvapi nvapi) + create_target( ll::nvapi ) + set_target_libraries( ll::nvapi nvapi) use_prebuilt_binary(nvapi) - else (WINDOWS) - set(NVAPI_LIBRARY "") endif (WINDOWS) -else (NVAPI) - set(NVAPI_LIBRARY "") endif (NVAPI) -- 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/NVAPI.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake/NVAPI.cmake') diff --git a/indra/cmake/NVAPI.cmake b/indra/cmake/NVAPI.cmake index 63e5dd12de..b06cc78087 100644 --- a/indra/cmake/NVAPI.cmake +++ b/indra/cmake/NVAPI.cmake @@ -6,7 +6,7 @@ set(NVAPI ON CACHE BOOL "Use NVAPI.") if (NVAPI) if (WINDOWS) create_target( ll::nvapi ) - set_target_libraries( ll::nvapi nvapi) + target_link_libraries( ll::nvapi INTERFACE nvapi) use_prebuilt_binary(nvapi) endif (WINDOWS) endif (NVAPI) -- 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/NVAPI.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake/NVAPI.cmake') diff --git a/indra/cmake/NVAPI.cmake b/indra/cmake/NVAPI.cmake index b06cc78087..ff5a5428e0 100644 --- a/indra/cmake/NVAPI.cmake +++ b/indra/cmake/NVAPI.cmake @@ -5,7 +5,7 @@ set(NVAPI ON CACHE BOOL "Use NVAPI.") if (NVAPI) if (WINDOWS) - create_target( ll::nvapi ) + add_library( ll::nvapi INTERFACE IMPORTED ) target_link_libraries( ll::nvapi INTERFACE nvapi) use_prebuilt_binary(nvapi) endif (WINDOWS) -- cgit v1.2.3