cmake_minimum_required(VERSION 3.10 FATAL_ERROR) # if CMAKE_BUILD_TYPE is specified use it; otherwise set the default # build type to "RelWithDebInfo" ("-O2 -g" with gcc) prior to calling # project() if(DEFINED CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose build type") else(DEFINED CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose build type") endif(DEFINED CMAKE_BUILD_TYPE) project(cutmesh CXX) include_directories(.) option(CUTMESH_ENABLE_IBREP "Enable IBREP import" OFF) if(CUTMESH_ENABLE_IBREP) if(NOT DEFINED IBREP_PATH) set(IBREP_PATH "../../IBrep/trunk/src" CACHE STRING "IBREP Path") endif(NOT DEFINED IBREP_PATH) add_definitions(-DCUTMESH_ENABLE_IBREP) include_directories(${IBREP_PATH}) endif(CUTMESH_ENABLE_IBREP) set(SRC LTetra.cpp LVertex.cpp discreteSurface.cpp cadlevelset.cpp hashstruct.cpp mesh.cpp mesh_refine.cpp surface.cpp topo.cpp brep.cpp mesh_cutter.cpp mesh_cutter_build_gmodel.cpp mesh_ibrep.cpp topo_ibrep.cpp options.cpp lsquery.cpp) set (LINK_LIBRARIES shared ${EXTERNAL_LIBRARIES}) add_executable(cutmesh ${SRC} main_cutmesh.cpp) add_library(cutmesh_shared SHARED ${SRC}) target_link_libraries(cutmesh ${LINK_LIBRARIES} ) target_link_libraries(cutmesh_shared ${LINK_LIBRARIES} ) if(CUTMESH_ENABLE_IBREP) target_link_libraries(cutmesh ${LINK_LIBRARIES} ibrep-dynamic) else(CUTMESH_ENABLE_IBREP) target_link_libraries(cutmesh ${LINK_LIBRARIES}) endif(CUTMESH_ENABLE_IBREP) # if(CUTMESH_ENABLE_IBREP) # target_link_libraries(cutmesh ibrep-dynamic) # endif(CUTMESH_ENABLE_IBREP) # # target_link_libraries(cutmesh_shared ${LINK_LIBRARIES}) # if(CUTMESH_ENABLE_IBREP) # add_executable(cutmesh_ibrep ${SRC} main_cutmesh_ibrep.cpp) # target_link_libraries(cutmesh_ibrep ${LINK_LIBRARIES} ibrep-dynamic) # endif(CUTMESH_ENABLE_IBREP)