Skip to content

Commit

Permalink
Build fixes
Browse files Browse the repository at this point in the history
- eigen3 is found by config mode
- set compile options on every example as well example: asan needs to load first!
- remove warnings
  • Loading branch information
gabyx committed Sep 23, 2020
1 parent 5618ed4 commit 37a8c9d
Show file tree
Hide file tree
Showing 9 changed files with 186 additions and 233 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@
"unordered_set": "cpp",
"typeinfo": "cpp"
},
"cmake.configureArgs": ["-DPugiXML_DIR=/usr/local/opt/pugixml/lib/cmake/pugixml"]
}
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ set(ApproxMVBB_XML_SUPPORT OFF CACHE BOOL "Build library with XML support.")
#=======================================================================

# Dependencies =========================================================
find_package(Eigen3 REQUIRED)
find_package(Eigen3 CONFIG REQUIRED)
add_library(eigenLib INTERFACE IMPORTED)
set_property(TARGET eigenLib PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${EIGEN3_INCLUDE_DIR})
list(APPEND ApproxMVBB_LIBS_DEP_PUBLIC eigenLib)
Expand Down Expand Up @@ -158,8 +158,8 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
endif()
if(${UNIX})
include(GNUInstallDirs)
set(ApproxMVBB_INC_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}")
set(ApproxMVBB_RUNTIME_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}")
set(ApproxMVBB_INC_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}")
set(ApproxMVBB_RUNTIME_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}")
set(ApproxMVBB_LIBRARY_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
set(ApproxMVBB_ARCHIVE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
set(ApproxMVBB_FRAMEWORK_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
Expand All @@ -168,10 +168,10 @@ if(${UNIX})

set(ApproxMVBB_CMAKE_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/ApproxMVBB/cmake")
set(ApproxMVBB_ADDITIONAL_FILES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/ApproxMVBB")

elseif(${WIN32})
set(ApproxMVBB_INC_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}")
set(ApproxMVBB_RUNTIME_INSTALL_DIR "bin")
set(ApproxMVBB_RUNTIME_INSTALL_DIR "bin")
set(ApproxMVBB_LIBRARY_INSTALL_DIR "bin")
set(ApproxMVBB_ARCHIVE_INSTALL_DIR "lib")
set(ApproxMVBB_FRAMEWORK_INSTALL_DIR "bin")
Expand Down
310 changes: 173 additions & 137 deletions README.md

Large diffs are not rendered by default.

83 changes: 0 additions & 83 deletions cmake/FindEigen3.cmake

This file was deleted.

2 changes: 2 additions & 0 deletions example/approxMVBB/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
project("ApproxMVBBExample-MVBB")

add_executable(${PROJECT_NAME} src/main.cpp )
setTargetCompileOptions(ApproxMVBBExample-MVBB)

target_link_libraries(${PROJECT_NAME} "ApproxMVBB::Core")
2 changes: 2 additions & 0 deletions example/kdTreeFiltering/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ set(INCLUDE_DIRS


add_executable(ApproxMVBBExample-KdTree ${SOURCE_FILES} ${INCLUDE_FILES} )
setTargetCompileOptions(ApproxMVBBExample-KdTree)

# Link with Core, and add KDTreeSupport
target_link_libraries(ApproxMVBBExample-KdTree ApproxMVBB::Core ApproxMVBB::KdTreeSupport)

Expand Down
4 changes: 2 additions & 2 deletions example/kdTreeFiltering/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "ApproxMVBB/Common/CPUTimer.hpp"
#include "ApproxMVBB/KdTree.hpp"

#ifdef ApproxMVBB_XMLSUPPORT
#ifdef ApproxMVBB_XML_SUPPORT
# include "ApproxMVBB/KdTreeXml.hpp"
#endif

Expand Down Expand Up @@ -128,7 +128,7 @@ void doKdTree(std::string file)
// auto list = tree.buildLeafNeighboursAutomatic();
std::cout << tree.getStatisticsString() << std::endl;

#ifdef ApproxMVBB_XMLSUPPORT
#ifdef ApproxMVBB_XML_SUPPORT
std::string file = "KdTreeResults.xml";
std::cout << "Saving KdTree XML to: " << file << std::endl;

Expand Down
3 changes: 2 additions & 1 deletion example/libraryUsage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ project(libraryUsage)
get_filename_component( ApproxMVBB_DIR ${ApproxMVBB_DIR} ABSOLUTE )
message(STATUS "ApproxMVBB_DIR:" ${ApproxMVBB_DIR})

# add ApproxMVBB
# add ApproxMVBB

find_package(ApproxMVBB REQUIRED COMPONENTS XML_SUPPORT KDTREE_SUPPORT)

# add simple executable
add_executable(libraryUsage ./main.cpp)
setTargetCompileOptions(libraryUsage)
target_link_libraries(libraryUsage ApproxMVBB::Core)
4 changes: 0 additions & 4 deletions external/Diameter/src/EstimateDiameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ namespace ApproxMVBB
int i, j, k, n;
int index1, index2;

int suspicion_of_convex_hull = 0; // not used
int fdn, ldn, idn;

double epsilon = _epsilon_;
Expand Down Expand Up @@ -141,7 +140,6 @@ namespace ApproxMVBB
// fprintf( stdout, "...processing frth: remove %d points\n", l-newlast );
if(newlast == l)
{
suspicion_of_convex_hull = 1;
reduction_mode_of_diameter = 0;
reduction_mode_of_dbleNorm = 0;
}
Expand Down Expand Up @@ -260,7 +258,6 @@ namespace ApproxMVBB
// fprintf( stdout, "...processing diam: remove %d points\n", l-newlast );
if(newlast == l)
{
suspicion_of_convex_hull = 1;
reduction_mode_of_dbleNorm = 0;
}
l = newlast;
Expand Down Expand Up @@ -474,7 +471,6 @@ namespace ApproxMVBB
// fprintf( stdout, "...processing dbNR: remove %d points\n", l-newlast );
if(newlast == l)
{
suspicion_of_convex_hull = 1;
for(k = 0; k < theDoubleNormals.n; k++)
theDoubleNormals.seg[k].reduction_mode = 0;
}
Expand Down

0 comments on commit 37a8c9d

Please sign in to comment.