2019-12-01 18:23:59 +00:00
# UVAtlas Isochart Atlas Library
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkID=512686
cmake_minimum_required ( VERSION 3.11 )
project ( UVAtlas LANGUAGES CXX )
2020-02-10 17:04:36 +00:00
# #pragma omp is used to specify Directives and Clauses. If /openmp is not specified in a compilation, the compiler ignores OpenMP clauses and directives
add_compile_options ( $< $<CXX_COMPILER_ID:MSVC > :/openmp> )
2019-12-14 01:18:02 +00:00
option ( BUILD_TOOLS "Build UVAtlasTool" ON )
2019-12-01 18:23:59 +00:00
set ( CMAKE_CXX_STANDARD 14 )
set ( CMAKE_CXX_STANDARD_REQUIRED ON )
set ( CMAKE_CXX_EXTENSIONS OFF )
set ( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/CMake" )
set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/CMake" )
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/CMake" )
add_library ( ${ PROJECT_NAME } STATIC
U V A t l a s / m a x h e a p . h p p
U V A t l a s / p c h . h
U V A t l a s / i n c / U V A t l a s . h
U V A t l a s / g e o d e s i c s / A p p r o x i m a t e O n e T o A l l . c p p
U V A t l a s / g e o d e s i c s / A p p r o x i m a t e O n e T o A l l . h
U V A t l a s / g e o d e s i c s / d a t a t y p e s . h
U V A t l a s / g e o d e s i c s / E x a c t O n e T o A l l . c p p
U V A t l a s / g e o d e s i c s / E x a c t O n e T o A l l . h
U V A t l a s / g e o d e s i c s / m a t h u t i l s . c p p
U V A t l a s / g e o d e s i c s / m a t h u t i l s . h
U V A t l a s / g e o d e s i c s / m i n h e a p . h p p
U V A t l a s / i s o c h a r t / b a r y c e n t r i c p a r a m . c p p
U V A t l a s / i s o c h a r t / b a s e m e s h i n f o . c p p
U V A t l a s / i s o c h a r t / b a s e m e s h i n f o . h
U V A t l a s / i s o c h a r t / c a l l b a c k s c h e m e r . h
U V A t l a s / i s o c h a r t / g r a p h c u t . c p p
U V A t l a s / i s o c h a r t / g r a p h c u t . h
U V A t l a s / i s o c h a r t / i m t c o m p u t a t i o n . c p p
U V A t l a s / i s o c h a r t / i s o c h a r t . c p p
U V A t l a s / i s o c h a r t / i s o c h a r t . h
U V A t l a s / i s o c h a r t / i s o c h a r t c o n f i g . h
U V A t l a s / i s o c h a r t / i s o c h a r t e n g i n e . c p p
U V A t l a s / i s o c h a r t / i s o c h a r t e n g i n e . h
U V A t l a s / i s o c h a r t / i s o c h a r t m e s h . c p p
U V A t l a s / i s o c h a r t / i s o c h a r t m e s h . h
U V A t l a s / i s o c h a r t / i s o c h a r t u t i l . c p p
U V A t l a s / i s o c h a r t / i s o c h a r t u t i l . h
U V A t l a s / i s o c h a r t / i s o m a p . c p p
U V A t l a s / i s o c h a r t / i s o m a p . h
U V A t l a s / i s o c h a r t / l s c m p a r a m . c p p
U V A t l a s / i s o c h a r t / m e r g e c h a r t s . c p p
U V A t l a s / i s o c h a r t / m e s h a p p l y i s o m a p . c p p
U V A t l a s / i s o c h a r t / m e s h c o m m o n . i n l
U V A t l a s / i s o c h a r t / m e s h o p t i m i z e b o u n d a r i e s . c p p
U V A t l a s / i s o c h a r t / m e s h o p t i m i z e s t r e t c h . c p p
U V A t l a s / i s o c h a r t / m e s h p a r t i t i o n c h a r t . c p p
U V A t l a s / i s o c h a r t / p a c k i n g c h a r t s . c p p
U V A t l a s / i s o c h a r t / p r o g r e s s i v e m e s h . c p p
U V A t l a s / i s o c h a r t / p r o g r e s s i v e m e s h . h
U V A t l a s / i s o c h a r t / s p a r s e m a t r i x . h p p
U V A t l a s / i s o c h a r t / S y m m e t r i c M a t r i x . h p p
U V A t l a s / i s o c h a r t / U V A t l a s . c p p
U V A t l a s / i s o c h a r t / U V A t l a s R e p a c k e r . c p p
U V A t l a s / i s o c h a r t / U V A t l a s R e p a c k e r . h
U V A t l a s / i s o c h a r t / v e r t i t e r . c p p
U V A t l a s / i s o c h a r t / v e r t i t e r . h
U V A t l a s / i s o c h a r t / V i s _ M a x f l o w . c p p
U V A t l a s / i s o c h a r t / V i s _ M a x f l o w . h
)
source_group ( inc REGULAR_EXPRESSION UVAtlas/inc/*.* )
source_group ( geodesics REGULAR_EXPRESSION UVAtlas/geodesics/*.* )
source_group ( isochart REGULAR_EXPRESSION UVAtlas/isochart/*.* )
source_group ( isochart REGULAR_EXPRESSION UVAtlas/isochart/*.* )
target_include_directories ( ${ PROJECT_NAME } PUBLIC UVAtlas/inc )
target_include_directories ( ${ PROJECT_NAME } PRIVATE UVAtlas UVAtlas/UVAtlas/geodesics UVAtlas/isochart )
2019-12-02 18:52:46 +00:00
if ( MSVC )
# Use higher Warning Level
string ( REPLACE "/W3 " "/W4 " CMAKE_CXX_FLAGS ${ CMAKE_CXX_FLAGS } )
string ( REPLACE "/W3 " "/W4 " CMAKE_CXX_FLAGS_DEBUG ${ CMAKE_CXX_FLAGS_DEBUG } )
string ( REPLACE "/W3 " "/W4 " CMAKE_CXX_FLAGS_RELEASE ${ CMAKE_CXX_FLAGS_RELEASE } )
# Not using typeid or dynamic_cast, so disable RTTI to save binary size
string ( REPLACE "/GR " "/GR- " CMAKE_CXX_FLAGS ${ CMAKE_CXX_FLAGS } )
string ( REPLACE "/GR " "/GR- " CMAKE_CXX_FLAGS_DEBUG ${ CMAKE_CXX_FLAGS_DEBUG } )
string ( REPLACE "/GR " "/GR- " CMAKE_CXX_FLAGS_RELEASE ${ CMAKE_CXX_FLAGS_RELEASE } )
endif ( )
2019-12-01 18:23:59 +00:00
2019-12-14 01:18:02 +00:00
if ( BUILD_TOOLS MATCHES ON )
2019-12-12 00:42:55 +00:00
if ( NOT EXISTS "${CMAKE_SOURCE_DIR}/../DirectXMesh/CMakeLists.txt" )
message ( FATAL_ERROR "uvatalastool requires DirectXMesh library from http://go.microsoft.com/fwlink/?LinkID=324981" )
endif ( )
if ( NOT EXISTS "${CMAKE_SOURCE_DIR}/../DirectXTex/CMakeLists.txt" )
message ( FATAL_ERROR "uvatalastool requires DirectXTex library from http://go.microsoft.com/fwlink/?LinkId=248926" )
endif ( )
2019-12-01 18:23:59 +00:00
2019-12-12 00:42:55 +00:00
add_subdirectory ( ${ CMAKE_SOURCE_DIR } /../DirectXMesh ${ CMAKE_BINARY_DIR } /bin/CMake/DirectXMesh )
add_subdirectory ( ${ CMAKE_SOURCE_DIR } /../DirectXTex ${ CMAKE_BINARY_DIR } /bin/CMake/DirectXTex )
add_executable ( uvatlastool
U V A t l a s T o o l / U V A t l a s . c p p
U V A t l a s T o o l / M e s h . c p p
U V A t l a s T o o l / M e s h . h
U V A t l a s T o o l / M e s h O B J . c p p
U V A t l a s T o o l / S D K M e s h . h )
target_link_libraries ( uvatlastool ${ PROJECT_NAME } DirectXMesh DirectXTex )
target_include_directories ( uvatlastool PRIVATE ../DirectXMesh/DirectXMesh ../DirectXMesh/Utilities ../DirectXTex/DirectXTex )
endif ( )
2019-12-01 18:23:59 +00:00
2019-12-02 18:52:46 +00:00
if ( MSVC )
target_compile_options ( ${ PROJECT_NAME } PRIVATE /fp:fast )
2019-12-14 01:18:02 +00:00
if ( BUILD_TOOLS MATCHES ON )
2019-12-12 00:42:55 +00:00
target_compile_options ( uvatlastool PRIVATE /fp:fast )
endif ( )
2019-12-01 18:23:59 +00:00
2019-12-02 18:52:46 +00:00
if ( ${ CMAKE_SIZEOF_VOID_P } EQUAL "4" )
target_compile_options ( ${ PROJECT_NAME } PRIVATE /arch:SSE2 )
2019-12-14 01:18:02 +00:00
if ( BUILD_TOOLS MATCHES ON )
2019-12-12 00:42:55 +00:00
target_compile_options ( uvatlastool PRIVATE /arch:SSE2 )
endif ( )
2019-12-02 18:52:46 +00:00
endif ( )
2019-12-01 18:23:59 +00:00
endif ( )
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
set ( WarningsLib "-Wpedantic" "-Wextra" )
target_compile_options ( ${ PROJECT_NAME } PRIVATE ${ WarningsLib } )
2019-12-14 01:18:02 +00:00
if ( BUILD_TOOLS MATCHES ON )
2019-12-12 00:42:55 +00:00
set ( WarningsEXE ${ WarningsLib } "-Wno-c++98-compat" "-Wno-c++98-compat-pedantic" "-Wno-exit-time-destructors" "-Wno-switch" "-Wno-switch-enum" "-Wno-language-extension-token" "-Wno-missing-prototypes" )
target_compile_options ( uvatlastool PRIVATE ${ WarningsEXE } )
endif ( )
2019-12-01 18:23:59 +00:00
endif ( )
2019-12-12 00:42:55 +00:00
2019-12-01 18:23:59 +00:00
if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_compile_options ( ${ PROJECT_NAME } PRIVATE /permissive- /JMC- /Zc:__cplusplus )
target_compile_options ( uvatlastool PRIVATE /permissive- /Zc:__cplusplus )
2019-12-14 01:18:02 +00:00
if ( BUILD_TOOLS MATCHES ON )
2019-12-12 00:42:55 +00:00
set ( WarningsEXE "/wd4365" "/wd4710" "/wd4820" "/wd5039" "/wd5045" )
target_compile_options ( uvatlastool PRIVATE ${ WarningsEXE } )
endif ( )
2019-12-01 18:23:59 +00:00
endif ( )
2019-12-11 23:08:37 +00:00
if ( MSVC )
# We use Windows 7 here
target_compile_definitions ( ${ PROJECT_NAME } PRIVATE _UNICODE UNICODE _WIN32_WINNT=0x0601 )
2019-12-14 01:18:02 +00:00
if ( BUILD_TOOLS MATCHES ON )
2019-12-12 00:42:55 +00:00
target_compile_definitions ( uvatlastool PRIVATE _UNICODE UNICODE _WIN32_WINNT=0x0601 )
endif ( )
2019-12-11 23:08:37 +00:00
endif ( )