Skip to content

Commit

Permalink
Bump CMake version, silence OpenGL warnings, fix MacOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
dvicini committed Jan 28, 2020
1 parent fa17526 commit be46ccc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.10)
cmake_minimum_required (VERSION 3.2)
project(nori)

add_subdirectory(ext ext_build)
Expand Down
9 changes: 4 additions & 5 deletions ext/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ if (MSVC)
foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()
elseif(APPLE)
# Try to auto-detect a suitable SDK
execute_process(COMMAND bash -c "xcodebuild -version -sdk | grep MacOSX | grep Path | head -n 1 | cut -f 2 -d ' '" OUTPUT_VARIABLE CMAKE_OSX_SYSROOT)
string(REGEX REPLACE "(\r?\n)+$" "" CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT}")
string(REGEX REPLACE "^.*X([0-9.]*).sdk$" "\\1" CMAKE_OSX_DEPLOYMENT_TARGET "${CMAKE_OSX_SYSROOT}")
endif()

if (WIN32)
Expand Down Expand Up @@ -138,6 +133,10 @@ set(TBB_BUILD_TESTS OFF CACHE BOOL " " FORCE)
add_subdirectory(tbb)
set_property(TARGET tbb_static tbb_def_files PROPERTY FOLDER "dependencies")

if (APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGL_SILENCE_DEPRECATION=1")
endif()

# Build NanoGUI
set(NANOGUI_BUILD_EXAMPLE OFF CACHE BOOL " " FORCE)
set(NANOGUI_BUILD_SHARED OFF CACHE BOOL " " FORCE)
Expand Down

0 comments on commit be46ccc

Please sign in to comment.