Commit 74b33537 authored by ESTERIE Pierre's avatar ESTERIE Pierre

Force Static and fix flags

parent 9029ad36
...@@ -35,7 +35,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/) ...@@ -35,7 +35,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/)
# ----------------- # -----------------
list(APPEND SCALFMM_SOURCES FAlgorithmTimers.cpp FLog.cpp FMemStats.cpp FSignalHandler.cpp) list(APPEND SCALFMM_SOURCES FAlgorithmTimers.cpp FLog.cpp FMemStats.cpp FSignalHandler.cpp)
list(TRANSFORM SCALFMM_SOURCES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/src/") list(TRANSFORM SCALFMM_SOURCES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/src/")
add_library(${CMAKE_PROJECT_NAME} SHARED ${SCALFMM_SOURCES}) add_library(${CMAKE_PROJECT_NAME} STATIC ${SCALFMM_SOURCES})
# Set library includes # Set library includes
# -------------------- # --------------------
target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC
...@@ -55,11 +55,11 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c ...@@ -55,11 +55,11 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_cmake/modules) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_cmake/modules)
set(MORSE_CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_cmake/modules ) set(MORSE_CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_cmake/modules )
endif() endif()
include(MorseInit) include(MorseInit)
# Set the RPATH config # Set the RPATH config
# These options allow all installed executables to run correctly # These options allow all installed executables to run correctly
# when installed to the install diretory # when installed to the install diretory
# -------------------- # --------------------
# use, i.e. don't skip the full RPATH for the build tree # use, i.e. don't skip the full RPATH for the build tree
...@@ -93,19 +93,19 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c ...@@ -93,19 +93,19 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c
option( SCALFMM_BUILD_UTILS "Set to ON to build utils Tests" OFF ) option( SCALFMM_BUILD_UTILS "Set to ON to build utils Tests" OFF )
option( SCALFMM_BUILD_DOC "Set to ON to build the Doxygen documentation " OFF ) option( SCALFMM_BUILD_DOC "Set to ON to build the Doxygen documentation " OFF )
# Cmake options to install additional content # Cmake options to install additional content
option( SCALFMM_INSTALL_DATA "Set to ON to include the data when proceeding to the installtion " OFF ) option( SCALFMM_INSTALL_DATA "Set to ON to include the data when proceeding to the installtion " OFF )
# Cmake options related to trace, logging and statistics # Cmake options related to trace, logging and statistics
option( SCALFMM_USE_LOG "Set to ON to print output debug information" OFF ) option( SCALFMM_USE_LOG "Set to ON to print output debug information" OFF )
option( SCALFMM_USE_MEM_STATS "Set to ON to profile memory" OFF ) option( SCALFMM_USE_MEM_STATS "Set to ON to profile memory" OFF )
option( SCALFMM_USE_ASSERT "Set to ON to enable safe tests during execution" ON ) option( SCALFMM_USE_ASSERT "Set to ON to enable safe tests during execution" ON )
option( SCALFMM_ONLY_DEVEL "Set to ON to compile Development tools (only scalfmm team)" OFF ) option( SCALFMM_ONLY_DEVEL "Set to ON to compile Development tools (only scalfmm team)" OFF )
# Cmake options related to the targeted architecture # Cmake options related to the targeted architecture
option( SCALFMM_USE_MIC_NATIVE "Set to ON to compile in native mode for MIC" OFF ) option( SCALFMM_USE_MIC_NATIVE "Set to ON to compile in native mode for MIC" OFF )
# #
# Set scalfmm global lists # Set scalfmm global lists
...@@ -132,7 +132,7 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c ...@@ -132,7 +132,7 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c
message(WARNING "OPENMP NOT FOUND") message(WARNING "OPENMP NOT FOUND")
endif(OpenMP_CXX_FOUND) endif(OpenMP_CXX_FOUND)
endif(NOT OpenMP_CXX_FOUND) endif(NOT OpenMP_CXX_FOUND)
# #
# Inastemp # Inastemp
# -------- # --------
...@@ -143,9 +143,9 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c ...@@ -143,9 +143,9 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c
set(INASTEMP_JUST_LIB TRUE) set(INASTEMP_JUST_LIB TRUE)
set(INASTEMP_DO_INSTALL TRUE) set(INASTEMP_DO_INSTALL TRUE)
# Create target # Create target
add_subdirectory(inastemp) add_subdirectory(inastemp)
add_library(inastemp INTERFACE) add_library(inastemp INTERFACE)
target_include_directories(inastemp INTERFACE target_include_directories(inastemp INTERFACE
$<BUILD_INTERFACE:${INASTEMP_SOURCE_DIR}/Src> $<BUILD_INTERFACE:${INASTEMP_SOURCE_DIR}/Src>
$<BUILD_INTERFACE:${INASTEMP_BINARY_DIR}/Src> $<BUILD_INTERFACE:${INASTEMP_BINARY_DIR}/Src>
$<INSTALL_INTERFACE:include> $<INSTALL_INTERFACE:include>
...@@ -311,13 +311,13 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c ...@@ -311,13 +311,13 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c
endif() endif()
endif(SCALFMM_USE_BLAS) endif(SCALFMM_USE_BLAS)
# #
# FFT options # FFT options
# ----------- # -----------
CMAKE_DEPENDENT_OPTION(SCALFMM_USE_MKL_AS_FFTW "Set to ON to use MKL FFTW" ON "SCALFMM_USE_FFT;SCALFMM_USE_MKL_AS_BLAS" OFF ) CMAKE_DEPENDENT_OPTION(SCALFMM_USE_MKL_AS_FFTW "Set to ON to use MKL FFTW" ON "SCALFMM_USE_FFT;SCALFMM_USE_MKL_AS_BLAS" OFF )
CMAKE_DEPENDENT_OPTION(SCALFMM_USE_ESSL_AS_FFTW "Set to ON to use ESSL FFTW" ON "SCALFMM_USE_FFT;SCALFMM_USE_ESSL_AS_BLAS" OFF ) CMAKE_DEPENDENT_OPTION(SCALFMM_USE_ESSL_AS_FFTW "Set to ON to use ESSL FFTW" ON "SCALFMM_USE_FFT;SCALFMM_USE_ESSL_AS_BLAS" OFF )
if(SCALFMM_USE_FFT) if(SCALFMM_USE_FFT)
message(STATUS "SCALFMM USE FFT Configure:") message(STATUS "SCALFMM USE FFT Configure:")
...@@ -360,8 +360,8 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c ...@@ -360,8 +360,8 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c
# #
# C++ 2014 # C++ 2014
# -------- # --------
target_compile_features(${CMAKE_PROJECT_NAME} INTERFACE cxx_std_14) target_compile_features(${CMAKE_PROJECT_NAME} INTERFACE cxx_std_14)
# #
# Additional flags for the library # Additional flags for the library
# -------------------------------- # --------------------------------
...@@ -480,7 +480,7 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c ...@@ -480,7 +480,7 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c
# endif(SCALFMM_USE_STARPU) # endif(SCALFMM_USE_STARPU)
# list(APPEND FUSE_LIST "STARPU") # list(APPEND FUSE_LIST "STARPU")
# # Additional options for developers # # Additional options for developers
# if( SCALFMM_ONLY_DEVEL ) # if( SCALFMM_ONLY_DEVEL )
# if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") # if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
# option( SCALFMM_USE_OMP4 "Set to ON to disable the gcc/intel omp4" OFF ) # option( SCALFMM_USE_OMP4 "Set to ON to disable the gcc/intel omp4" OFF )
...@@ -514,7 +514,7 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c ...@@ -514,7 +514,7 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c
message(STATUS "ScalFMM final flags : ${SCALFMM_CXX_FLAGS}") message(STATUS "ScalFMM final flags : ${SCALFMM_CXX_FLAGS}")
# And adding flags to target # And adding flags to target
# -------------------------- # --------------------------
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE "${SCALFMM_CXX_FLAGS}") target_compile_options(${CMAKE_PROJECT_NAME} PUBLIC "${SCALFMM_CXX_FLAGS}")
# #
# Set ScalFMM dependencies # Set ScalFMM dependencies
...@@ -522,7 +522,7 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c ...@@ -522,7 +522,7 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c
string(REPLACE ";" " " SCALFMM_COMPILE_LIBS "${SCALFMM_LIBRARIES}") string(REPLACE ";" " " SCALFMM_COMPILE_LIBS "${SCALFMM_LIBRARIES}")
set(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES}" CACHE STRING "ScalFMM libraries dependencies") set(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES}" CACHE STRING "ScalFMM libraries dependencies")
message(STATUS "ScalFMM dependencies : ${SCALFMM_LIBRARIES}") message(STATUS "ScalFMM dependencies : ${SCALFMM_LIBRARIES}")
# # # #
# # Set ScalFMM link flags # # Set ScalFMM link flags
# # ---------------------- # # ----------------------
...@@ -548,7 +548,7 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c ...@@ -548,7 +548,7 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c
# ------------------------ # ------------------------
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/ScalFmmConfig.h.cmake configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/ScalFmmConfig.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/include/ScalFmmConfig.h) ${CMAKE_CURRENT_BINARY_DIR}/include/ScalFmmConfig.h)
# #
# Static analysis during build # Static analysis during build
# ---------------------------- # ----------------------------
...@@ -568,7 +568,7 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c ...@@ -568,7 +568,7 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c
) )
message(STATUS "CPPCHECK analysis is ON.") message(STATUS "CPPCHECK analysis is ON.")
endif() endif()
find_program(CLANGTIDY "clang-tidy") find_program(CLANGTIDY "clang-tidy")
if (CLANGTIDY) if (CLANGTIDY)
set(CMAKE_CXX_CLANG_TIDY "${CLANGTIDY};-checks=-*,boost-*,cppcoreguidelines-*,clang-analyser-cplusplus*,modernize-*,mpi-*,performance-*,portability-*,readability-*") set(CMAKE_CXX_CLANG_TIDY "${CLANGTIDY};-checks=-*,boost-*,cppcoreguidelines-*,clang-analyser-cplusplus*,modernize-*,mpi-*,performance-*,portability-*,readability-*")
...@@ -598,7 +598,7 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c ...@@ -598,7 +598,7 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c
if( SCALFMM_ONLY_DEVEL AND SCALFMM_BUILD_UTILS) if( SCALFMM_ONLY_DEVEL AND SCALFMM_BUILD_UTILS)
add_subdirectory(Utils) add_subdirectory(Utils)
endif() endif()
# #
# Build Tests to see examples # Build Tests to see examples
# ---------------------------- # ----------------------------
...@@ -625,16 +625,16 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c ...@@ -625,16 +625,16 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c
if(SCALFMM_BUILD_DOC) if(SCALFMM_BUILD_DOC)
add_subdirectory(Doc) add_subdirectory(Doc)
endif() endif()
# #
# Export Library # Export Library
# -------------- # --------------
install(TARGETS ${CMAKE_PROJECT_NAME} inastemp install(TARGETS ${CMAKE_PROJECT_NAME} inastemp
EXPORT ${CMAKE_PROJECT_NAME}-targets EXPORT ${CMAKE_PROJECT_NAME}-targets
LIBRARY DESTINATION lib LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin) RUNTIME DESTINATION bin)
install(DIRECTORY ${${CMAKE_PROJECT_NAME}_SOURCE_DIR}/include install(DIRECTORY ${${CMAKE_PROJECT_NAME}_SOURCE_DIR}/include
DESTINATION ${CMAKE_INSTALL_PREFIX} DESTINATION ${CMAKE_INSTALL_PREFIX}
PATTERN "ScalFmmConfig.h.cmake" EXCLUDE) PATTERN "ScalFmmConfig.h.cmake" EXCLUDE)
...@@ -669,7 +669,7 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c ...@@ -669,7 +669,7 @@ if(MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse_c
# -------------------------------------- # --------------------------------------
# See CPackConfig.cmake for the details. # See CPackConfig.cmake for the details.
include(CPack) include(CPack)
# #
# Print configure status # Print configure status
# ---------------------- # ----------------------
......
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