Skip to content

Commit

Permalink
Lower cmake version dependence
Browse files Browse the repository at this point in the history
We can support 3.10 as long as the user isn't requesting a scenario
where we need object libraries and we don't build pyilmbase

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
  • Loading branch information
kdt3rd committed Sep 14, 2019
1 parent f28b353 commit 1bd7e84
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
15 changes: 13 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@

# We require this to get object library link library support and
# combined python 2 + 3 support
cmake_minimum_required(VERSION 3.12)
if(OPENEXR_BUILD_BOTH_STATIC_SHARED OR ILMBASE_BUILD_BOTH_STATIC_SHARED)
if (${CMAKE_VERSION} VERSION_LESS "3.12.0")
message(FATAL_ERROR "CMake 3.12 or newer is required for object library support when building both static and shared libraries")
endif()
cmake_minimum_required(VERSION 3.12)
else()
cmake_minimum_required(VERSION 3.10)
endif()

# Hint: This can be set to enable custom find_package
# search paths, probably best to set it when configuring
Expand Down Expand Up @@ -62,7 +69,11 @@ add_subdirectory(OpenEXR)
# is found and warn otherwise? or error out?
option(PYILMBASE_ENABLE "Enables configuration of the PyIlmBase module" ON)
if(PYILMBASE_ENABLE)
add_subdirectory(PyIlmBase)
if (${CMAKE_VERSION} VERSION_LESS "3.12.0")
message(WARNING ": CMake version ${CMAKE_VERSION} detected, PyIlmBase uses newer features of cmake (>= 3.12), disabling")
else()
add_subdirectory(PyIlmBase)
endif()
endif()

option(OPENEXR_VIEWERS_ENABLE "Enables configuration of the viewers module" ON)
Expand Down
9 changes: 8 additions & 1 deletion IlmBase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@

# We require this to get object library link library support and
# combined python 2 + 3 support
cmake_minimum_required(VERSION 3.12)
if(ILMBASE_BUILD_BOTH_STATIC_SHARED)
if (${CMAKE_VERSION} VERSION_LESS "3.12.0")
message(FATAL_ERROR "CMake 3.12 or newer is required for object library support when building both static and shared libraries")
endif()
cmake_minimum_required(VERSION 3.12)
else()
cmake_minimum_required(VERSION 3.10)
endif()

# we include this first to parse configure.ac and extract the version
# numbers
Expand Down

0 comments on commit 1bd7e84

Please sign in to comment.