From f302a6184ed7141b57a72ee6dba74461d4120622 Mon Sep 17 00:00:00 2001 From: "Fletcher T. Penney" Date: Thu, 12 Nov 2015 19:18:21 -0500 Subject: [PATCH] use static linking for Linux to try to make binaries more compatible --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0040eb1..078636f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,6 +173,12 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") # Create zip archive set (CPACK_GENERATOR ZIP) + # Statically link libraries -- might make the binary slightly more + # compatible across Linux distributions, for example + set (CMAKE_FIND_LIBRARY_SUFFIXES ".a") + set (BUILD_SHARED_LIBRARIES OFF) + set (CMAKE_EXE_LINKER_FLAGS "-static") + # Some libraries need to be linked on some Linux builds if (DEFINED TEST) # target_link_libraries(run_tests m) -- 2.50.1