Commit 2a83dfb0 authored by PRUVOST Florent's avatar PRUVOST Florent

add the possibility to build scalfmm as a dynamic lib (static by default)

parent 0ca7afc1
......@@ -22,7 +22,7 @@ if(SCALFMM_ADDON_CKERNELAPI)
file( GLOB_RECURSE source_lib_files Src/*.cpp )
# Adding cpp files to project
add_library( scalfmmckernelapi STATIC ${source_lib_files} )
add_library( scalfmmckernelapi ${source_lib_files} )
# Add blas library (even if it is set to off)
target_link_libraries( scalfmmckernelapi scalfmm)
......
......@@ -24,7 +24,7 @@ if(SCALFMM_ADDON_FMMAPI)
file( GLOB_RECURSE source_lib_files Src/*.cpp )
# Adding cpp files to project
add_library( scalfmmapi STATIC ${source_lib_files} )
add_library( scalfmmapi ${source_lib_files} )
# Add blas library (even if it is set to off)
target_link_libraries( scalfmmapi scalfmm)
......
......@@ -36,7 +36,7 @@ if(SCALFMM_ADDON_HMAT)
file( GLOB_RECURSE source_lib_files Src/*.cpp )
# Adding cpp files to project
add_library( scalfmmhmat STATIC ${source_lib_files} )
add_library( scalfmmhmat ${source_lib_files} )
# Add blas library (even if it is set to off)
target_link_libraries( scalfmmhmat scalfmm)
......@@ -64,7 +64,7 @@ if(SCALFMM_ADDON_HMAT)
# Add C Clustering Library
file( GLOB_RECURSE ccl_lib_files CClusteringLibrary/*.c )
add_library( cclusteringlib STATIC ${ccl_lib_files} )
add_library( cclusteringlib ${ccl_lib_files} )
INCLUDE_DIRECTORIES(CClusteringLibrary/)
target_link_libraries( cclusteringlib scalfmm)
install( TARGETS cclusteringlib ARCHIVE DESTINATION lib )
......
......@@ -63,6 +63,10 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/
# the RPATH to be used when installing
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# Build ScalFmm as static or dynamic lib
# --------------------------------------
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
#
# Options
#
......
......@@ -64,7 +64,6 @@ endif()
# Adding cpp files to project
add_library(
scalfmm
STATIC
${source_lib_files_enabled}
${SCALFMM_CUDA_SOURCES}
)
......@@ -81,12 +80,11 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${SCALFMM_INCLUDES}
)
# Install lib
install( TARGETS scalfmm ARCHIVE DESTINATION lib )
install( TARGETS scalfmm DESTINATION lib )
# Install header
SET(my_include_dirs "."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment