add config.cmake.in

This commit is contained in:
2021-08-28 11:33:30 +08:00
parent e59ec89fed
commit 6d0a00c8cc
9 changed files with 56 additions and 49 deletions

View File

@@ -1,25 +1,18 @@
cmake_minimum_required(VERSION 3.15.2)
# 设置项目名称与语言
project(LIBTESS VERSION 1.6)
# 设置安装地址
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
message(STATUS "Platform: " ${CMAKE_HOST_SYSTEM_NAME})
set(CMAKE_INSTALL_PREFIX /usr/local)
elseif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin")
message(STATUS "Platform: " ${CMAKE_HOST_SYSTEM_NAME})
# 安装到系统级用户软件目录
set(CMAKE_INSTALL_PREFIX /opt)
elseif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
message(STATUS "Platform: " ${CMAKE_HOST_SYSTEM_NAME})
# 使用MinGW GCC编译时需取消注释
#set(CMAKE_C_COMPILER gcc)
#set(CMAKE_CXX_COMPILER g++)
project(LibTess VERSION 1.6 LANGUAGES C)
# 添加配置配件编写的函数
include(CMakePackageConfigHelpers)
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
set(CMAKE_INSTALL_PREFIX D:/Library)
else()
message(STATUS "Platform: " ${CMAKE_HOST_SYSTEM_NAME})
set(CMAKE_INSTALL_PREFIX /usr/local)
set(CMAKE_INSTALL_PREFIX /opt/stow/tess)
endif()
message(STATUS "Platform: " ${CMAKE_HOST_SYSTEM_NAME})
message(STATUS "Install prefix: " ${CMAKE_INSTALL_PREFIX})
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
# 添加库源文件地址
add_subdirectory(lib)