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/Hunspell.cmake | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'indra/cmake/Hunspell.cmake') diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index 06227b3fe2..970b06b81f 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -1,22 +1,24 @@ # -*- cmake -*- include(Prebuilt) -set(HUNSPELL_FIND_QUIETLY ON) -set(HUNSPELL_FIND_REQUIRED ON) +if( TARGET hunspell::hunspell ) + return() +endif() +create_target( hunspell::hunspell ) if (USESYSTEMLIBS) include(FindHUNSPELL) else (USESYSTEMLIBS) use_prebuilt_binary(libhunspell) if (WINDOWS) - set(HUNSPELL_LIBRARY libhunspell) + set_target_libraries( hunspell::hunspell libhunspell) elseif(DARWIN) - set(HUNSPELL_LIBRARY hunspell-1.3) + set_target_libraries( hunspell::hunspell hunspell-1.3) elseif(LINUX) - set(HUNSPELL_LIBRARY hunspell-1.3) + set_target_libraries( hunspell::hunspell hunspell-1.3) else() message(FATAL_ERROR "Invalid platform") endif() - set(HUNSPELL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/hunspell) + set_target_include_dirs( hunspell::hunspell ${LIBS_PREBUILT_DIR}/include/hunspell) use_prebuilt_binary(dictionaries) endif (USESYSTEMLIBS) -- 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/Hunspell.cmake | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'indra/cmake/Hunspell.cmake') diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index 970b06b81f..81702cbd77 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -6,19 +6,15 @@ if( TARGET hunspell::hunspell ) endif() create_target( hunspell::hunspell ) -if (USESYSTEMLIBS) - include(FindHUNSPELL) -else (USESYSTEMLIBS) - use_prebuilt_binary(libhunspell) - if (WINDOWS) - set_target_libraries( hunspell::hunspell libhunspell) - elseif(DARWIN) - set_target_libraries( hunspell::hunspell hunspell-1.3) - elseif(LINUX) - set_target_libraries( hunspell::hunspell hunspell-1.3) - else() - message(FATAL_ERROR "Invalid platform") - endif() - set_target_include_dirs( hunspell::hunspell ${LIBS_PREBUILT_DIR}/include/hunspell) - use_prebuilt_binary(dictionaries) -endif (USESYSTEMLIBS) +use_prebuilt_binary(libhunspell) +if (WINDOWS) + set_target_libraries( hunspell::hunspell libhunspell) +elseif(DARWIN) + set_target_libraries( hunspell::hunspell hunspell-1.3) +elseif(LINUX) + set_target_libraries( hunspell::hunspell hunspell-1.3) +else() + message(FATAL_ERROR "Invalid platform") +endif() +set_target_include_dirs( hunspell::hunspell ${LIBS_PREBUILT_DIR}/include/hunspell) +use_prebuilt_binary(dictionaries) -- 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/Hunspell.cmake | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'indra/cmake/Hunspell.cmake') diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index 81702cbd77..258a27b5de 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -1,20 +1,16 @@ # -*- cmake -*- include(Prebuilt) -if( TARGET hunspell::hunspell ) - return() -endif() -create_target( hunspell::hunspell ) +include_guard() +create_target( ll::hunspell ) use_prebuilt_binary(libhunspell) if (WINDOWS) - set_target_libraries( hunspell::hunspell libhunspell) + set_target_libraries( ll::hunspell libhunspell) elseif(DARWIN) - set_target_libraries( hunspell::hunspell hunspell-1.3) + set_target_libraries( ll::hunspell hunspell-1.3) elseif(LINUX) - set_target_libraries( hunspell::hunspell hunspell-1.3) -else() - message(FATAL_ERROR "Invalid platform") + set_target_libraries( ll::hunspell hunspell-1.3) endif() -set_target_include_dirs( hunspell::hunspell ${LIBS_PREBUILT_DIR}/include/hunspell) +set_target_include_dirs( ll::hunspell ${LIBS_PREBUILT_DIR}/include/hunspell) use_prebuilt_binary(dictionaries) -- 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/Hunspell.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/cmake/Hunspell.cmake') diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index 258a27b5de..e4352c6967 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -6,11 +6,11 @@ create_target( ll::hunspell ) use_prebuilt_binary(libhunspell) if (WINDOWS) - set_target_libraries( ll::hunspell libhunspell) + target_link_libraries( ll::hunspell INTERFACE libhunspell) elseif(DARWIN) - set_target_libraries( ll::hunspell hunspell-1.3) + target_link_libraries( ll::hunspell INTERFACE hunspell-1.3) elseif(LINUX) - set_target_libraries( ll::hunspell hunspell-1.3) + target_link_libraries( ll::hunspell INTERFACE hunspell-1.3) endif() set_target_include_dirs( ll::hunspell ${LIBS_PREBUILT_DIR}/include/hunspell) use_prebuilt_binary(dictionaries) -- 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/Hunspell.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake/Hunspell.cmake') diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index e4352c6967..0994d2b5f4 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -12,5 +12,5 @@ elseif(DARWIN) elseif(LINUX) target_link_libraries( ll::hunspell INTERFACE hunspell-1.3) endif() -set_target_include_dirs( ll::hunspell ${LIBS_PREBUILT_DIR}/include/hunspell) +target_include_directories( ll::hunspell SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/hunspell) use_prebuilt_binary(dictionaries) -- 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/Hunspell.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake/Hunspell.cmake') diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index 0994d2b5f4..7786418226 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -2,7 +2,7 @@ include(Prebuilt) include_guard() -create_target( ll::hunspell ) +add_library( ll::hunspell INTERFACE IMPORTED ) use_prebuilt_binary(libhunspell) if (WINDOWS) -- 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/Hunspell.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake/Hunspell.cmake') diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index 7786418226..c372d83f8d 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -3,7 +3,7 @@ include(Prebuilt) include_guard() add_library( ll::hunspell INTERFACE IMPORTED ) - +use_conan_binary(hunspell) use_prebuilt_binary(libhunspell) if (WINDOWS) target_link_libraries( ll::hunspell INTERFACE libhunspell) -- 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/Hunspell.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/cmake/Hunspell.cmake') diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index c372d83f8d..6e92611cc9 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -2,6 +2,8 @@ include(Prebuilt) include_guard() +use_prebuilt_binary(dictionaries) + add_library( ll::hunspell INTERFACE IMPORTED ) use_conan_binary(hunspell) use_prebuilt_binary(libhunspell) @@ -13,4 +15,3 @@ elseif(LINUX) target_link_libraries( ll::hunspell INTERFACE hunspell-1.3) endif() target_include_directories( ll::hunspell SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/hunspell) -use_prebuilt_binary(dictionaries) -- cgit v1.2.3 From 3f31d0b5a70af4ebf746d40d478b4e948e904a87 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 17 Jul 2022 17:51:25 +0200 Subject: Be more explicit: Rename use_conan_binary to use_system_binary, this will allow us to reuse the macro for more than just conan. --- indra/cmake/Hunspell.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake/Hunspell.cmake') diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index 6e92611cc9..bb037c0237 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -5,7 +5,7 @@ include_guard() use_prebuilt_binary(dictionaries) add_library( ll::hunspell INTERFACE IMPORTED ) -use_conan_binary(hunspell) +use_system_binary(hunspell) use_prebuilt_binary(libhunspell) if (WINDOWS) target_link_libraries( ll::hunspell INTERFACE libhunspell) -- cgit v1.2.3