Skip to content

Commit

Permalink
Documentation pass
Browse files Browse the repository at this point in the history
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
  • Loading branch information
kdt3rd committed Jul 17, 2019
1 parent 9067b79 commit ba22a8e
Show file tree
Hide file tree
Showing 5 changed files with 324 additions and 190 deletions.
106 changes: 45 additions & 61 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# "More Modern" CMake version
cmake_minimum_required(VERSION 3.12)

set(CMAKE_PREFIX_PATH "/prefix")
# Hint: This can be set to enable custom find_package
# search paths, probably best to set it when configuring
# on the command line to cmake instead of setting it
# here.
###set(CMAKE_PREFIX_PATH "/prefix")

project(OpenEXRMetaProject)

# An "official" way to make this a super-project
# basically overrides the find_package to not find anything
Expand All @@ -13,70 +19,48 @@ macro(find_package)
endif()
endmacro()

enable_testing()

add_subdirectory(IlmBase)
# TODO:
#add_subdirectory(PyIlmBase)
add_subdirectory(OpenEXR)
# TODO:
#add_subdirectory(OpenEXR_Viewers)

#[==[

# Packages

if (OPENEXR_BUILD_PYTHON_LIBS)
find_package(PythonLibs ${OPENEXR_PYTHON_MAJOR}.${OPENEXR_PYTHON_MINOR})
if(NOT PythonLibs_FOUND)
message(WARNING "Make Python ${OPENEXR_PYTHON_MAJOR}.${OPENEXR_PYTHON_MINOR} available to CMake's search path, and re-run configuration")
message(FATAL_ERROR "Python is a required dependency when OPENEXR_BUILD_PYTHON_LIBS is set")
endif()

find_package(Boost)
# Boost.Python use a new versioning scheme starting with Boost 1.67
if(Boost_VERSION VERSION_GREATER_EQUAL 106700)
find_package(Boost COMPONENTS python${OPENEXR_PYTHON_MAJOR}${OPENEXR_PYTHON_MINOR})
if(NOT Boost_PYTHON${OPENEXR_PYTHON_MAJOR}${OPENEXR_PYTHON_MINOR}_FOUND)
message(WARNING "user provided Boost Python${OPENEXR_PYTHON_MAJOR}${OPENEXR_PYTHON_MINOR} was not found. Trying default path...")
set(FIND_DEFAULT_PYTHON TRUE)
endif()
# If you want to use ctest to configure, build and
# upload the results, cmake has builtin support for
# submitting to CDash, or any server who speaks the
# same protocol
#
# These settings will need to be set for your environment,
# and then a script such as the example in
#
# cmake/SampleCTestScript.cmake
#
# edited and placed into the CI system, then run:
#
# cmake -S cmake/SampleCTestScript.cmake
#
# [or whatever you name the file you edit]
#
#set(CTEST_PROJECT_NAME "OpenEXR")
#set(CTEST_NIGHTLY_START_TIME "01:01:01 UTC")
#set(CTEST_DROP_METHOD "http") # there are others...
#set(CTEST_DROP_SITE "open.cdash.org")
#set(CTEST_DROP_LOCATION "/submit.php?project=MyProject")
#set(CTEST_DROP_SITE_CDASH TRUE)

else()
# older Boost versions < 1.67
if(OPENEXR_PYTHON_MAJOR VERSION_GREATER_EQUAL 3)
find_package(Boost COMPONENTS python${OPENEXR_PYTHON_MAJOR})
if(NOT Boost_PYTHON${OPENEXR_PYTHON_MAJOR}_FOUND)
message(WARNING "user provided Boost Python${OPENEXR_PYTHON_MAJOR} was not found. Trying default path...")
set(FIND_DEFAULT_PYTHON TRUE)
endif()
else()
set(FIND_DEFAULT_PYTHON TRUE)
endif()
endif()
include(CTest)
if(BUILD_TESTING)
enable_testing()
endif()

if(FIND_DEFAULT_PYTHON)
find_package(Boost COMPONENTS python)
if(NOT Boost_PYTHON_FOUND)
message(WARNING "Make boost Python available to CMake's search path, and re-run configuration")
message(FATAL_ERROR "boost Python is a required dependency when OPENEXR_BUILD_PYTHON_LIBS is set")
endif()
endif()
# Include these two modules without enable/disable options
add_subdirectory(IlmBase)
add_subdirectory(OpenEXR)

find_package(NumPy)
# should this just be always on and we conditionally compile what
# is found and warn otherwise? or error out?
option(PYILMBASE_ENABLE "Enables configuration of the PyIlmBase module" ON)
if(PYILMBASE_ENABLE)
add_subdirectory(PyIlmBase)
endif()

if(OPENEXR_BUILD_VIEWERS)
message(WARNING "Viewers are currently out of order. Building anyway")
SET (FLTK_SKIP_FLUID 1)
find_package(FLTK)
if(NOT FLTK_FOUND)
message(WARNING "FLTK not found, exrdisplay will not be built")
endif()
find_package(OpenGL)
if(NOT OpenGL_FOUND)
message(WARNING "OpenGL not found, exrdisplay will not be built")
endif()
option(OPENEXRVIEWERS_ENABLE "Enables configuration of the viewers module" OFF)
if(OPENEXRVIEWERS_ENABLE)
# TODO:
# add_subdirectory(OpenEXR_Viewers)
endif()

#]==]
Loading

0 comments on commit ba22a8e

Please sign in to comment.