From d142ef1ae52e2601a6a7927a4fcff17e45f8c056 Mon Sep 17 00:00:00 2001 From: Eugene Mironov Date: Mon, 27 Sep 2021 16:26:50 +0200 Subject: [PATCH] Better support build on *NIX platforms --- Build/CMake/Modules/GLTFPlatform.cmake | 2 ++ GLTFSDK.Samples/Deserialize/CMakeLists.txt | 4 ++++ GLTFSDK.Samples/Serialize/CMakeLists.txt | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/Build/CMake/Modules/GLTFPlatform.cmake b/Build/CMake/Modules/GLTFPlatform.cmake index 3d940f5..e9ee760 100644 --- a/Build/CMake/Modules/GLTFPlatform.cmake +++ b/Build/CMake/Modules/GLTFPlatform.cmake @@ -39,6 +39,8 @@ elseif (IOS_PLATFORM) endif() elseif (MSVC) set(${outPlatform} "windows_${CMAKE_GENERATOR_PLATFORM}" PARENT_SCOPE) +elseif (UNIX AND NOT APPLE) + set(${outPlatform} "${CMAKE_SYSTEM_NAME}" PARENT_SCOPE) else() # MacOS set(${outPlatform} macOS PARENT_SCOPE) diff --git a/GLTFSDK.Samples/Deserialize/CMakeLists.txt b/GLTFSDK.Samples/Deserialize/CMakeLists.txt index 791898c..8bd25b2 100644 --- a/GLTFSDK.Samples/Deserialize/CMakeLists.txt +++ b/GLTFSDK.Samples/Deserialize/CMakeLists.txt @@ -31,4 +31,8 @@ target_link_libraries(Deserialize GLTFSDK ) +if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.1) + target_link_libraries(Deserialize stdc++fs) +endif() + CreateGLTFInstallTargets(Deserialize ${Platform}) diff --git a/GLTFSDK.Samples/Serialize/CMakeLists.txt b/GLTFSDK.Samples/Serialize/CMakeLists.txt index 5269da8..63180ba 100644 --- a/GLTFSDK.Samples/Serialize/CMakeLists.txt +++ b/GLTFSDK.Samples/Serialize/CMakeLists.txt @@ -31,4 +31,8 @@ target_link_libraries(Serialize GLTFSDK ) +if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.1) + target_link_libraries(Serialize stdc++fs) +endif() + CreateGLTFInstallTargets(Serialize ${Platform})