Commit 6d919f1f authored by GILLES Sebastien's avatar GILLES Sebastien

#1217 First executable is compiled. However it fails at runtime, but it's not...

#1217 First executable is compiled. However it fails at runtime, but it's not a surprise: in SCons I used a prelink trick I have to do again to make the code work with static libraries and my factory patterns.
parent df697747
......@@ -3,9 +3,11 @@ cmake_minimum_required(VERSION 3.8)
project( "MoReFEM_CMAKE")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
set (CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
......@@ -30,7 +32,18 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Sources /
${BOOST_INCL_DIR}
)
# TO complete for release mode! (see SCons)
add_definitions(-DOPS_WITH_EXCEPTION)
add_definitions(-DSELDON_WITH_LAPACK -DSELDON_WITH_LAPACK -DSELDON_WITH_BLAS -DSELDON_WITH_COMPILED_LIBRARY -DSELDON_CHECK_BOUNDS -DSELDON_CHECK_DIMENSIONS)
morefem_find_library(LIB_OPEN_MPI "mpi" ${OPEN_MPI_LIB_DIR} "Openmpi")
morefem_find_library(LIB_OPEN_MPI_CXX "mpi_cxx" ${OPEN_MPI_LIB_DIR} "Openmpi (C++)")
morefem_find_library(LIB_PETSC "petsc" ${PETSC_DEBUG_LIB_DIR} "Petsc")
morefem_find_library(LIB_PARMETIS "parmetis" ${PARMETIS_LIB_DIR} "Parmetis")
morefem_find_library(LIB_LUA "lua" ${LUA_LIB_DIR} "Lua")
morefem_find_library(LIB_BOOST_FILESYSTEM "boost_filesystem" ${BOOST_LIB_DIR} "Boost filesystem")
morefem_find_library(LIB_BOOST_SYSTEM "boost_system" ${BOOST_LIB_DIR} "Boost system")
add_subdirectory(Sources)
......
......@@ -69,7 +69,7 @@ def GenerateInModule(morefem_directory, subdirectory, library_name, ignore_list
for myfile in source_list:
SourceList.write("{}\"{}/{}\" / \n".format(tab_prefix, r"${CMAKE_CURRENT_LIST_DIR}", myfile))
SourceList.write("\n\tINTERFACE\n")
SourceList.write("\n\tPUBLIC\n")
for myfile in header_list:
SourceList.write("{}\"{}/{}\" / \n".format(tab_prefix, r"${CMAKE_CURRENT_LIST_DIR}", myfile))
......
add_library(morefem_utilities STATIC "")
include(Utilities/SourceList.cmake)
include(ThirdParty/SourceList.cmake)
#source_group(ThirdParty REGULAR_EXPRESSION "ThirdParty/*")
# add_library(morefem_core STATIC "")
# include(Core/SourceList.cmake)
# set_property(TARGET morefem_core PROPERTY FOLDER "Core")
#
# add_library(morefem_geometry STATIC "")
# include(Geometry/SourceList.cmake)
#
# add_library(morefem_felt STATIC "")
# include(FiniteElement/SourceList.cmake)
#
# add_library(morefem_param STATIC "")
# include(Parameters/SourceList.cmake)
#
# add_library(morefem_op STATIC "")
# include(Operators/SourceList.cmake)
#
# add_library(morefem_op_instances STATIC "")
# include(OperatorInstances/SourceList.cmake)
#
# add_library(morefem_param_instances STATIC "")
# include(ParameterInstances/SourceList.cmake)
#
# add_library(morefem_formulation_solver STATIC "")
# include(FormulationSolver/SourceList.cmake)
#
# add_library(morefem_model STATIC "")
# include(Model/SourceList.cmake)
#
# add_library(morefem_post_processing STATIC "")
# include(PostProcessing/SourceList.cmake)
include(ThirdParty/Ops.cmake)
include(ThirdParty/Seldon.cmake)
include(ThirdParty/Source/CMakeLists.txt)
add_library(morefem_core STATIC "")
include(Core/SourceList.cmake)
add_library(morefem_geometry STATIC "")
include(Geometry/SourceList.cmake)
add_library(morefem_felt STATIC "")
include(FiniteElement/SourceList.cmake)
add_library(morefem_param STATIC "")
include(Parameters/SourceList.cmake)
add_library(morefem_op STATIC "")
include(Operators/SourceList.cmake)
add_library(morefem_op_instances STATIC "")
include(OperatorInstances/SourceList.cmake)
add_library(morefem_param_instances STATIC "")
include(ParameterInstances/SourceList.cmake)
add_library(morefem_formulation_solver STATIC "")
include(FormulationSolver/SourceList.cmake)
add_library(morefem_model STATIC "")
include(Model/SourceList.cmake)
add_library(morefem_post_processing STATIC "")
include(PostProcessing/SourceList.cmake)
include(ModelInstances/CMakeLists.txt)
\ No newline at end of file
target_sources(morefem_core
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/NumberingSubsetForMatrix.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/NumberingSubsetForMatrix.hxx" /
)
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/EnsightCaseReader.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/EnsightCaseReader.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/EnsightCaseReader.hxx" /
)
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Section.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/Section.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/Section.hxx" /
)
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/DirichletBoundaryCondition.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/DirichletBoundaryCondition.hpp" /
)
target_sources(morefem_core
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/DirichletBoundaryCondition.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/DirichletBoundaryCondition.hxx" /
)
......
......@@ -5,7 +5,7 @@ target_sources(morefem_core
"${CMAKE_CURRENT_LIST_DIR}/NumberingSubset.cpp" /
"${CMAKE_CURRENT_LIST_DIR}/Unknown.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/FEltSpace.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/NumberingSubset.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/Unknown.hpp" /
......
target_sources(morefem_core
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/FEltSpace.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/FEltSpace.hxx" /
"${CMAKE_CURRENT_LIST_DIR}/NumberingSubset.hpp" /
......
......@@ -6,7 +6,7 @@ target_sources(morefem_core
"${CMAKE_CURRENT_LIST_DIR}/Mesh.cpp" /
"${CMAKE_CURRENT_LIST_DIR}/PseudoNormals.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/Domain.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/LightweightDomainList.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/Mesh.hpp" /
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/InterpolationFile.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/Domain.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/Domain.hxx" /
"${CMAKE_CURRENT_LIST_DIR}/InterpolationFile.hpp" /
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/InitialCondition.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/InitialCondition.hpp" /
)
target_sources(morefem_core
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/InitialCondition.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/InitialCondition.hxx" /
)
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/InitVertexMatching.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/InitVertexMatching.hpp" /
)
target_sources(morefem_core
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/InitVertexMatching.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/InitVertexMatching.hxx" /
)
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/AnalyticalPrestress.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/AnalyticalPrestress.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/AnalyticalPrestress.hxx" /
)
......
......@@ -5,7 +5,7 @@ target_sources(morefem_core
"${CMAKE_CURRENT_LIST_DIR}/Diffusion.cpp" /
"${CMAKE_CURRENT_LIST_DIR}/TransfertCoefficient.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/Diffusion.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/Diffusion.hxx" /
)
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/ElectricalActivation.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/ElectricalActivation.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/ElectricalActivation.hxx" /
)
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Fiber.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/Fiber.hpp" /
)
target_sources(morefem_core
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/Fiber.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/Fiber.hxx" /
)
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Fluid.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/Fluid.hpp" /
)
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Heart.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/Heart.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/Heart.hxx" /
)
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/ParameterUsualDescription.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/ParameterUsualDescription.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/ParameterUsualDescription.hxx" /
)
......
target_sources(morefem_core
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/VolumicMass.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/VolumicMass.hxx" /
)
......
......@@ -12,7 +12,7 @@ target_sources(morefem_core
"${CMAKE_CURRENT_LIST_DIR}/Viscosity.cpp" /
"${CMAKE_CURRENT_LIST_DIR}/YoungModulus.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/Solid.hpp" /
)
......@@ -4,7 +4,7 @@ target_sources(morefem_core
"${CMAKE_CURRENT_LIST_DIR}/RectangularSourceTimeParameter.cpp" /
"${CMAKE_CURRENT_LIST_DIR}/TransientSource.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/RectangularSourceTimeParameter.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/TransientSource.hpp" /
)
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Pressure.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/Pressure.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/Pressure.hxx" /
"${CMAKE_CURRENT_LIST_DIR}/RectangularSourceTimeParameter.hpp" /
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/SpatialFunction.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/SpatialFunction.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/SpatialFunction.hxx" /
)
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/ViscoelasticBoundaryCondition.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/ViscoelasticBoundaryCondition.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/ViscoelasticBoundaryCondition.hxx" /
)
......
......@@ -5,7 +5,7 @@ target_sources(morefem_core
"${CMAKE_CURRENT_LIST_DIR}/MitchellSchaeffer.cpp" /
"${CMAKE_CURRENT_LIST_DIR}/ReactionCoefficient.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/FitzHughNagumo.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/FitzHughNagumo.hxx" /
"${CMAKE_CURRENT_LIST_DIR}/MitchellSchaeffer.hpp" /
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Petsc.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/Petsc.hpp" /
)
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/ConvergenceTest.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/ConvergenceTest.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/ConvergenceTest.hxx" /
"${CMAKE_CURRENT_LIST_DIR}/Petsc.hpp" /
......
......@@ -4,7 +4,7 @@ target_sources(morefem_core
"${CMAKE_CURRENT_LIST_DIR}/InitialConditionGate.cpp" /
"${CMAKE_CURRENT_LIST_DIR}/Result.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/InitialConditionGate.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/OutputDeformedMesh.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/OutputDeformedMesh.hxx" /
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/TimeManager.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/TimeManager.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/TimeManager.hxx" /
)
......
target_sources(morefem_core
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/SetFromInputParameterData.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/SetFromInputParameterData.hxx" /
)
......
target_sources(morefem_core
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/InputParameterList.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/InputParameterList.hxx" /
)
......
......@@ -5,7 +5,7 @@ target_sources(morefem_core
"${CMAKE_CURRENT_LIST_DIR}/GlobalMatrix.cpp" /
"${CMAKE_CURRENT_LIST_DIR}/GlobalVector.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/GlobalDiagonalMatrix.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/GlobalDiagonalMatrix.hxx" /
"${CMAKE_CURRENT_LIST_DIR}/GlobalMatrix.hpp" /
......
target_sources(morefem_core
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/MoReFEMData.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/MoReFEMData.hxx" /
)
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/NumberingSubsetManager.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/FetchFunction.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/FetchFunction.hxx" /
"${CMAKE_CURRENT_LIST_DIR}/FindFunctor.hpp" /
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/NumberingSubset.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/NumberingSubset.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/NumberingSubset.hxx" /
)
......
target_sources(morefem_core
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/Solver.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/Solver.hxx" /
)
......
......@@ -3,7 +3,7 @@ target_sources(morefem_core
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/InitTimeKeepLog.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/Enum.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/InitTimeKeepLog.hpp" /
)
......
......@@ -4,7 +4,7 @@ target_sources(morefem_core
"${CMAKE_CURRENT_LIST_DIR}/ConstantTimeStep.cpp" /
"${CMAKE_CURRENT_LIST_DIR}/VariableTimeStep.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/ConstantTimeStep.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/ConstantTimeStep.hxx" /
"${CMAKE_CURRENT_LIST_DIR}/VariableTimeStep.hpp" /
......
......@@ -4,7 +4,7 @@ target_sources(morefem_core
"${CMAKE_CURRENT_LIST_DIR}/TimeManager.cpp" /
"${CMAKE_CURRENT_LIST_DIR}/TimeManagerInstance.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/TimeManager.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/TimeManager.hxx" /
"${CMAKE_CURRENT_LIST_DIR}/TimeManagerInstance.hpp" /
......
......@@ -12,7 +12,7 @@ target_sources(morefem_felt
"${CMAKE_CURRENT_LIST_DIR}/ComponentFactory.cpp" /
"${CMAKE_CURRENT_LIST_DIR}/ComponentManager.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/Comp1.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/Comp12.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/Comp123.hpp" /
......
......@@ -3,7 +3,7 @@ target_sources(morefem_felt
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/DofStorage.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/DofStorage.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/DofStorage.hxx" /
)
......
......@@ -4,7 +4,7 @@ target_sources(morefem_felt
"${CMAKE_CURRENT_LIST_DIR}/DirichletBoundaryCondition.cpp" /
"${CMAKE_CURRENT_LIST_DIR}/DirichletBoundaryConditionManager.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/DirichletBoundaryCondition.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/DirichletBoundaryCondition.hxx" /
"${CMAKE_CURRENT_LIST_DIR}/DirichletBoundaryConditionManager.hpp" /
......
......@@ -3,7 +3,7 @@ target_sources(morefem_felt
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Local2GlobalStorage.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/Local2GlobalStorage.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/Local2GlobalStorage.hxx" /
)
......
......@@ -4,7 +4,7 @@ target_sources(morefem_felt
"${CMAKE_CURRENT_LIST_DIR}/FElt.cpp" /
"${CMAKE_CURRENT_LIST_DIR}/LocalFEltSpace.cpp" /
INTERFACE
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/FElt.hpp" /
"${CMAKE_CURRENT_LIST_DIR}/FElt.hxx" /
"${CMAKE_CURRENT_LIST_DIR}/LocalFEltSpace.hpp" /
......