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(elastic_xfem CXX) if(NOT DEFINED GMSH_PATH) set(GMSH_PATH "./gmsh" CACHE STRING "Gmsh Path") add_subdirectory(${GMSH_PATH} "${CMAKE_CURRENT_BINARY_DIR}/gmsh") list(APPEND EXTERNAL_LIBRARIES -lgsl) include_directories(${GMSH_PATH}/Common ${GMSH_PATH}/Numeric ${GMSH_PATH}/Geo ${GMSH_PATH}/Mesh ${GMSH_PATH}/Solver ${GMSH_PATH}/Post ${GMSH_PATH}/Plugin ${GMSH_PATH}/Graphics ${GMSH_PATH}/contrib/DiscreteIntegration ${GMSH_EXTERNAL_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}/gmsh/Common ${EXTERNAL_INCLUDES} ${GMSH_PATH}/contrib/gmm ${GMSH_PATH}/contrib/MathEx ) endif(NOT DEFINED GMSH_PATH) set(SRC Composite_Textile/CompositeTextile.cpp Composite_Textile/DILevelsetTextile.cpp elasticitySolverXfem.cpp SpaceReducerForStableMultipliers.cxx ) include_directories(. ../mechanics) set (LINK_LIBRARIES shared mechanics_shared ${GMSH_EXTERNAL_LIBRARIES}) add_executable(elastic_xfem ${SRC} mainElasticityXfem.cpp ) add_library(elastic_xfem_shared SHARED ${SRC}) target_link_libraries(elastic_xfem ${LINK_LIBRARIES} ) target_link_libraries(elastic_xfem_shared ${LINK_LIBRARIES} )