48 lines
1.7 KiB
CMake
48 lines
1.7 KiB
CMake
cmake_minimum_required(VERSION 3.10)
|
|
project(geometry)
|
|
|
|
set(TARGET geometry)
|
|
set(PUBLIC_HDR_DIR include)
|
|
|
|
# ==================================================================================================
|
|
# Sources and headers
|
|
# ==================================================================================================
|
|
set(PUBLIC_HDRS
|
|
include/geometry/SurfaceOrientation.h
|
|
)
|
|
|
|
set(SRCS
|
|
src/SurfaceOrientation.cpp
|
|
)
|
|
|
|
# ==================================================================================================
|
|
# Include and target definitions
|
|
# ==================================================================================================
|
|
include_directories(${PUBLIC_HDR_DIR})
|
|
|
|
add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS})
|
|
|
|
target_link_libraries(${TARGET} PUBLIC math utils)
|
|
|
|
target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR})
|
|
|
|
# ==================================================================================================
|
|
# Compiler flags
|
|
# ==================================================================================================
|
|
if (MSVC)
|
|
target_compile_options(${TARGET} PRIVATE $<$<CONFIG:Release>:/fp:fast>)
|
|
else()
|
|
target_compile_options(${TARGET} PRIVATE $<$<CONFIG:Release>:-ffast-math>)
|
|
target_compile_options(${TARGET} PRIVATE -Wno-deprecated-register)
|
|
endif()
|
|
|
|
if (LINUX)
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
|
|
endif()
|
|
|
|
# ==================================================================================================
|
|
# Installation
|
|
# ==================================================================================================
|
|
install(TARGETS ${TARGET} ARCHIVE DESTINATION lib/${DIST_DIR})
|
|
install(DIRECTORY ${PUBLIC_HDR_DIR}/geometry DESTINATION include)
|