From 5ec6c3e22cebba7e254ea8ac700a048819203d96 Mon Sep 17 00:00:00 2001 From: John Dupuy Date: Tue, 7 Nov 2023 17:29:44 -0600 Subject: [PATCH] added conditional static/shared select to cmake --- CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0dc291..23f391f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,18 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) include(GNUInstallDirs) -add_library(OndselSolver SHARED) +if( BUILD_SHARED_LIBS ) + set( ONDSELSOLVER_BUILD_SHARED ON ) +endif() + +if ( ONDSELSOLVER_BUILD_SHARED ) + message( STATUS "[OndselSolver] Building shared library" ) + add_library(OndselSolver SHARED) +else() + message( STATUS "[OndselSolver] Building static library" ) + add_library(OndselSolver STATIC) +endif() + set(ONDSELSOLVER_SRC OndselSolver/Array.cpp