Commit c65400d5 authored by GILLES Sebastien's avatar GILLES Sebastien

#1220 CMake: current build make the config 'work', even if it's far to be satisfactory.

parent 60437958
......@@ -28,6 +28,7 @@ endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# TODO SHould disappear (in compiler...)
# From http://cmake.3232098.n2.nabble.com/Default-value-for-CMAKE-BUILD-TYPE-td7550756.html#a7550797
# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
......@@ -49,30 +50,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/cmake)
project( "MoReFEM_CMAKE")
include(CustomCommands)
# All --all_load in target_link_libraries of executables if STATIC library are chosen.
if(LIBRARY_TYPE MATCHES STATIC)
set(ALL_LOAD_FLAG "-all_load")
else()
set(ALL_LOAD_FLAG "")
endif()
MESSAGE("Generated with config types: ${CMAKE_CONFIGURATION_TYPES}")
include(Compiler)
# Add LTO support in non debug mode.
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)
set(PETSC_SPECIFIC_INCL_DIR ${PETSC_DEBUG_INCL_DIR} )
set(PETSC_SPECIFIC_LIB_DIR ${PETSC_DEBUG_LIB_DIR} )
add_definitions(-DSELDON_CHECK_BOUNDS -DSELDON_CHECK_DIMENSIONS -DDEBUG=1)
else()
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
set(PETSC_SPECIFIC_INCL_DIR ${PETSC_RELEASE_INCL_DIR} )
set(PETSC_SPECIFIC_LIB_DIR ${PETSC_RELEASE_LIB_DIR} )
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Sources /
${CMAKE_CURRENT_SOURCE_DIR}/Sources/ThirdParty/Source/Tclap/include /
......@@ -86,8 +65,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Sources /
${BOOST_INCL_DIR}
)
add_definitions(-DOPS_WITH_EXCEPTION)
add_definitions(-DSELDON_WITH_LAPACK -DSELDON_WITH_BLAS -DSELDON_WITH_COMPILED_LIBRARY)
morefem_find_library(LIB_OPEN_MPI "mpi" ${OPEN_MPI_LIB_DIR} "Openmpi")
......
......@@ -69,7 +69,8 @@ def GenerateInModule(morefem_directory, subdirectory, module_alias, ignore_list
for myfile in source_list:
SourceList.write("{}\"{}/{}\"\n".format(tab_prefix, r"${CMAKE_CURRENT_LIST_DIR}", myfile))
SourceList.write("\n\tPUBLIC\n")
# PUBLIC would be better for IDE but I don't know how to make it work with FindMoReFEM functionality.
SourceList.write("\n\tPRIVATE\n")
for myfile in header_list:
SourceList.write("{}\"{}/{}\"\n".format(tab_prefix, r"${CMAKE_CURRENT_LIST_DIR}", myfile))
......
......@@ -65,6 +65,9 @@ include(PostProcessing/CMakeLists.txt)
include(ModelInstances/CMakeLists.txt)
include(Test/CMakeLists.txt)
# Tclap
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/ DESTINATION ${MOREFEM_INSTALL_DIR_INCL}
FILES_MATCHING PATTERN "*.h")
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/ DESTINATION ${MOREFEM_INSTALL_DIR_INCL}
FILES_MATCHING PATTERN "*.hpp")
......@@ -106,9 +109,10 @@ include(CMakePackageConfigHelpers)
#set(MoReFEM_CMAKE_INCLUDE_DIRS ${MOREFEM_INSTALL_DIR_INCL})
install(TARGETS morefem_cmake ${MOREFEM_MODEL}
install(TARGETS morefem_cmake ${MOREFEM_MODEL} Ops Seldon
EXPORT ${PROJECT_NAME}-targets
LIBRARY DESTINATION ${MOREFEM_INSTALL_DIR_LIB}
ARCHIVE DESTINATION ${MOREFEM_INSTALL_DIR_LIB}
)
#
# # Makes the project importable from the build directory
......
target_sources(${MOREFEM_CORE}
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/DirichletBoundaryCondition.hpp"
)
target_sources(${MOREFEM_CORE}
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/FEltSpace.hpp"
"${CMAKE_CURRENT_LIST_DIR}/NumberingSubset.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Unknown.hpp"
......
target_sources(${MOREFEM_CORE}
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/InitialCondition.hpp"
)
target_sources(${MOREFEM_CORE}
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/InitVertexMatching.hpp"
)
target_sources(${MOREFEM_CORE}
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Fiber.hpp"
)
target_sources(${MOREFEM_CORE}
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Fluid.hpp"
)
......@@ -3,7 +3,7 @@ target_sources(${MOREFEM_CORE}
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Heart.cpp"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/ParameterUsualDescription.hpp"
"${CMAKE_CURRENT_LIST_DIR}/ParameterUsualDescription.hxx"
)
......
target_sources(${MOREFEM_CORE}
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Petsc.hpp"
)
......@@ -3,7 +3,7 @@ target_sources(${MOREFEM_CORE}
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/ConvergenceTest.cpp"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/TimeManager.hpp"
"${CMAKE_CURRENT_LIST_DIR}/TimeManager.hxx"
)
......
target_sources(${MOREFEM_CORE}
PUBLIC
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/SetFromInputParameterData.hpp"
"${CMAKE_CURRENT_LIST_DIR}/SetFromInputParameterData.hxx"
)
......
target_sources(${MOREFEM_CORE}
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/GlobalDiagonalMatrix.hpp"
"${CMAKE_CURRENT_LIST_DIR}/GlobalDiagonalMatrix.hxx"
"${CMAKE_CURRENT_LIST_DIR}/GlobalMatrix.hpp"
......
target_sources(${MOREFEM_CORE}
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/NumberingSubset.hpp"
"${CMAKE_CURRENT_LIST_DIR}/NumberingSubset.hxx"
)
......
target_sources(${MOREFEM_CORE}
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"
PUBLIC
PRIVATE
"${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"