Compare commits

..

No commits in common. "master" and "yzhang" have entirely different histories.

6 changed files with 45 additions and 68 deletions

3
.gitignore vendored
View File

@ -1,4 +1,4 @@
# Prerequisites
# Prerequisites
*.d
# Compiled Object files
@ -33,4 +33,5 @@
# Mac folder
.DS_Store
build_mac/
build/

View File

@ -1,12 +1,9 @@
cmake_minimum_required(VERSION 3.15.2)
#
project(GM3D_GUI VERSION 0.3 LANGUAGES CXX)
cmake_minimum_required(VERSION 3.15.2)
message(STATUS "Platform: " ${CMAKE_HOST_SYSTEM_NAME})
# CMake WindowsC:/Program\ Files/${Project_Name} Linux/Unix/usr/local
message(STATUS "Install prefix: " ${CMAKE_INSTALL_PREFIX})
# CMake
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
#set(CMAKE_CXX_COMPILER /usr/local/bin/g++-10)
set(CMAKE_BUILD_TYPE "Release")
#set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT -O2 -Wunused-command-line-argument -lpthread -framework Cocoa --std=c++11")
#
add_subdirectory(src/)
project(GM3D_GUI VERSION 0.2 LANGUAGES CXX)
add_subdirectory(src)

View File

@ -1,10 +1,39 @@
aux_source_directory(. DIR_SRC)
add_executable(gm3d ${DIR_SRC})
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -O2")
# NOTE: Don't include the path in MACOSX_BUNDLE_ICON_FILE -- this is
# the property added to Info.plist
# <key>CFBundleIconFile</key>
# <string>logo</string>
set(MACOSX_BUNDLE_ICON_FILE Logo_ZY)
# And this part tells CMake where to find and install the file itself
set(myApp_ICON ${PROJECT_SOURCE_DIR}/assert/logo/Logo_ZY.icns)
# set_source_files_properties would create Resources folder to store icns
# The folder is at same path where Info.plist located
set_source_files_properties(${myApp_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
#add_executable(gm3d_gui WIN32 MACOSX_BUNDLE ${DIR_SRC})
add_executable(gm3d MACOSX_BUNDLE ${DIR_SRC} ${myApp_ICON})
# openmp
find_package(OpenMP REQUIRED)
if (OpenMP_CXX_FOUND)
message(STATUS "OpenMP Found.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${OpenMP_SHARED_LINKER_FLAGS}")
#target_link_libraries(gm3d PUBLIC OpenMP::OpenMP_CXX)
endif()
#find_library(FLTK_LIBRARY libfltk.a /usr/local/Cellar/fltk/1.3.5/lib)
#
include_directories(E:/Library/include)
include_directories(/opt/homebrew/include)
include_directories(/usr/local/include)
#
find_library(FLTK_LIBRARY fltk HINTS E:/Library/lib)
find_library(FLTK_LIBRARY fltk HINTS /opt/homebrew/lib)
target_link_libraries(gm3d ${FLTK_LIBRARY})
target_link_libraries(gm3d ${FLTK_LIBRARY} OpenMP::OpenMP_CXX)

View File

@ -1,39 +0,0 @@
aux_source_directory(. DIR_SRC)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -O2")
# NOTE: Don't include the path in MACOSX_BUNDLE_ICON_FILE -- this is
# the property added to Info.plist
# <key>CFBundleIconFile</key>
# <string>logo</string>
set(MACOSX_BUNDLE_ICON_FILE Logo_ZY)
# And this part tells CMake where to find and install the file itself
set(myApp_ICON ${PROJECT_SOURCE_DIR}/assert/logo/Logo_ZY.icns)
# set_source_files_properties would create Resources folder to store icns
# The folder is at same path where Info.plist located
set_source_files_properties(${myApp_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
#add_executable(gm3d_gui WIN32 MACOSX_BUNDLE ${DIR_SRC})
add_executable(gm3d MACOSX_BUNDLE ${DIR_SRC} ${myApp_ICON})
# 添加openmp的编译命令 设置编译选项
find_package(OpenMP REQUIRED)
if (OpenMP_CXX_FOUND)
message(STATUS "OpenMP Found.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${OpenMP_SHARED_LINKER_FLAGS}")
#target_link_libraries(gm3d PUBLIC OpenMP::OpenMP_CXX)
endif()
#find_library(FLTK_LIBRARY libfltk.a /usr/local/Cellar/fltk/1.3.5/lib)
# 添加头文件地址
include_directories(/opt/homebrew/include)
include_directories(/usr/local/include)
# 添加动态库地址
find_library(FLTK_LIBRARY fltk HINTS /opt/homebrew/lib)
target_link_libraries(gm3d ${FLTK_LIBRARY} OpenMP::OpenMP_CXX)

View File

@ -8,7 +8,7 @@
#include "iomanip"
#include "stdio.h"
#include "stdlib.h"
//#include "unistd.h"
#include "unistd.h"
#include "vector"
#include "map"
#include "algorithm"

View File

@ -1,23 +1,12 @@
#ifndef _PROGRESS_BAR_
#ifndef _PROGRESS_BAR_
#define _PROGRESS_BAR_
#include <sys/ioctl.h>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <thread>
#include <chrono>
#if defined _WINDOWS || __WIN32__
#include <windows.h>
#else
#include <sys/ioctl.h>
#include <unistd.h>
#endif
#define TOTAL_PERCENTAGE 100.0
#define CHARACTER_WIDTH_PERCENTAGE 4