2 Star 0 Fork 0

yizhangss/gmt_api_example

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
yizhangss 提交于 2021-08-22 08:59 . update cmakelists
cmake_minimum_required(VERSION 3.15.2 FATAL_ERROR)
project(GMT_API_EX VERSION 0.1.0 LANGUAGES CXX)
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
message(STATUS "Platform: " ${CMAKE_HOST_SYSTEM_NAME})
include_directories(/usr/include)
find_library(GMT_LIB gmt /usr/lib/x86_64-linux-gnu)
elseif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin")
message(STATUS "Platform: " ${CMAKE_HOST_SYSTEM_NAME})
include_directories(/opt/homebrew/include)
find_library(GMT_LIB gmt /opt/homebrew/lib)
elseif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
message(STATUS "Platform: " ${CMAKE_HOST_SYSTEM_NAME})
include_directories(C:/programs/gmt6/include)
find_library(GMT_LIB gmt C:/programs/gmt6/lib)
else()
message(STATUS "Platform: " ${CMAKE_HOST_SYSTEM_NAME})
include_directories(/usr/local/include)
find_library(GMT_LIB gmt /usr/local/lib)
endif()
message(STATUS "GMT library found as: " ${GMT_LIB})
macro(add_example name file)
add_executable(${name} ${file}.cpp)
if(WIN32)
target_link_libraries(${name} PRIVATE ${GMT_LIB})
else()
target_link_libraries(${name} PUBLIC ${GMT_LIB})
endif(WIN32)
endmacro()
add_example(ex1 src/gridding)
add_example(ex2 src/plot_grid)
add_example(ex3 src/plot_memory)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yizhangss/gmt_api_example.git
git@gitee.com:yizhangss/gmt_api_example.git
yizhangss
gmt_api_example
gmt_api_example
master

搜索帮助