Skip to content
Snippets Groups Projects
Commit e035d269 authored by Maxime Graulich's avatar Maxime Graulich
Browse files

Mobile port

parent 4942a341
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,8 @@ option(ENABLE_BLAS_LAPACK "Use BLAS and Lapack for linear algebra" ON)
option(ENABLE_BLOSSOM "Enable Blossom algo (based on MATCH and concorde97)" ${DEFAULT})
option(ENABLE_BUILD_LIB "Build static Gmsh library" OFF)
option(ENABLE_BUILD_SHARED "Build shared Gmsh library" OFF)
option(ENABLE_BUILD_ANDROID "Build Gmsh library for Android NDK" OFF)
option(ENABLE_BUILD_IOS "Build Gmsh library for iOS" OFF)
option(ENABLE_CGNS "Enable CGNS mesh export" OFF)
option(ENABLE_CHACO "Enable Chaco mesh partitioner" ${DEFAULT})
option(ENABLE_DINTEGRATION "Enable discrete integration and levelsets" ${DEFAULT})
......@@ -285,6 +287,10 @@ if(ENABLE_BLAS_LAPACK)
set_config_option(HAVE_BLAS "Blas(VecLib)")
set_config_option(HAVE_LAPACK "Lapack(VecLib)")
endif(MSVC)
if(BUILD_ANDROID)
set_config_option(HAVE_BLAS "Blas")
set_config_option(HAVE_LAPACK "Lapack")
endif(BUILD_ANDROID)
if(NOT HAVE_BLAS OR NOT HAVE_LAPACK)
# if we haven't found blas and lapack without using the standard
# cmake tests, do it (this requires a working Fortran compiler)
......@@ -427,6 +433,35 @@ if(ENABLE_ONELAB)
endif(ENABLE_ONELAB_METAMODEL)
endif(ENABLE_ONELAB)
if(ENABLE_BUILD_IOS)
#TODO
endif(ENABLE_BUILD_IOS)
if(ENABLE_BUILD_ANDROID)
# we need getdp lib
#find_library(GETDP_LIB Gmsh PATH_SUFFIXES lib)
#find_path(GETDP_INC "GetDP.h" PATH_SUFFIXES include getdp include/getdp)
#if(GETDP_LIB AND GETDP_INC)
# list(APPEND EXTERNAL_LIBRARIES ${GETDP_LIB})
# list(APPEND EXTERNAL_INCLUDES ${GETDP_INC})
# set_config_option(HAVE_GETDP "GetDP")
#else(GETDP_LIB AND GETDP_INC)
# message(SEND_ERROR "Cannot compile Gmsh for Android without GetDP")
#endif(GETDP_LIB AND GETDP_INC)
# then we can make gmsh lib
set(CMAKE_BUILD_TYPE Release)
add_definitions(-DBUILD_ANDROID)
set(LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_CURRENT_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/libs/)
#add_subdirectory(Mobile/Android/)
#add_library(androidGmsh SHARED Mobile/Android/drawGModel.cpp Mobile/Android/androidGModel.cpp ${GMSH_SRC})
add_library(androidGmsh SHARED ${GMSH_SRC})
#set( LIBRARY_DEPS GLESv1_CM log)
set_target_properties(androidGmsh PROPERTIES OUTPUT_NAME Gmsh)
target_link_libraries(androidGmsh ${LINK_LIBRARIES})
endif(ENABLE_BUILD_ANDROID)
if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS)
if(NOT HAVE_MESH OR NOT HAVE_POST OR NOT HAVE_PLUGINS OR NOT HAVE_ONELAB)
message(SEND_ERROR "Cannot compile GUI without Mesh, Post, Plugin or OneLab")
......@@ -1205,6 +1240,10 @@ endif(ENABLE_BUILD_LIB)
if(ENABLE_BUILD_SHARED)
install(TARGETS shared DESTINATION lib OPTIONAL)
endif(ENABLE_BUILD_SHARED)
if(ENABLE_BUILD_ANDROID)
install(TARGETS androidGmsh DESTINATION lib OPTIONAL)
endif(ENABLE_BUILD_ANDROID)
install(FILES ${GMSH_API} DESTINATION include/gmsh)
install(FILES ${WELCOME_FILE} DESTINATION ${GMSH_DOC} RENAME README.txt)
install(FILES ${LICENSE_FILE} DESTINATION ${GMSH_DOC})
......
......@@ -352,6 +352,10 @@ void Msg::Info(const char *fmt, ...)
fflush(stdout);
}
}
void Msg::RequestRender()
{
if(_callback) (*_callback)("RequestRender", "");
}
void Msg::Direct(const char *fmt, ...)
{
......@@ -487,7 +491,7 @@ void Msg::ProgressMeter(int n, int N, bool log, const char *fmt, ...)
FlGui::instance()->setProgress(str, (n > N - 1) ? 0 : n, 0, N);
}
#endif
if(_callback) (*_callback)("Progress", str);
if(!streamIsFile(stdout) && log && CTX::instance()->terminal){
fprintf(stdout, "%s \r",
(n > N - 1) ? "" : str2);
......
......@@ -68,6 +68,7 @@ class Msg {
static void Error(const char *fmt, ...);
static void Warning(const char *fmt, ...);
static void Info(const char *fmt, ...);
static void RequestRender();
static void Direct(const char *fmt, ...);
static void StatusBar(bool log, const char *fmt, ...);
static void StatusGl(const char *fmt, ...);
......
......@@ -402,7 +402,7 @@ int MergeFile(const std::string &fileName, bool warnIfMissing)
status = readFile3M(fileName);
}
#endif
#if defined(HAVE_ONELAB) && defined(HAVE_FLTK)
#if defined(HAVE_ONELAB)
else if(ext == ".pro" && opt_solver_name(0, GMSH_GET, "") == "GetDP"){
std::vector<std::string> split = SplitFileName(fileName);
GModel::current()->setName(split[1] + ".geo");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment