Skip to content

Commit

Permalink
Documentation pass
Browse files Browse the repository at this point in the history
Signed-off-by: Kimball Thurston <[email protected]>
  • Loading branch information
kdt3rd committed Jul 17, 2019
1 parent c98b486 commit 0fdad85
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 89 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()

#]==]
29 changes: 1 addition & 28 deletions IlmBase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,36 +38,9 @@ add_subdirectory( IlmThread )
# Can't seem to do EXCLUDE_FROM_ALL on the test executables
# since you can't then create a dependency on the internal
# "test" target such that it is auto built
enable_testing()
include(CTest)
if(BUILD_TESTING)
# TODO:
#include(CTest)
#set(CTEST_PROJECT_NAME "OpenEXR - IlmBase")
#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)
#
# Then can make a ctest script that has something like the following
# in it:
# set(CTEST_SOURCE_DIRECTORY "/source")
# set(CTEST_BINARY_DIRECTORY "/binary")
#
# set(ENV{CXXFLAGS} "--coverage")
# set(CTEST_CMAKE_GENERATOR "Ninja")
# set(CTEST_USE_LAUNCHERS 1)
# set(CTEST_COVERAGE_COMMAND "gcov")
# set(CTEST_MEMORYCHECK_COMMAND "valgrind")
# #set(CTEST_MEMORYCHECK_TYPE "ThreadSanitizer")
# ctest_start("Continuous")
# ctest_configure()
# ctest_build()
# ctest_test()
# ctest_coverage()
# ctest_memcheck()
# ctest_submit()
enable_testing()

add_subdirectory( HalfTest )
add_subdirectory( IexTest )
Expand Down
59 changes: 59 additions & 0 deletions cmake/SampleCTestScript.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This is a sample cmake test script that can be used to integrate into
# a larger CI setup if you are building your own versions of OpenEXR
# and also use a cdash (or cdash compliant) results server.
#
# There are also settings in the CMakeLists.txt you may wish to
# just set in there, or replicate here.

# Running ctest -S thisscript.cmake will build into the binary directory
# and run a few different tests based on what commands are specified
# (and the steps below). It is best to read the ctest docs to
# understand all these settings, and how to control it, this is merely
# provided as a sample

# An edited version (or multiple) are intended to be placed in the CI
# system, and putting O.S. / configuration specific control to this file
# instead of having to put it into the make CMakeLists.txt tree
# somehow.

# this contains the path to the source tree. This may come in as an
# environment variable from the CI system, but you are free to have
# any path in here
set(CTEST_SOURCE_DIRECTORY "$ENV{PATH_TO_OPENEXR_TREE}")
# Similarly, this is scratch space used to configure, build
# and run the various tests.
# For CI builds, it is recommended to make sure this is a
# unique tree for each build
set(CTEST_BINARY_DIRECTORY "/tmp/ctest")

# set an override for any compile flags to enable coverage
# NB: This can make some of the auxiliary binaries such as the
# dwa lookup table generator quite slow
#set(ENV{CXXFLAGS} "--coverage")

# If you have alternate build systems, you can control that here
#set(CTEST_CMAKE_GENERATOR "Ninja")
set(CTEST_USE_LAUNCHERS 1)

# The various paths to programs to run coverage and memory checks
set(CTEST_COVERAGE_COMMAND "gcov")
set(CTEST_MEMORYCHECK_COMMAND "valgrind")
#set(CTEST_MEMORYCHECK_TYPE "ThreadSanitizer")
#

# any of the usual configurations (Debug, Release, etc).
# We do not attempt to create any alternate configurations
set(CTEST_CONFIGURATION_TYPE "RelWithDebInfo")

# can be Continuous, Nightly, or Experimental (see the cmake docs)
ctest_start("Continuous")

# applies the various ctest steps
ctest_configure()
ctest_build()
ctest_test()
ctest_coverage()
ctest_memcheck()

# This uploads the results to the server you configured
ctest_submit()

0 comments on commit 0fdad85

Please sign in to comment.