Skip to content

Commit

Permalink
Added install commands for header files to leaf CMakeLists fies
Browse files Browse the repository at this point in the history
  • Loading branch information
ddement committed Jan 18, 2025
1 parent b6265df commit f733875
Show file tree
Hide file tree
Showing 28 changed files with 298 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
# Project declaration
project(
OpenTurbine
VERSION 0.0.0
VERSION 0.1.0
DESCRIPTION "A flexible multibody structural dynamics code for wind turbines"
LANGUAGES CXX
)
Expand Down
23 changes: 15 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ if(TARGET MPI::MPI_CXX)
target_link_system_libraries(openturbine_library PUBLIC
MPI::MPI_CXX
)
target_link_system_libraries(openturbine_library INTERFACE
MPI::MPI_CXX
)
endif()

# Include shared libraries for the OpenTurbine library
Expand All @@ -56,14 +59,16 @@ target_include_directories(openturbine_library
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src> # Include source directory during build
)

target_include_directories(openturbine_library INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>)
target_include_directories(openturbine_library INTERFACE $<INSTALL_INTERFACE:include/OpenTurbine>)

# Set the C++ standard for the target
target_compile_features(openturbine_library PUBLIC cxx_std_17)

# Add subdirectories for additional components of the library
add_subdirectory(constraints)
add_subdirectory(dof_management)
add_subdirectory(elements)
add_subdirectory(interfaces)
add_subdirectory(math)
add_subdirectory(model)
add_subdirectory(solver)
Expand All @@ -73,20 +78,22 @@ add_subdirectory(system)
add_subdirectory(utilities)
add_subdirectory(vendor)

add_subdirectory(interfaces/cfd)

set(openturbine_public_headers "interfaces/cfd/interface.hpp")
set_target_properties(openturbine_library PROPERTIES PUBLIC_HEADER "${openturbine_public_headers}")

install(
TARGETS openturbine_library openturbine_options openturbine_warnings
EXPORT OpenTurbineTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${PACKAGE_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

install(EXPORT OpenTurbineTargets
FILE OpenTurbineTargets.cmake
NAMESPACE OpenTurbine::
DESTINATION lib/cmake/OpenTurbine)
DESTINATION lib/cmake/OpenTurbine
)

install(FILES
types.hpp
DESTINATION include/OpenTurbine/
)
19 changes: 18 additions & 1 deletion src/constraints/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
target_sources(openturbine_library PRIVATE)
set(openturbine_public_headers "${openturbine_public_headers}" "constraints/calculate_constraint_force.hpp")

install(FILES
calculate_constraint_force.hpp
calculate_constraint_output.hpp
calculate_constraint_residual_gradient.hpp
calculate_fixed_bc_constraint.hpp
calculate_prescribed_bc_constraint.hpp
calculate_revolute_joint_constraint.hpp
calculate_revolute_joint_force.hpp
calculate_revolute_joint_output.hpp
calculate_rigid_joint_constraint.hpp
calculate_rotation_control_constraint.hpp
constraint.hpp
constraints.hpp
constraint_type.hpp
update_lambda_prediction.hpp
DESTINATION include/OpenTurbine/constraints
)
12 changes: 12 additions & 0 deletions src/dof_management/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
target_sources(openturbine_library
PRIVATE
)

install(FILES
assemble_node_freedom_allocation_table.hpp
compute_node_freedom_map_table.hpp
create_constraint_freedom_table.hpp
create_element_freedom_table.hpp
freedom_signature.hpp
DESTINATION include/OpenTurbine/dof_management
)
6 changes: 6 additions & 0 deletions src/elements/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
target_sources(openturbine_library PRIVATE)

install(FILES
elements.hpp
DESTINATION include/OpenTurbine/elements
)

add_subdirectory(beams)
add_subdirectory(masses)
add_subdirectory(springs)
21 changes: 21 additions & 0 deletions src/elements/beams/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
target_sources(openturbine_library PRIVATE)

install(FILES
beam_element.hpp
beam_section.hpp
beams.hpp
beams_input.hpp
calculate_jacobian.hpp
calculate_QP_deformation.hpp
calculate_QP_position.hpp
create_beams.hpp
interpolate_QP_position.hpp
interpolate_QP_rotation_derivative.hpp
interpolate_QP_rotation.hpp
interpolate_QP_state.hpp
interpolate_QP_vector.hpp
interpolate_to_quadrature_points.hpp
interpolation.hpp
interpolation_operations.hpp
populate_element_views.hpp
DESTINATION include/OpenTurbine/elements/beams/
)
8 changes: 8 additions & 0 deletions src/elements/masses/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
target_sources(openturbine_library PRIVATE)

install(FILES
create_masses.hpp
mass_element.hpp
masses.hpp
masses_input.hpp
DESTINATION include/OpenTurbine/elements/masses/
)
9 changes: 9 additions & 0 deletions src/elements/springs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
target_sources(openturbine_library PRIVATE)

install(FILES
create_springs.hpp
spring_element.hpp
springs.hpp
springs_input.hpp
DESTINATION include/OpenTurbine/elements/springs/
)
1 change: 1 addition & 0 deletions src/interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(cfd)
13 changes: 13 additions & 0 deletions src/interfaces/cfd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,16 @@ target_sources(openturbine_library
PRIVATE
interface.cpp
)

install(FILES
floating_platform.hpp
floating_platform_input.hpp
interface.hpp
interface_input.hpp
mooring_line.hpp
mooring_line_input.hpp
node_data.hpp
turbine.hpp
turbine_input.hpp
DESTINATION include/OpenTurbine/interfaces/cfd/
)
3 changes: 2 additions & 1 deletion src/interfaces/cfd/floating_platform.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "vector"
#include <cstddef>
#include <vector>

#include "interfaces/cfd/mooring_line.hpp"
#include "interfaces/cfd/node_data.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/cfd/interface_input.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <array>
#include <cstddef>

#include "interfaces/cfd/turbine_input.hpp"

Expand Down
2 changes: 2 additions & 0 deletions src/interfaces/cfd/mooring_line.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <cstddef>

#include "node_data.hpp"

namespace openturbine::cfd {
Expand Down
3 changes: 2 additions & 1 deletion src/interfaces/cfd/node_data.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "array"
#include <array>
#include <cstddef>

namespace openturbine::cfd {

Expand Down
8 changes: 8 additions & 0 deletions src/math/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
target_sources(openturbine_library PRIVATE)

install(FILES
least_squares_fit.hpp
matrix_operations.hpp
quaternion_operations.hpp
vector_operations.hpp
DESTINATION include/OpenTurbine/math
)
7 changes: 7 additions & 0 deletions src/model/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
target_sources(openturbine_library PRIVATE)

install(FILES
copy_nodes_to_state.hpp
model.hpp
node.hpp
DESTINATION include/OpenTurbine/model/
)
46 changes: 46 additions & 0 deletions src/solver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,47 @@
target_sources(openturbine_library PRIVATE)

install(FILES
calculate_error_sum_squares.hpp
compute_b_num_non_zero.hpp
compute_k_col_inds.hpp
compute_k_num_non_zero.hpp
compute_k_row_ptrs.hpp
compute_number_of_non_zeros_constraints.hpp
compute_num_system_dofs.hpp
compute_t_col_inds.hpp
compute_t_num_non_zero.hpp
compute_t_row_ptrs.hpp
condition_system.hpp
contribute_beams_to_sparse_matrix.hpp
contribute_beams_to_vector.hpp
contribute_constraints_system_residual_to_vector.hpp
contribute_elements_to_sparse_matrix.hpp
contribute_elements_to_vector.hpp
contribute_forces_to_vector.hpp
contribute_masses_to_sparse_matrix.hpp
contribute_masses_to_vector.hpp
contribute_springs_to_sparse_matrix.hpp
contribute_springs_to_vector.hpp
copy_constraints_residual_to_vector.hpp
copy_constraints_to_sparse_matrix.hpp
copy_into_sparse_matrix.hpp
copy_into_sparse_matrix_transpose.hpp
copy_sparse_values_to_transpose.hpp
copy_tangent_to_sparse_matrix.hpp
create_b_matrix.hpp
create_b_t_matrix.hpp
create_constraints_matrix_full.hpp
create_global_matrix.hpp
create_k_matrix.hpp
create_matrix_spadd.hpp
create_matrix_spgemm.hpp
create_sparse_dense_solver.hpp
create_system_matrix_full.hpp
create_t_matrix.hpp
create_transpose_matrix_full.hpp
fill_unshifted_row_ptrs.hpp
populate_sparse_row_ptrs_col_inds_constraints.hpp
populate_sparse_row_ptrs_col_inds_transpose.hpp
solver.hpp
DESTINATION include/OpenTurbine/solver/
)
14 changes: 14 additions & 0 deletions src/state/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
target_sources(openturbine_library PRIVATE)

install(FILES
calculate_displacement.hpp
calculate_next_state.hpp
clone_state.hpp
copy_state_data.hpp
set_node_external_loads.hpp
state.hpp
update_algorithmic_acceleration.hpp
update_dynamic_prediction.hpp
update_global_position.hpp
update_static_prediction.hpp
DESTINATION include/OpenTurbine/state/
)
33 changes: 33 additions & 0 deletions src/step/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,34 @@
target_sources(openturbine_library PRIVATE)

install(FILES
assemble_constraints_matrix.hpp
assemble_constraints_residual.hpp
assemble_inertia_matrix_beams.hpp
assemble_inertia_matrix_masses.hpp
assemble_residual_vector_beams.hpp
assemble_residual_vector_masses.hpp
assemble_residual_vector_springs.hpp
assemble_stiffness_matrix_beams.hpp
assemble_stiffness_matrix_masses.hpp
assemble_stiffness_matrix_springs.hpp
assemble_system_matrix.hpp
assemble_system_residual_beams.hpp
assemble_system_residual.hpp
assemble_system_residual_masses.hpp
assemble_tangent_operator.hpp
calculate_convergence_error.hpp
predict_next_state.hpp
reset_constraints.hpp
solve_system.hpp
step.hpp
step_parameters.hpp
update_constraint_prediction.hpp
update_constraint_variables.hpp
update_state_prediction.hpp
update_system_variables_beams.hpp
update_system_variables.hpp
update_system_variables_masses.hpp
update_system_variables_springs.hpp
update_tangent_operator.hpp
DESTINATION include/OpenTurbine/step/
)
9 changes: 7 additions & 2 deletions src/system/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
target_sources(openturbine_library PRIVATE)

add_subdirectory(springs)
add_subdirectory(masses)
install(FILES
calculate_tangent_operator.hpp
DESTINATION include/OpenTurbine/system/
)

add_subdirectory(beams)
add_subdirectory(masses)
add_subdirectory(springs)
23 changes: 23 additions & 0 deletions src/system/beams/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
target_sources(openturbine_library PRIVATE)

install(FILES
calculate_force_FC.hpp
calculate_force_FD.hpp
calculate_gravity_force.hpp
calculate_gyroscopic_matrix.hpp
calculate_inertial_force.hpp
calculate_inertia_stiffness_matrix.hpp
calculate_mass_matrix_components.hpp
calculate_Ouu.hpp
calculate_Puu.hpp
calculate_quadrature_point_values.hpp
calculate_Quu.hpp
calculate_RR0.hpp
calculate_strain.hpp
calculate_temporary_variables.hpp
integrate_inertia_matrix.hpp
integrate_residual_vector.hpp
integrate_stiffness_matrix.hpp
rotate_section_matrix.hpp
update_node_state.hpp
DESTINATION include/OpenTurbine/system/beams/
)
13 changes: 13 additions & 0 deletions src/system/masses/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
target_sources(openturbine_library PRIVATE)

install(FILES
calculate_gravity_force.hpp
calculate_gyroscopic_matrix.hpp
calculate_inertial_force.hpp
calculate_inertia_stiffness_matrix.hpp
calculate_mass_matrix_components.hpp
calculate_QP_position.hpp
calculate_RR0.hpp
rotate_section_matrix.hpp
update_node_state.hpp
DESTINATION include/OpenTurbine/system/masses
)
10 changes: 10 additions & 0 deletions src/system/springs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
target_sources(openturbine_library PRIVATE)

install(FILES
calculate_distance_components.hpp
calculate_force_coefficients.hpp
calculate_force_vectors.hpp
calculate_length.hpp
calculate_stiffness_matrix.hpp
update_node_state.hpp
DESTINATION include/OpenTurbine/system/springs/
)
3 changes: 2 additions & 1 deletion src/utilities/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
add_subdirectory(controllers)
add_subdirectory(aerodynamics)
add_subdirectory(controllers)
Loading

0 comments on commit f733875

Please sign in to comment.