add switch to toggle building of flat mesh module

This commit is contained in:
wmayer
2018-04-29 00:03:05 +02:00
parent 77a6470107
commit 6aeab22842
2 changed files with 52 additions and 48 deletions

View File

@@ -261,6 +261,7 @@ OPTION(BUILD_JTREADER "Build the FreeCAD jt reader module" OFF)
OPTION(BUILD_MATERIAL "Build the FreeCAD material module" ON)
OPTION(BUILD_MESH "Build the FreeCAD mesh module" ON)
OPTION(BUILD_MESH_PART "Build the FreeCAD mesh part module" ON)
OPTION(BUILD_FLAT_MESH "Build the FreeCAD flat mesh module" ON)
OPTION(BUILD_OPENSCAD "Build the FreeCAD openscad module" ON)
OPTION(BUILD_PART "Build the FreeCAD part module" ON)
OPTION(BUILD_PART_DESIGN "Build the FreeCAD part design module" ON)
@@ -342,6 +343,7 @@ REQUIRES_MODS(BUILD_IMPORT BUILD_PART)
REQUIRES_MODS(BUILD_INSPECTION BUILD_MESH BUILD_POINTS BUILD_PART)
REQUIRES_MODS(BUILD_JTREADER BUILD_MESH)
REQUIRES_MODS(BUILD_MESH_PART BUILD_PART BUILD_MESH BUILD_SMESH)
REQUIRES_MODS(BUILD_FLAT_MESH BUILD_MESH_PART)
REQUIRES_MODS(BUILD_OPENSCAD BUILD_MESH_PART BUILD_DRAFT)
REQUIRES_MODS(BUILD_PART_DESIGN BUILD_SKETCHER)
REQUIRES_MODS(BUILD_PATH BUILD_PART BUILD_ROBOT)

View File

@@ -74,59 +74,61 @@ INSTALL(TARGETS MeshPart DESTINATION ${CMAKE_INSTALL_LIBDIR})
################################ flat mesh ###############################
if (FREECAD_USE_PYBIND11)
SET(FLATMESH_SRCS
MeshFlattening.cpp
MeshFlattening.h
MeshFlatteningNurbs.h
MeshFlatteningNurbs.cpp
MeshFlatteningLscmRelax.h
MeshFlatteningLscmRelax.cpp
MeshFlatteningPy.cpp
)
if (BUILD_FLAT_MESH)
if (FREECAD_USE_PYBIND11)
SET(FLATMESH_SRCS
MeshFlattening.cpp
MeshFlattening.h
MeshFlatteningNurbs.h
MeshFlatteningNurbs.cpp
MeshFlatteningLscmRelax.h
MeshFlatteningLscmRelax.cpp
MeshFlatteningPy.cpp
)
add_library(flatmesh SHARED ${FLATMESH_SRCS})
SET_PYTHON_PREFIX_SUFFIX(flatmesh)
target_link_libraries(flatmesh ${PYTHON_LIBRARIES} ${MeshPart_LIBS})
add_library(flatmesh SHARED ${FLATMESH_SRCS})
SET_PYTHON_PREFIX_SUFFIX(flatmesh)
target_link_libraries(flatmesh ${PYTHON_LIBRARIES} ${MeshPart_LIBS})
SET_BIN_DIR(flatmesh flatmesh /Mod/MeshPart)
install(TARGETS flatmesh DESTINATION ${CMAKE_INSTALL_LIBDIR})
else()
if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
# boost-python >= 1.67 on some platforms has suffix
set(BOOST_PY_SUFFIX ${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR})
SET_BIN_DIR(flatmesh flatmesh /Mod/MeshPart)
install(TARGETS flatmesh DESTINATION ${CMAKE_INSTALL_LIBDIR})
else()
if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
# boost-python >= 1.67 on some platforms has suffix
set(BOOST_PY_SUFFIX ${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR})
find_package( Boost COMPONENTS python${BOOST_PY_SUFFIX} )
if (NOT Boost_PYTHON${BOOST_PY_SUFFIX}_FOUND)
# try just the major version
find_package( Boost COMPONENTS python${PYTHON_VERSION_MAJOR} )
if (NOT Boost_PYTHON${PYTHON_VERSION_MAJOR}_FOUND)
# unversioned
find_package( Boost COMPONENTS python REQUIRED)
find_package( Boost COMPONENTS python${BOOST_PY_SUFFIX} )
if (NOT Boost_PYTHON${BOOST_PY_SUFFIX}_FOUND)
# try just the major version
find_package( Boost COMPONENTS python${PYTHON_VERSION_MAJOR} )
if (NOT Boost_PYTHON${PYTHON_VERSION_MAJOR}_FOUND)
# unversioned
find_package( Boost COMPONENTS python REQUIRED)
endif()
endif()
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
SET(FLATMESH_SRCS
MeshFlattening.cpp
MeshFlattening.h
MeshFlatteningNurbs.h
MeshFlatteningNurbs.cpp
MeshFlatteningLscmRelax.h
MeshFlatteningLscmRelax.cpp
MeshFlatteningBoostPython.cpp
)
add_library(flatmesh SHARED ${FLATMESH_SRCS})
SET_PYTHON_PREFIX_SUFFIX(flatmesh)
target_link_libraries(flatmesh ${PYTHON_LIBRARIES} ${MeshPart_LIBS} ${Boost_LIBRARIES})
SET_BIN_DIR(flatmesh flatmesh /Mod/MeshPart)
install(TARGETS flatmesh DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
endif()
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
SET(FLATMESH_SRCS
MeshFlattening.cpp
MeshFlattening.h
MeshFlatteningNurbs.h
MeshFlatteningNurbs.cpp
MeshFlatteningLscmRelax.h
MeshFlatteningLscmRelax.cpp
MeshFlatteningBoostPython.cpp
)
add_library(flatmesh SHARED ${FLATMESH_SRCS})
SET_PYTHON_PREFIX_SUFFIX(flatmesh)
target_link_libraries(flatmesh ${PYTHON_LIBRARIES} ${MeshPart_LIBS} ${Boost_LIBRARIES})
SET_BIN_DIR(flatmesh flatmesh /Mod/MeshPart)
install(TARGETS flatmesh DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
endif()
endif()
endif(BUILD_FLAT_MESH)
############################################################################