-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists3.txt
117 lines (96 loc) · 5.76 KB
/
CMakeLists3.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
set(CMAKE_INCLUDE_CURRENT_DIR ON)
################### PYBIND11
include(pybind11Tools)
include_directories( ${CMAKE_SOURCE_DIR}/kratos )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. )
add_definitions(-DSD_APP_FORWARD_COMPATIBILITY)
## Structural Core sources
set(KRATOS_STRUCTURAL_APPLICATION_CORE
${CMAKE_CURRENT_SOURCE_DIR}/structural_application.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_python3/legacy_structural_app_vars.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_python3/structural_application_variables3.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_conditions/pointforce2D.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_conditions/pointmoment3D.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_conditions/pointforce3D.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_conditions/face2D.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_conditions/face3D.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_conditions/face_pressure3D.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_conditions/face_pressure3D_total_lagrangian.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_conditions/face_traction3D.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_conditions/faceforce3D.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_conditions/line_force.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_conditions/line_pressure.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_conditions/line_traction.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_conditions/pile_kinematic_linear.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_conditions/tip_condition.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_conditions/foundation_condition.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_elements/crisfield_truss_element.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_elements/truss_element.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_elements/beam_element.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_elements/timoshenko_beam_element.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_elements/timoshenko_linear_beam_element.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_elements/eas_element_q4e4.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_elements/kinematic_linear.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_elements/kinematic_linear_axisymmetric.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_elements/total_lagrangian.cpp
${CMAKE_CURRENT_SOURCE_DIR}/constitutive_laws/dummy_constitutive_law.cpp
${CMAKE_CURRENT_SOURCE_DIR}/constitutive_laws/plane_strain.cpp
${CMAKE_CURRENT_SOURCE_DIR}/constitutive_laws/plane_stress.cpp
${CMAKE_CURRENT_SOURCE_DIR}/constitutive_laws/isotropic_3d.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_utilities/eig/eig3.cpp
)
## Structural testing sources
if(${KRATOS_BUILD_TESTING} MATCHES ON)
file(GLOB_RECURSE KRATOS_STRUCTURAL_APPLICATION_TESTING_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tests_python3/*.cpp)
endif(${KRATOS_BUILD_TESTING} MATCHES ON)
## Structural python interface sources
set(KRATOS_STRUCTURAL_APPLICATION_PYTHON_INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/custom_python3/add_constitutive_laws_to_python.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_python3/add_custom_utilities_to_python.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_python3/add_custom_processes_to_python.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_python3/add_custom_strategies_to_python.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_python3/structural_python_application.cpp
)
add_library(KratosStructuralCore SHARED ${KRATOS_STRUCTURAL_APPLICATION_CORE} ${KRATOS_STRUCTURAL_APPLICATION_TESTING_SOURCES})
target_link_libraries(KratosStructuralCore PUBLIC KratosCore)
set_target_properties(KratosStructuralCore PROPERTIES COMPILE_DEFINITIONS "STRUCTURAL_APPLICATION=EXPORT,API")
###############################################################
## define library Kratos which defines the basic python interface
pybind11_add_module(KratosStructuralApplication MODULE THIN_LTO ${KRATOS_STRUCTURAL_APPLICATION_PYTHON_INTERFACE})
target_link_libraries(KratosStructuralApplication PUBLIC KratosStructuralCore)
set_target_properties(KratosStructuralApplication PROPERTIES PREFIX "")
# Set batch size in the unity build
IF(CMAKE_UNITY_BUILD MATCHES ON)
set_target_properties(KratosStructuralCore PROPERTIES UNITY_BUILD_BATCH_SIZE ${KRATOS_UNITY_BUILD_BATCH_SIZE})
set_target_properties(KratosStructuralApplication PROPERTIES UNITY_BUILD_BATCH_SIZE ${KRATOS_UNITY_BUILD_BATCH_SIZE})
ENDIF(CMAKE_UNITY_BUILD MATCHES ON)
# changing the .dll suffix to .pyd (Windows)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set_target_properties(KratosStructuralApplication PROPERTIES SUFFIX .pyd)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
# changing the .dylib suffix to .so (OS X)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set_target_properties(KratosStructuralApplication PROPERTIES SUFFIX .so)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# # Cotire
# if(USE_COTIRE MATCHES ON)
# cotire(KratosStructuralCore)
# cotire(KratosStructuralApplication)
# endif(USE_COTIRE MATCHES ON)
# Add to the KratosMultiphisics Python module
kratos_python_install(${INSTALL_PYTHON_USING_LINKS} ${CMAKE_CURRENT_SOURCE_DIR}/StructuralApplication3.py KratosMultiphysics/StructuralApplication/__init__.py )
# Install python files
kratos_python_install_directory(${INSTALL_PYTHON_USING_LINKS} ${CMAKE_CURRENT_SOURCE_DIR}/python_scripts3 KratosMultiphysics/StructuralApplication )
# Kratos Testing. Install everything except sources to ensure that reference and configuration files are copied.
if(${INSTALL_TESTING_FILES} MATCHES ON )
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests_python3 DESTINATION applications/StructuralApplication
PATTERN "*.git" EXCLUDE
PATTERN "*.c" EXCLUDE
PATTERN "*.h" EXCLUDE
PATTERN "*.cpp" EXCLUDE
PATTERN "*.hpp" EXCLUDE
)
endif(${INSTALL_TESTING_FILES} MATCHES ON)
# Install targets
install(TARGETS KratosStructuralCore DESTINATION libs )
install(TARGETS KratosStructuralApplication DESTINATION libs )