Skip to content

Commit

Permalink
Merge pull request #490 from easifem/dev
Browse files Browse the repository at this point in the history
Updates in CMakeFiles
  • Loading branch information
vickysharma0812 authored May 13, 2024
2 parents 6585f7a + afda6e5 commit bfdb87d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 47 deletions.
39 changes: 0 additions & 39 deletions cmake/Modules/FindGmsh.cmake

This file was deleted.

31 changes: 23 additions & 8 deletions cmake/addGmsh.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,31 @@

option(USE_GMSH_SDK OFF)
if(USE_GMSH_SDK)

# download the python virtual env

message(STATUS "USING GMSH SDK")
message(STATUS "Making Python Virtual Environment")
list(APPEND TARGET_COMPILE_DEF "-DUSE_GMSH_SDK")
find_package(Gmsh REQUIRED)
if(GMSH_FOUND)
message(STATUS "FOUND Gmsh")
message(STATUS "GMSH_LIBRARIES : ${GMSH_LIB}")
target_link_libraries(${PROJECT_NAME} PUBLIC ${GMSH_LIB})
else()
message(STATUS "NOT FOUND Gmsh")
endif()

find_package(Python3 REQUIRED COMPONENTS Interpreter)
set(PY_VENV "${CMAKE_INSTALL_PREFIX}/gmsh")
set(PY_BIN_DIR "${PY_VENV}/bin")
set(GMSH_LIBRARIES "${PY_VENV}/lib/libgmsh.so")

install(
CODE "
MESSAGE(\"Creating PY_VENV from ${Python3_EXECUTABLE} to ${PY_VENV}\")
execute_process(COMMAND_ECHO STDOUT COMMAND ${Python3_EXECUTABLE} -m venv ${PY_VENV} )
execute_process(COMMAND_ECHO STDOUT COMMAND ${PY_BIN_DIR}/pip install --upgrade gmsh )
")

# find_library(GMSH_LIBRARIES NAME gmsh HINTS "${PY_VENV}/lib" REQUIRED)
target_link_libraries(${PROJECT_NAME} INTERFACE ${GMSH_LIBRARIES})
message(STATUS "GMSH_LIBRARIES : ${GMSH_LIBRARIES}")

else()

message(STATUS "NOT USING GMSH SDK")

endif()

0 comments on commit bfdb87d

Please sign in to comment.