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) ...@@ -22,7 +22,7 @@ if(SCALFMM_ADDON_CKERNELAPI)
file( GLOB_RECURSE source_lib_files Src/*.cpp ) file( GLOB_RECURSE source_lib_files Src/*.cpp )
# Adding cpp files to project # 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) # Add blas library (even if it is set to off)
target_link_libraries( scalfmmckernelapi scalfmm) target_link_libraries( scalfmmckernelapi scalfmm)
......
...@@ -24,7 +24,7 @@ if(SCALFMM_ADDON_FMMAPI) ...@@ -24,7 +24,7 @@ if(SCALFMM_ADDON_FMMAPI)
file( GLOB_RECURSE source_lib_files Src/*.cpp ) file( GLOB_RECURSE source_lib_files Src/*.cpp )
# Adding cpp files to project # 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) # Add blas library (even if it is set to off)
target_link_libraries( scalfmmapi scalfmm) target_link_libraries( scalfmmapi scalfmm)
......
...@@ -36,7 +36,7 @@ if(SCALFMM_ADDON_HMAT) ...@@ -36,7 +36,7 @@ if(SCALFMM_ADDON_HMAT)
file( GLOB_RECURSE source_lib_files Src/*.cpp ) file( GLOB_RECURSE source_lib_files Src/*.cpp )
# Adding cpp files to project # 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) # Add blas library (even if it is set to off)
target_link_libraries( scalfmmhmat scalfmm) target_link_libraries( scalfmmhmat scalfmm)
...@@ -64,7 +64,7 @@ if(SCALFMM_ADDON_HMAT) ...@@ -64,7 +64,7 @@ if(SCALFMM_ADDON_HMAT)
# Add C Clustering Library # Add C Clustering Library
file( GLOB_RECURSE ccl_lib_files CClusteringLibrary/*.c ) file( GLOB_RECURSE ccl_lib_files CClusteringLibrary/*.c )
add_library( cclusteringlib STATIC ${ccl_lib_files} ) add_library( cclusteringlib ${ccl_lib_files} )
INCLUDE_DIRECTORIES(CClusteringLibrary/) INCLUDE_DIRECTORIES(CClusteringLibrary/)
target_link_libraries( cclusteringlib scalfmm) target_link_libraries( cclusteringlib scalfmm)
install( TARGETS cclusteringlib ARCHIVE DESTINATION lib ) install( TARGETS cclusteringlib ARCHIVE DESTINATION lib )
......
...@@ -63,6 +63,10 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/ ...@@ -63,6 +63,10 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/
# the RPATH to be used when installing # the RPATH to be used when installing
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# Build ScalFmm as static or dynamic lib
# --------------------------------------
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
# #
# Options # Options
# #
......
...@@ -64,7 +64,6 @@ endif() ...@@ -64,7 +64,6 @@ endif()
# Adding cpp files to project # Adding cpp files to project
add_library( add_library(
scalfmm scalfmm
STATIC
${source_lib_files_enabled} ${source_lib_files_enabled}
${SCALFMM_CUDA_SOURCES} ${SCALFMM_CUDA_SOURCES}
) )
...@@ -81,12 +80,11 @@ INCLUDE_DIRECTORIES( ...@@ -81,12 +80,11 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${SCALFMM_INCLUDES} ${SCALFMM_INCLUDES}
) )
# Install lib # Install lib
install( TARGETS scalfmm ARCHIVE DESTINATION lib ) install( TARGETS scalfmm DESTINATION lib )
# Install header # Install header
SET(my_include_dirs "." 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