Skip to content

Commit

Permalink
use dependency on gbs
Browse files Browse the repository at this point in the history
replace incl dirs and links libs with deps on gbs targets
  • Loading branch information
adriendelsalle committed Jul 6, 2022
1 parent 84d9f68 commit 4220b85
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 70 deletions.
8 changes: 0 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ message(" -> includes: " ${CMAKE_INSTALL_INCLUDEDIR})
set(CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE
STRING "install path for libyamsConfig.cmake")

# Paths
# TODO: remove this after GBS refactoring
file(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} lib_dir)
file(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR} bin_dir)
include_directories(${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
include_directories(${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/gbs)
link_directories(${lib_dir})
link_directories(${bin_dir})

if (${BUILD_LIB})
add_subdirectory(libyams)
Expand Down
65 changes: 13 additions & 52 deletions libyams/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ project(libyams)
# C++ conf
set(CMAKE_CXX_STANDARD 20)

# dependencies
## Eigen
find_package (Eigen3 3.3 REQUIRED NO_MODULE)
#include_directories(${EIGEN3_INCLUDE_DIR})

## libIGES
include_directories(${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/iges/)

Expand All @@ -17,39 +12,10 @@ find_package(xtensor REQUIRED)
find_package(xsimd REQUIRED)
add_definitions(-DXTENSOR_USE_XSIMD)

## VTK
find_package(
VTK REQUIRED
COMPONENTS
CommonCore
CommonColor
CommonDataModel
FiltersSources
InteractionStyle
RenderingCore
RenderingAnnotation
RenderingFreeType
IOXML
ChartsCore
InteractionStyle
RenderingContext2D
RenderingContextOpenGL2
RenderingCore
RenderingFreeType
ViewsContext2D
RenderingOpenGL2
Python
WrappingPythonCore
)

## NLopt
find_package(NLopt REQUIRED)

# TBB
if(LINUX)
# add_definitions(-D__TBB_show_deprecation_message_task_H))
find_package(TBB REQUIRED)
endif()
find_package(gbs REQUIRED)
find_package(gbs-io REQUIRED)
find_package(gbs-render REQUIRED)
find_package(gbs-mesh REQUIRED)

set(YAMS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)

Expand Down Expand Up @@ -79,22 +45,17 @@ target_include_directories(
)

target_link_libraries(
libyams INTERFACE
NLopt::nlopt
${VTK_LIBRARIES}
xtensor
xtensor::optimize
xtensor::use_xsimd
Eigen3::Eigen
gbs-render
iges
TBB::tbb
libyams
INTERFACE
xtensor
xtensor::optimize
xtensor::use_xsimd
gbs::core
gbs::render
gbs::io
gbs::mesh
)

vtk_module_autoinit(
TARGETS libyams
MODULES ${VTK_LIBRARIES}
)

install(TARGETS libyams EXPORT ${PROJECT_NAME}-targets)
install(FILES ${yams_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/yams)
Expand Down
2 changes: 1 addition & 1 deletion libyams/include/yams/gridreader.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <rapidjson/rapidjson.h>

#include <gbs/tools/magic_enum.hpp>
#include <gbs-io/fromjson.h>
#include <gbs/io/fromjson.h>

#include <numbers>

Expand Down
2 changes: 1 addition & 1 deletion libyams/include/yams/gridrender.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "meridionalsolvercase.h"

#include <gbs-render/vtkcurvesrender.h>
#include <gbs/render/vtkcurvesrender.h>

#include <vtkSmartPointer.h>
#include <vtkStructuredGrid.h>
Expand Down
4 changes: 2 additions & 2 deletions libyams/include/yams/meshtools.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include <gbs/curves>
#include <gbs/bscinterp.h>
#include <gbs-mesh/tfi.h>
#include <gbs-mesh/smoothing.h>
#include <gbs/mesh/tfi.h>
#include <gbs/mesh/smoothing.h>

#include <vector>
#include <memory>
Expand Down
2 changes: 1 addition & 1 deletion python/src/yamsbind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <pybind11/stl.h>
#include <pybind11/functional.h>

#include <gbs-render/vtkgridrender.h>
#include <gbs/render/vtkgridrender.h>

namespace py = pybind11;

Expand Down
2 changes: 1 addition & 1 deletion tests/tests_diff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <gtest/gtest.h>

#include <gbs-render/vtkgridrender.h>
#include <gbs/render/vtkgridrender.h>

using namespace yams;

Expand Down
4 changes: 2 additions & 2 deletions tests/tests_grid2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <gtest/gtest.h>

#include <gbs/curves>
#include <gbs-render/vtkcurvesrender.h>
#include <gbs-render/vtkgridrender.h>
#include <gbs/render/vtkcurvesrender.h>
#include <gbs/render/vtkgridrender.h>

#include <numbers>

Expand Down
4 changes: 2 additions & 2 deletions tests/tests_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include <gtest/gtest.h>

#include <gbs-render/vtkcurvesrender.h>
#include <gbs-render/vtkgridrender.h>
#include <gbs/render/vtkcurvesrender.h>
#include <gbs/render/vtkgridrender.h>

using T = double;
const T tol{static_cast<T>(1e-6)};
Expand Down

0 comments on commit 4220b85

Please sign in to comment.