Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GeoMechanicsApplication] gtests #11896

Closed
wants to merge 53 commits into from
Closed
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
cfdbe49
Prepare to build gtests
roigcarlo Jul 25, 2023
0c6e1ee
Removing references to runkratos
roigcarlo Jul 25, 2023
0eec903
Enable gtesting
roigcarlo Jul 25, 2023
622723b
Add target for the core
roigcarlo Jul 25, 2023
a48cce7
Moving mpi related test utilities out of the core
roigcarlo Jul 25, 2023
6caf59a
Fixing mpi dependant tests
roigcarlo Jul 25, 2023
88d416b
Refactor core and mpicore tests
roigcarlo Jul 25, 2023
9042bd9
Updating tests
roigcarlo Jul 27, 2023
da0b2a5
Adding gtest
roigcarlo Jul 27, 2023
b47ee25
Patch for cmake 3.27
roigcarlo Jul 27, 2023
95ab5f4
Mpi tests
roigcarlo Jul 28, 2023
b45c82a
Adding kernel destructor and fixing mpi test with individual kernel i…
roigcarlo Jul 28, 2023
14186bf
Restoring internal macros checks
roigcarlo Jul 31, 2023
8c34e88
Fixing problem comparing array_1d with ZeroVector(x) from boost
roigcarlo Jul 31, 2023
d5550bc
Fixing cstr cmp in text excpetion
roigcarlo Jul 31, 2023
35020c4
Fixing cstr cmp in code location
roigcarlo Jul 31, 2023
c0c3240
Test_checks now checks the checks class. Checkmate
roigcarlo Jul 31, 2023
956125b
Fixing logger test (bad copy paste)
roigcarlo Jul 31, 2023
b064b3c
Merge branch 'master' into ci/gtests
roigcarlo Aug 3, 2023
d48fa49
Min cmake version
roigcarlo Aug 22, 2023
74f10ef
Missing include
roigcarlo Aug 22, 2023
dcc5bfb
Using distributed expects
roigcarlo Aug 22, 2023
28de457
Merge branch 'master' into ci/gtests
roigcarlo Aug 25, 2023
e455d15
Removing testing_ folder
roigcarlo Aug 25, 2023
d12daff
Merge branch 'master' into ci/gtests
roigcarlo Aug 31, 2023
ea4aba4
Merge conflicts
roigcarlo Aug 31, 2023
40002cc
declared size_t
Dec 1, 2023
6a4aefa
compilable version without MPI
Dec 6, 2023
d51f66b
added testing folder
Dec 13, 2023
40283f5
Merge branch 'master' into ci/gtests
Dec 15, 2023
72aefb5
added file(GLOB_RECURSE KRATOS_TEST_SOURCES
Dec 18, 2023
600be3c
changed MPISynchronousPointSynchronization
Dec 20, 2023
ceaa848
made comparison of pointers before calling the macros
Dec 20, 2023
1d36556
moved cpp_tests_utilities.* from utilities to tests/cpp_tests/utilities
Dec 20, 2023
44a9a1c
added USE_MPI OFF to test Deltares TC
Dec 20, 2023
d00247f
corrected include for test_suite.h
Dec 20, 2023
e8c1a31
added tests/cpp_tests/*.cpp to KRATOS_TEST_UTILITIES_SOURCES to compi…
Dec 20, 2023
b687b5e
Merge branch 'master' into geo/gtests
Dec 20, 2023
9c63731
added include of test_suite.h
Dec 20, 2023
ae8570c
- moved cpp_tests_utilities.* to tests/test_utilities
Jan 9, 2024
6632c22
commented Factory, it seems it is not used in Kratos yet.
Jan 11, 2024
32cc295
modifications in CMakeLists.txt files
Jan 11, 2024
361f77b
CMake files
Jan 12, 2024
9a3911a
reverted libs
Jan 15, 2024
397c1af
modifications
Jan 17, 2024
5cab920
added KRATOS_SOURCE to working directories
Jan 19, 2024
5dd3345
removed second definition of KRATOS_TEST_CASE
Jan 28, 2024
ef3d3e7
changed comparison of strings
Jan 28, 2024
7650717
removed USE_MPI set
Jan 29, 2024
39fccb8
changed size_t to unsigned long to compile on Windows
Jan 31, 2024
76b1b5a
added/removed KRATOS_API(KRATOS_CORE)
Jan 31, 2024
2857cf8
commented KRATOS_TEST_CASE_IN_SUITE to avoid the macro redefinition w…
Jan 31, 2024
d06607d
used std::filesystem::path instead of std::string
Jan 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
cmake_minimum_required (VERSION 2.8.6)
cmake_minimum_required (VERSION 3.22.0)

project (KratosMultiphysics)
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_CXX_EXTENSIONS OFF)
set (USE_MPI OFF)

# Setting some policies
# No recursive dereferencing
Expand All @@ -25,6 +27,11 @@ if(POLICY CMP0057)
cmake_policy(SET CMP0057 NEW)
endif(POLICY CMP0057)

# Timestamp for extracted files
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif(POLICY CMP0135)

# Set here the version number **** only update upon tagging a release!
set (KratosMultiphysics_MAJOR_VERSION 9)
set (KratosMultiphysics_MINOR_VERSION 4)
Expand All @@ -38,7 +45,7 @@ endif(NOT DEFINED KRATOS_SOURCE_DIR)

if(NOT DEFINED KRATOS_BINARY_DIR)
message("-- No KRATOS_BINARY_DIR is defined, using: ${CMAKE_BINARY_DIR}")
set(KRATOS_BINARY_DIR ${CMAKE_BINARY_DIR})
set(KRATOS_BINARY_DIR "${CMAKE_BINARY_DIR}")
endif(NOT DEFINED KRATOS_BINARY_DIR)

option(REMOVE_INSTALL_DIRECTORIES "Remove the install directories to achieve a clean compilation" ON)
Expand Down Expand Up @@ -275,12 +282,25 @@ SET(INSTALL_PYTHON_FILES ON) # To be removed when all applications are po
#include the file with custom installation properties
include(install_function)
include(KratosDependencies)
include(FetchContent)

# Logger configuration
if(KRATOS_COLORED_OUTPUT MATCHES ON)
add_definitions(-DKRATOS_COLORED_OUTPUT)
endif(KRATOS_COLORED_OUTPUT MATCHES ON)

# Testing
if(KRATOS_BUILD_TESTING MATCHES ON)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
enable_testing()
endif(KRATOS_BUILD_TESTING MATCHES ON)

################### PYBIND11

# Try to use python executable from env variable
Expand Down Expand Up @@ -617,14 +637,12 @@ endif(${USE_TRIANGLE_NONFREE_TPL} MATCHES ON )
# Compiling the tinyexpr library
add_subdirectory(${KRATOS_SOURCE_DIR}/external_libraries/tinyexpr)

# Clean the Module and libs install directories
if(${REMOVE_INSTALL_DIRECTORIES} MATCHES ON )
install(CODE "message(STATUS \"Deleting: ${CMAKE_INSTALL_PREFIX}/KratosMultiphysics\")")
install(CODE "file(REMOVE_RECURSE \"${CMAKE_INSTALL_PREFIX}/KratosMultiphysics\")")
install(CODE "message(STATUS \"Deleting: ${CMAKE_INSTALL_PREFIX}/libs\")")
install(CODE "file(REMOVE_RECURSE \"${CMAKE_INSTALL_PREFIX}/libs\")")
endif(${REMOVE_INSTALL_DIRECTORIES} MATCHES ON )

# Install core files for the KratosMultiphysics python module
kratos_python_install(${INSTALL_PYTHON_USING_LINKS} "${KRATOS_SOURCE_DIR}/kratos/python_interface/__init__.py" "KratosMultiphysics/__init__.py" )
kratos_python_install(${INSTALL_PYTHON_USING_LINKS} "${KRATOS_SOURCE_DIR}/kratos/python_interface/kratos_globals.py" "KratosMultiphysics/kratos_globals.py" )
Expand All @@ -633,8 +651,8 @@ kratos_python_install(${INSTALL_PYTHON_USING_LINKS} "${KRATOS_SOURCE_DIR}/kratos
kratos_python_install(${INSTALL_PYTHON_USING_LINKS} "${KRATOS_SOURCE_DIR}/kratos/python_interface/python_registry_utilities.py" "KratosMultiphysics/python_registry_utilities.py" )

# Install the libraries in the libs folder
install(FILES ${Boost_LIBRARIES} DESTINATION libs)
install(FILES ${EXTRA_INSTALL_LIBS} DESTINATION libs)
install(FILES ${Boost_LIBRARIES} DESTINATION lib)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markelov208 Please do not change this.

Libs needs to be deleted and repopulated at every compilation to avoid mismatching versions of the same library. This change is intentional.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roigcarlo , thank you for letting me know. Currently, the libs folder is populated and then deleted.
[39/40] Install the project...
-- Install configuration: "Debug"
-- Deleting: D:/Checkouts2/KratosProjects/alpha/bin/Debug/KratosMultiphysics
-- Deleting: D:/Checkouts2/KratosProjects/alpha/bin/Debug/libs

Build finished

Please could you let me know how to change the order in cmake file? Thank you.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log its a little bit misleading, its the other way around, libs folders gets deleted and then populated if the compilation goes well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this is exactly what I have on my laptop: files are copied into libs folder, then libs is deleted. ;) I have reverted libs and put REMOVE_INSTALL_DIRECTORIES OFF.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmm that's quite odd. In any case, its important to maintain the name libs, so if it fails as last resource we can comment the lines that remove the contents of the folder, but changing the name will effectively break the release and RPATH so that cannot be changed

install(FILES ${EXTRA_INSTALL_LIBS} DESTINATION lib)

# Perform post-install tasks (add_subdirectory commands are guaranteed to be executed in order)
add_subdirectory("scripts/post_install")
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "custom_utilities/conversion_utilities.h"

// Utilities
#include "utilities/cpp_tests_utilities.h"
#include "tests/test_utilities/cpp_tests_utilities.h"

namespace Kratos {
namespace Testing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "testing/testing.h"
#include "containers/model.h"
#include "utilities/variable_utils.h"
#include "utilities/cpp_tests_utilities.h"
#include "tests/test_utilities/cpp_tests_utilities.h"
#include "custom_utilities/contact_utilities.h"

namespace Kratos::Testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "testing/testing.h"
#include "containers/model.h"
#include "custom_utilities/interface_preprocess.h"
#include "utilities/cpp_tests_utilities.h"
#include "tests/test_utilities/cpp_tests_utilities.h"

namespace Kratos::Testing
{
Expand Down
24 changes: 16 additions & 8 deletions applications/GeoMechanicsApplication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,26 @@ file(GLOB_RECURSE KRATOS_GEO_MECHANICS_APPLICATION_CORE
${CMAKE_CURRENT_SOURCE_DIR}/external_bindings/*.cpp
)

## GeoMechanics testing sources
if(${KRATOS_BUILD_TESTING} MATCHES ON)
file(GLOB_RECURSE KRATOS_GEO_MECHANICS_APPLICATION_TESTING_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp)
endif(${KRATOS_BUILD_TESTING} MATCHES ON)

## GeoMechanics python interface sources
file(GLOB_RECURSE KRATOS_GEO_MECHANICS_APPLICATION_PYTHON_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/custom_python/*.cpp)

add_library(KratosGeoMechanicsCore SHARED ${KRATOS_GEO_MECHANICS_APPLICATION_CORE} ${KRATOS_GEO_MECHANICS_APPLICATION_TESTING_SOURCES})
add_library(KratosGeoMechanicsCore SHARED ${KRATOS_GEO_MECHANICS_APPLICATION_CORE})
target_link_libraries(KratosGeoMechanicsCore PUBLIC KratosCore KratosStructuralMechanicsCore KratosLinearSolversCore ${CMAKE_DL_LIBS})
set_target_properties(KratosGeoMechanicsCore PROPERTIES COMPILE_DEFINITIONS "GEO_MECHANICS_APPLICATION=EXPORT,API")

## GeoMechanics testing sources
if (${KRATOS_BUILD_TESTING} MATCHES ON)
file(GLOB_RECURSE KRATOS_GEO_MECHANICS_APPLICATION_TESTING_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp)

add_executable(KratosGeoMechanicsTest ${KRATOS_GEO_MECHANICS_APPLICATION_TESTING_SOURCES})

target_link_libraries(KratosGeoMechanicsTest PUBLIC KratosGeoMechanicsCore GTest::gtest_main)

install(TARGETS KratosGeoMechanicsTest)

include(GoogleTest)
# gtest_discover_tests(KratosGeoMechanicsTest)
endif (${KRATOS_BUILD_TESTING} MATCHES ON)

###############################################################
## define library Kratos which defines the basic python interface
Expand Down Expand Up @@ -103,8 +111,8 @@ if(${INSTALL_TESTING_FILES} MATCHES ON )
endif(${INSTALL_TESTING_FILES} MATCHES ON)

# Install targets
install(TARGETS KratosGeoMechanicsCore DESTINATION libs )
install(TARGETS KratosGeoMechanicsApplication DESTINATION libs )
install(TARGETS KratosGeoMechanicsCore DESTINATION lib )
install(TARGETS KratosGeoMechanicsApplication DESTINATION lib )

# Define custom targets
set(KRATOS_KERNEL "${KRATOS_KERNEL};KratosGeoMechanicsCore" PARENT_SCOPE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace Kratos {

class JsonProcessInfoParser : public ProcessInfoParser
class KRATOS_API(GEO_MECHANICS_APPLICATION) JsonProcessInfoParser : public ProcessInfoParser
{
public:
std::vector<ProcessParameters> GetProcessList(const Parameters& rProcessParameters) const override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
namespace Kratos
{

class ParametersUtilities
class KRATOS_API(GEO_MECHANICS_APPLICATION) ParametersUtilities
{
public:
static Parameters CopyRequiredParameters(const Parameters& rSourceParameters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Kratos

class Parameters;

class ProcessFactory
class KRATOS_API(GEO_MECHANICS_APPLICATION) ProcessFactory
{
public:
using ProductType = std::unique_ptr<Process>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
namespace Kratos
{

struct ProcessParameters
struct KRATOS_API(GEO_MECHANICS_APPLICATION) ProcessParameters
{
std::string name;
Parameters parameters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
#pragma once

#include "time_incrementor.h"

#include "includes/kratos_export_api.h"

namespace Kratos
{

class AdaptiveTimeIncrementor : public TimeIncrementor
class KRATOS_API(GEO_MECHANICS_APPLICATION) AdaptiveTimeIncrementor : public TimeIncrementor
{
public:
AdaptiveTimeIncrementor(double StartTime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@

#pragma once

#include "includes/kratos_export_api.h"

namespace Kratos {

class KratosGeoSettlement;

class CustomWorkflowFactory{
class KRATOS_API(GEO_MECHANICS_APPLICATION) CustomWorkflowFactory{
public:
static KratosGeoSettlement* CreateKratosGeoSettlement();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Kratos {
class Model;
class ModelPart;

class GeoOutputWriter {
class KRATOS_API(GEO_MECHANICS_APPLICATION) GeoOutputWriter {
public:
GeoOutputWriter(const Parameters& rGidOutputSettings,
const std::string& rWorkingDirectory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
#include "time_incrementor.h"

#include <vector>

#include "includes/kratos_export_api.h"

namespace Kratos
{

class PrescribedTimeIncrementor : public TimeIncrementor
class KRATOS_API(GEO_MECHANICS_APPLICATION) PrescribedTimeIncrementor : public TimeIncrementor
{
public:
explicit PrescribedTimeIncrementor(const std::vector<double>& increments);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
namespace Kratos
{

class TimeStepExecutor
class KRATOS_API(GEO_MECHANICS_APPLICATION) TimeStepExecutor
{
public:
using ProcessRef = std::reference_wrapper<Process>;
Expand Down
4 changes: 2 additions & 2 deletions applications/LinearSolversApplication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ if(${INSTALL_TESTING_FILES} MATCHES ON )
endif(${INSTALL_TESTING_FILES} MATCHES ON)

# Install targets
install( TARGETS KratosLinearSolversCore DESTINATION libs )
install( TARGETS KratosLinearSolversApplication DESTINATION libs )
install( TARGETS KratosLinearSolversCore DESTINATION lib )
install( TARGETS KratosLinearSolversApplication DESTINATION lib )

# Define custom targets
set(KRATOS_KERNEL "${KRATOS_KERNEL};KratosLinearSolversCore" PARENT_SCOPE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "testing/testing.h"
#include "includes/model_part.h"
#include "includes/stream_serializer.h"
#include "utilities/cpp_tests_utilities.h"
#include "tests/test_utilities/cpp_tests_utilities.h"
#include "utilities/variable_utils.h"
#include "geometries/quadrilateral_2d_4.h"
#include "processes/structured_mesh_generator_process.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/* Processes */
#include "processes/find_nodal_h_process.h"
#include "custom_processes/mmg/mmg_process.h"
#include "utilities/cpp_tests_utilities.h"
#include "tests/test_utilities/cpp_tests_utilities.h"
#include "includes/mat_variables.h"

namespace Kratos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "includes/kratos_filesystem.h"
#include "includes/kratos_flags.h"
#include "containers/model.h"
#include "utilities/cpp_tests_utilities.h"
#include "tests/test_utilities/cpp_tests_utilities.h"
#include "meshing_application_variables.h"
#include "custom_io/mmg/mmg_io.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// #include "includes/gid_io.h"
#include "containers/model.h"
#include "meshing_application_variables.h"
#include "utilities/cpp_tests_utilities.h"
#include "tests/test_utilities/cpp_tests_utilities.h"

/* Processes */
#include "custom_processes/mmg/mmg_process.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Project includes
#include "testing/testing.h"
#include "containers/model.h"
#include "utilities/cpp_tests_utilities.h"
#include "tests/test_utilities/cpp_tests_utilities.h"
#include "custom_utilities/meshing_utilities.h"

namespace Kratos {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// #include "includes/gid_io.h"
#include "containers/model.h"
#include "meshing_application_variables.h"
#include "utilities/cpp_tests_utilities.h"
#include "tests/test_utilities/cpp_tests_utilities.h"

/* Processes */
#include "processes/compute_nodal_gradient_process.h"
Expand Down
30 changes: 17 additions & 13 deletions applications/StructuralMechanicsApplication/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
set(CMAKE_INCLUDE_CURRENT_DIR ON)

message("**** configuring KratosStructuralMechanicsApplication ****")

################### PYBIND11
include(pybind11Tools)

include_directories( ${KRATOS_SOURCE_DIR}/kratos )

## StructuralMechanics Core sources
Expand All @@ -27,15 +22,24 @@ file(GLOB_RECURSE KRATOS_STRUCTURAL_MECHANICS_APPLICATION_PYTHON_INTERFACE ${CMA
list(REMOVE_ITEM KRATOS_STRUCTURAL_MECHANICS_APPLICATION_CORE ${CMAKE_CURRENT_SOURCE_DIR}/custom_utilities/constitutive_law_utilities.cpp)
list(INSERT KRATOS_STRUCTURAL_MECHANICS_APPLICATION_CORE 0 ${CMAKE_CURRENT_SOURCE_DIR}/custom_utilities/constitutive_law_utilities.cpp)

# StructuralMechanics testing sources
if(${KRATOS_BUILD_TESTING} MATCHES ON)
file(GLOB_RECURSE KRATOS_STRUCTURAL_MECHANICS_APPLICATION_TESTING_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tests/cpp_tests/*.cpp)
endif(${KRATOS_BUILD_TESTING} MATCHES ON)

add_library(KratosStructuralMechanicsCore SHARED ${KRATOS_STRUCTURAL_MECHANICS_APPLICATION_CORE} ${KRATOS_STRUCTURAL_MECHANICS_APPLICATION_TESTING_SOURCES})
add_library(KratosStructuralMechanicsCore SHARED ${KRATOS_STRUCTURAL_MECHANICS_APPLICATION_CORE})
target_link_libraries(KratosStructuralMechanicsCore PUBLIC KratosCore)
set_target_properties(KratosStructuralMechanicsCore PROPERTIES COMPILE_DEFINITIONS "STRUCTURAL_MECHANICS_APPLICATION=EXPORT,API")

if (${KRATOS_BUILD_TESTING} MATCHES ON)
file(GLOB_RECURSE KRATOS_STRUCTURAL_MECHANICS_APPLICATION_TESTING_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tests/cpp_tests/*.cpp)

add_executable(KratosStructuralMechanicsTest ${KRATOS_STRUCTURAL_MECHANICS_APPLICATION_TESTING_SOURCES})

target_link_libraries(KratosStructuralMechanicsTest PUBLIC KratosStructuralMechanicsCore KratosCoreTestUtilities GTest::gtest_main)

install(TARGETS KratosStructuralMechanicsTest)

include(GoogleTest)
# gtest_discover_tests(KratosStructuralMechanicsTest)

endif (${KRATOS_BUILD_TESTING} MATCHES ON)

# Define library Kratos which defines the basic python interface
pybind11_add_module(KratosStructuralMechanicsApplication MODULE THIN_LTO ${KRATOS_STRUCTURAL_MECHANICS_APPLICATION_PYTHON_INTERFACE})
target_link_libraries(KratosStructuralMechanicsApplication PUBLIC KratosStructuralMechanicsCore)
Expand Down Expand Up @@ -75,8 +79,8 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests DESTINATION applications/${C
)

# Install targets
install(TARGETS KratosStructuralMechanicsCore DESTINATION libs )
install(TARGETS KratosStructuralMechanicsApplication DESTINATION libs )
install(TARGETS KratosStructuralMechanicsCore DESTINATION lib)
install(TARGETS KratosStructuralMechanicsApplication DESTINATION lib)

# Define custom targets
set(KRATOS_KERNEL "${KRATOS_KERNEL};KratosStructuralMechanicsCore" PARENT_SCOPE)
Expand Down
Loading
Loading