more direct and readable

This commit is contained in:
Martin Diehl 2019-04-29 11:15:23 +02:00
parent 477478f66c
commit 39e6cedfb4
1 changed files with 13 additions and 24 deletions

View File

@ -4,30 +4,26 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
SET_SOURCE_FILES_PROPERTIES("lattice.f90" PROPERTIES COMPILE_FLAGS "-ffree-line-length-240") SET_SOURCE_FILES_PROPERTIES("lattice.f90" PROPERTIES COMPILE_FLAGS "-ffree-line-length-240")
endif() endif()
file(GLOB_RECURSE sources *.f90 *.c) file(GLOB damask-sources *.f90 *.c)
# probably we should have subfolders for abaqus and MSC.Marc # probably we should have subfolders for abaqus and MSC.Marc
list(FILTER sources EXCLUDE REGEX ".*CPFEM\\.f90") list(FILTER damask-sources EXCLUDE REGEX ".*CPFEM.f90")
list(FILTER sources EXCLUDE REGEX ".*DAMASK_marc.*\\.f90") list(FILTER damask-sources EXCLUDE REGEX ".*DAMASK_marc.*.f90")
list(FILTER sources EXCLUDE REGEX ".*mesh_marc.*\\.f90") list(FILTER damask-sources EXCLUDE REGEX ".*mesh_marc.*.f90")
list(FILTER sources EXCLUDE REGEX ".*mesh_abaqus.*\\.f90") list(FILTER damask-sources EXCLUDE REGEX ".*mesh_abaqus.*.f90")
list(FILTER sources EXCLUDE REGEX ".*commercialFEM_fileList.*\\.f90") list(FILTER damask-sources EXCLUDE REGEX ".*commercialFEM_fileList.*.f90")
if (PROJECT_NAME STREQUAL "damask-grid") if (PROJECT_NAME STREQUAL "damask-grid")
# probably we should have subfolders for FEM and spectral list(FILTER damask-sources EXCLUDE REGEX ".*mesh_FEM.*.f90")
list(FILTER sources EXCLUDE REGEX ".*DAMASK_FEM.*\\.f90") file(GLOB grid-sources grid/*.f90)
list(FILTER sources EXCLUDE REGEX ".*FEM_utilities.*\\.f90")
list(FILTER sources EXCLUDE REGEX ".*FEM_zoo.*\\.f90")
list(FILTER sources EXCLUDE REGEX ".*mesh_FEM.*\\.f90")
list(FILTER sources EXCLUDE REGEX ".*FEM_mech.*\\.f90")
if(NOT CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY") if(NOT CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY")
add_executable(DAMASK_spectral ${sources}) add_executable(DAMASK_spectral ${damask-sources} ${grid-sources})
install (TARGETS DAMASK_spectral RUNTIME DESTINATION bin) install (TARGETS DAMASK_spectral RUNTIME DESTINATION bin)
else() else()
add_library(DAMASK_spectral OBJECT ${sources}) add_library(DAMASK_spectral OBJECT ${damask-sources} ${grid-sources})
exec_program (mktemp OUTPUT_VARIABLE nothing) exec_program (mktemp OUTPUT_VARIABLE nothing)
exec_program (mktemp ARGS -d OUTPUT_VARIABLE black_hole) exec_program (mktemp ARGS -d OUTPUT_VARIABLE black_hole)
install (PROGRAMS ${nothing} DESTINATION ${black_hole}) install (PROGRAMS ${nothing} DESTINATION ${black_hole})
@ -35,17 +31,10 @@ if (PROJECT_NAME STREQUAL "damask-grid")
elseif (PROJECT_NAME STREQUAL "damask-mesh") elseif (PROJECT_NAME STREQUAL "damask-mesh")
# probably we should have subfolders for FEM and spectral list(FILTER damask-sources EXCLUDE REGEX ".*mesh_grid.*.f90")
list(FILTER sources EXCLUDE REGEX ".*DAMASK_grid.*\\.f90") file(GLOB mesh-sources mesh/*.f90)
list(FILTER sources EXCLUDE REGEX ".*grid_mech_FEM.*\\.f90")
list(FILTER sources EXCLUDE REGEX ".*grid_mech_spectral_basic.*\\.f90")
list(FILTER sources EXCLUDE REGEX ".*grid_mech_spectral_polarisation.*\\.f90")
list(FILTER sources EXCLUDE REGEX ".*grid_damage_spectral.*\\.f90")
list(FILTER sources EXCLUDE REGEX ".*grid_thermal_spectral.*\\.f90")
list(FILTER sources EXCLUDE REGEX ".*spectral_utilities.*\\.f90")
list(FILTER sources EXCLUDE REGEX ".*mesh_grid.*\\.f90")
add_executable(DAMASK_FEM ${sources}) add_executable(DAMASK_FEM ${damask-sources} ${mesh-sources})
install (TARGETS DAMASK_FEM RUNTIME DESTINATION bin) install (TARGETS DAMASK_FEM RUNTIME DESTINATION bin)
endif() endif()