forked from skyrpex/clipper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
24 lines (20 loc) · 1.19 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
cmake_minimum_required(VERSION 2.8.12)
project(polyclipping)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Release type")
# The header name clipper.hpp is too generic, so install in a subdirectory
set(CMAKE_INSTALL_INCDIR "${CMAKE_INSTALL_PREFIX}/include/polyclipping")
set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
set(CMAKE_INSTALL_PKGCONFIGDIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig")
set(PCFILE "${CMAKE_CURRENT_BINARY_DIR}/polyclipping.pc")
set(BUILD_SHARED_LIBS OFF CACHE BOOL
"Build shared libraries (.dll/.so) instead of static ones (.lib/.a)")
add_library(${PROJECT_NAME} src/clipper.cpp)
target_include_directories(
${PROJECT_NAME}
PUBLIC $<BUILD_INTERFACE:${${PROJECT_NAME}_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
configure_file(cmake/polyclipping.pc.cmakein "${PCFILE}" @ONLY)
install(FILES include/polyclipping/clipper.hpp DESTINATION "${CMAKE_INSTALL_INCDIR}/polyclipping/")
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(FILES "${PCFILE}" DESTINATION "${CMAKE_INSTALL_PKGCONFIGDIR}")
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION 22.0.0 SOVERSION 22 )