From b7d33c2c33aa4475014f80602a09e5d348d5821e Mon Sep 17 00:00:00 2001 From: daan Date: Wed, 15 Dec 2021 08:41:52 -0800 Subject: [PATCH 1/2] fix MI_ prefix for libraries --- CMakeLists.txt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ceadffd..48ecd315 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -210,13 +210,13 @@ endif() if(WIN32) list(APPEND mi_libraries psapi shell32 user32 advapi32 bcrypt) else() - find_library(LIBPTHREAD pthread) - if (LIBPTHREAD) - list(APPEND mi_libraries ${LIBPTHREAD}) + find_library(MI_LIBPTHREAD pthread) + if (MI_LIBPTHREAD) + list(APPEND mi_libraries ${MI_LIBPTHREAD}) endif() - find_library(LIBRT rt) - if(LIBRT) - list(APPEND mi_libraries ${LIBRT}) + find_library(MI_LIBRT rt) + if(MI_LIBRT) + list(APPEND mi_libraries ${MI_LIBRT}) endif() endif() @@ -228,9 +228,11 @@ endif() # Install and output names # ----------------------------------------------------------------------------- -set(mi_install_libdir "${CMAKE_INSTALL_LIBDIR}") # for dynamic/shared library and symlinks +# dynamic/shared library and symlinks always go to /usr/local/lib equivalent +set(mi_install_libdir "${CMAKE_INSTALL_LIBDIR}") -# install at top level or use versioned directories for side-by-side installation? +# static libraries and object files, includes, and cmake config files +# are either installed at top level, or use versioned directories for side-by-side installation (default) if (MI_INSTALL_TOPLEVEL) set(mi_install_objdir "${CMAKE_INSTALL_LIBDIR}") set(mi_install_incdir "${CMAKE_INSTALL_INCLUDEDIR}") From 144b4a2d3e1535634b5e8a5d12fa9e64e44dadbd Mon Sep 17 00:00:00 2001 From: daan Date: Wed, 15 Dec 2021 08:42:58 -0800 Subject: [PATCH 2/2] link with libatomic automatically if found --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 48ecd315..6b2e9b83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -218,10 +218,10 @@ else() if(MI_LIBRT) list(APPEND mi_libraries ${MI_LIBRT}) endif() -endif() - -if (MI_USE_LIBATOMIC) - list(APPEND mi_libraries atomic) + find_library(MI_LIBATOMIC atomic) + if (MI_LIBATOMIC OR MI_USE_LIBATOMIC) + list(APPEND mi_libraries atomic) + endif() endif() # -----------------------------------------------------------------------------