Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
ab8bfb4e8e | |||
d7da8be039 | |||
c139e608ed | |||
137c0147c6 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,4 +1,4 @@
|
|||||||
# Prerequisites
|
# Prerequisites
|
||||||
*.d
|
*.d
|
||||||
|
|
||||||
# Compiled Object files
|
# Compiled Object files
|
||||||
@ -33,5 +33,4 @@
|
|||||||
|
|
||||||
# Mac folder
|
# Mac folder
|
||||||
.DS_Store
|
.DS_Store
|
||||||
build_mac/
|
|
||||||
build/
|
build/
|
@ -1,9 +1,12 @@
|
|||||||
cmake_minimum_required(VERSION 3.15.2)
|
cmake_minimum_required(VERSION 3.15.2)
|
||||||
|
# 设置工程名称
|
||||||
|
project(GM3D_GUI VERSION 0.3 LANGUAGES CXX)
|
||||||
|
|
||||||
#set(CMAKE_CXX_COMPILER /usr/local/bin/g++-10)
|
message(STATUS "Platform: " ${CMAKE_HOST_SYSTEM_NAME})
|
||||||
set(CMAKE_BUILD_TYPE "Release")
|
# CMake默认的安装路径 Windows下为C:/Program\ Files/${Project_Name} Linux/Unix下为/usr/local
|
||||||
#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")
|
message(STATUS "Install prefix: " ${CMAKE_INSTALL_PREFIX})
|
||||||
|
# CMake默认的变异类型为空
|
||||||
|
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
|
||||||
|
|
||||||
project(GM3D_GUI VERSION 0.2 LANGUAGES CXX)
|
# 添加源文件地址
|
||||||
|
add_subdirectory(src/)
|
||||||
add_subdirectory(src)
|
|
||||||
|
@ -1,39 +1,10 @@
|
|||||||
aux_source_directory(. DIR_SRC)
|
aux_source_directory(. DIR_SRC)
|
||||||
|
|
||||||
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
add_executable(gm3d ${DIR_SRC})
|
||||||
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(E:/Library/include)
|
||||||
include_directories(/usr/local/include)
|
|
||||||
# 添加动态库地址
|
# 添加动态库地址
|
||||||
find_library(FLTK_LIBRARY fltk HINTS /opt/homebrew/lib)
|
find_library(FLTK_LIBRARY fltk HINTS E:/Library/lib)
|
||||||
|
|
||||||
target_link_libraries(gm3d ${FLTK_LIBRARY} OpenMP::OpenMP_CXX)
|
target_link_libraries(gm3d ${FLTK_LIBRARY})
|
39
src/CMakeLists.txt.backup
Normal file
39
src/CMakeLists.txt.backup
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
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)
|
@ -8,7 +8,7 @@
|
|||||||
#include "iomanip"
|
#include "iomanip"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "unistd.h"
|
//#include "unistd.h"
|
||||||
#include "vector"
|
#include "vector"
|
||||||
#include "map"
|
#include "map"
|
||||||
#include "algorithm"
|
#include "algorithm"
|
||||||
|
@ -1,12 +1,23 @@
|
|||||||
#ifndef _PROGRESS_BAR_
|
#ifndef _PROGRESS_BAR_
|
||||||
#define _PROGRESS_BAR_
|
#define _PROGRESS_BAR_
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
||||||
|
#if defined _WINDOWS || __WIN32__
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#define TOTAL_PERCENTAGE 100.0
|
#define TOTAL_PERCENTAGE 100.0
|
||||||
#define CHARACTER_WIDTH_PERCENTAGE 4
|
#define CHARACTER_WIDTH_PERCENTAGE 4
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user