diff --git a/CMakeLists.txt b/CMakeLists.txt index fa9b97d9f..e62e51894 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -259,7 +259,6 @@ if(OCIO_BUILD_DOCS) endif() add_subdirectory(tests) add_subdirectory(src) -add_subdirectory(include) add_subdirectory(ext) diff --git a/docs/conf.py b/docs/conf.py index 6caf9ff7a..6a2921a4c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -61,8 +61,8 @@ description = "@CMAKE_PROJECT_DESCRIPTION@" version = "@CMAKE_PROJECT_VERSION@" version_major = "@OpenColorIO_VERSION_MAJOR@" - version_minor = "@OpenColorIO_VERSION_MAJOR@" - version_patch = "@OpenColorIO_VERSION_MAJOR@" + version_minor = "@OpenColorIO_VERSION_MINOR@" + version_patch = "@OpenColorIO_VERSION_PATCH@" ocio_namespace = "@OCIO_NAMESPACE@" author = "Contributors to the {} Project".format(project) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt deleted file mode 100644 index 0bb5d3133..000000000 --- a/include/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright Contributors to the OpenColorIO Project. - -add_subdirectory(OpenColorIO) diff --git a/include/OpenColorIO/CMakeLists.txt b/include/OpenColorIO/CMakeLists.txt deleted file mode 100644 index 64980f661..000000000 --- a/include/OpenColorIO/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright Contributors to the OpenColorIO Project. - -configure_file("OpenColorABI.h.in" "${CMAKE_CURRENT_BINARY_DIR}/OpenColorABI.h" @ONLY) -add_library(OpenColorIOHeaders INTERFACE) - -set(BUILD_INCLUDES - ${CMAKE_CURRENT_SOURCE_DIR}/.. - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIO -) - -target_include_directories(OpenColorIOHeaders - INTERFACE - "$" - "$" -) - -add_dependencies(OpenColorIOHeaders "${CMAKE_CURRENT_BINARY_DIR}/OpenColorABI.h") - -# public interface - -file(GLOB_RECURSE core_export_headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h") -list(APPEND core_export_headers ${CMAKE_CURRENT_BINARY_DIR}/OpenColorABI.h) - -install(FILES ${core_export_headers} - DESTINATION include/OpenColorIO) - -install(TARGETS OpenColorIOHeaders - EXPORT ${PROJECT_NAME}_EXPORTED_TARGETS -) diff --git a/src/OpenColorIO/CMakeLists.txt b/src/OpenColorIO/CMakeLists.txt index be50b7b6c..e7b173c06 100755 --- a/src/OpenColorIO/CMakeLists.txt +++ b/src/OpenColorIO/CMakeLists.txt @@ -2,171 +2,171 @@ # Copyright Contributors to the OpenColorIO Project. set(SOURCES - apphelpers/CategoryHelpers.cpp - apphelpers/ColorSpaceHelpers.cpp - apphelpers/DisplayViewHelpers.cpp - apphelpers/LegacyViewingPipeline.cpp - apphelpers/MixingHelpers.cpp - Baker.cpp - BitDepthUtils.cpp - Caching.cpp - ColorSpace.cpp - ColorSpaceSet.cpp - Config.cpp - Context.cpp - ContextVariableUtils.cpp - CPUProcessor.cpp - Display.cpp - DynamicProperty.cpp - Exception.cpp - fileformats/cdl/CDLParser.cpp - fileformats/cdl/CDLReaderHelper.cpp - fileformats/cdl/CDLWriter.cpp - fileformats/ctf/CTFReaderHelper.cpp - fileformats/ctf/CTFReaderUtils.cpp - fileformats/ctf/CTFTransform.cpp - fileformats/ctf/IndexMapping.cpp - fileformats/FileFormat3DL.cpp - fileformats/FileFormatCCC.cpp - fileformats/FileFormatCC.cpp - fileformats/FileFormatCDL.cpp - fileformats/FileFormatCSP.cpp - fileformats/FileFormatCTF.cpp - fileformats/FileFormatDiscreet1DL.cpp - fileformats/FileFormatHDL.cpp - fileformats/FileFormatICC.cpp - fileformats/FileFormatIridasCube.cpp - fileformats/FileFormatIridasItx.cpp - fileformats/FileFormatIridasLook.cpp - fileformats/FileFormatPandora.cpp - fileformats/FileFormatResolveCube.cpp - fileformats/FileFormatSpi1D.cpp - fileformats/FileFormatSpi3D.cpp - fileformats/FileFormatSpiMtx.cpp - fileformats/FileFormatTruelight.cpp - fileformats/FileFormatUtils.cpp - fileformats/FileFormatVF.cpp - fileformats/FormatMetadata.cpp - fileformats/xmlutils/XMLReaderHelper.cpp - fileformats/xmlutils/XMLReaderUtils.cpp - fileformats/xmlutils/XMLWriterUtils.cpp - FileRules.cpp - GPUProcessor.cpp - GpuShader.cpp - GpuShaderDesc.cpp - GpuShaderUtils.cpp - HashUtils.cpp - ImageDesc.cpp - ImagePacking.cpp - Logging.cpp - Look.cpp - LookParse.cpp - MathUtils.cpp - md5/md5.cpp - NamedTransform.cpp - OCIOYaml.cpp - Op.cpp - OpOptimizers.cpp - ops/allocation/AllocationOp.cpp - ops/cdl/CDLOpCPU.cpp - ops/cdl/CDLOpData.cpp - ops/cdl/CDLOpGPU.cpp - ops/cdl/CDLOp.cpp - ops/exponent/ExponentOp.cpp - ops/exposurecontrast/ExposureContrastOpCPU.cpp - ops/exposurecontrast/ExposureContrastOpData.cpp - ops/exposurecontrast/ExposureContrastOpGPU.cpp - ops/exposurecontrast/ExposureContrastOp.cpp - ops/fixedfunction/FixedFunctionOpCPU.cpp - ops/fixedfunction/FixedFunctionOpData.cpp - ops/fixedfunction/FixedFunctionOpGPU.cpp - ops/fixedfunction/FixedFunctionOp.cpp - ops/gamma/GammaOpCPU.cpp - ops/gamma/GammaOpData.cpp - ops/gamma/GammaOpGPU.cpp - ops/gamma/GammaOpUtils.cpp - ops/gamma/GammaOp.cpp - ops/gradingprimary/GradingPrimary.cpp - ops/gradingprimary/GradingPrimaryOpCPU.cpp - ops/gradingprimary/GradingPrimaryOpData.cpp - ops/gradingprimary/GradingPrimaryOpGPU.cpp - ops/gradingprimary/GradingPrimaryOp.cpp - ops/gradingrgbcurve/GradingBSplineCurve.cpp - ops/gradingrgbcurve/GradingRGBCurveOpCPU.cpp - ops/gradingrgbcurve/GradingRGBCurveOpData.cpp - ops/gradingrgbcurve/GradingRGBCurveOpGPU.cpp - ops/gradingrgbcurve/GradingRGBCurveOp.cpp - ops/gradingrgbcurve/GradingRGBCurve.cpp - ops/gradingtone/GradingTone.cpp - ops/gradingtone/GradingToneOpCPU.cpp - ops/gradingtone/GradingToneOpData.cpp - ops/gradingtone/GradingToneOpGPU.cpp - ops/gradingtone/GradingToneOp.cpp - ops/log/LogOpCPU.cpp - ops/log/LogOpData.cpp - ops/log/LogOpGPU.cpp - ops/log/LogOp.cpp - ops/log/LogUtils.cpp - ops/lut1d/Lut1DOp.cpp - ops/lut1d/Lut1DOpCPU.cpp - ops/lut1d/Lut1DOpData.cpp - ops/lut1d/Lut1DOpGPU.cpp - ops/lut3d/Lut3DOp.cpp - ops/lut3d/Lut3DOpCPU.cpp - ops/lut3d/Lut3DOpData.cpp - ops/lut3d/Lut3DOpGPU.cpp - ops/matrix/MatrixOpCPU.cpp - ops/matrix/MatrixOpData.cpp - ops/matrix/MatrixOpGPU.cpp - ops/matrix/MatrixOp.cpp - ops/noop/NoOps.cpp - ops/OpTools.cpp - ops/range/RangeOpCPU.cpp - ops/range/RangeOpData.cpp - ops/range/RangeOpGPU.cpp - ops/range/RangeOp.cpp - ops/reference/ReferenceOpData.cpp - ParseUtils.cpp - PathUtils.cpp - Platform.cpp - Processor.cpp - ScanlineHelper.cpp - Transform.cpp - transforms/AllocationTransform.cpp - transforms/builtins/ACES.cpp - transforms/builtins/BuiltinTransformRegistry.cpp - transforms/builtins/ColorMatrixHelpers.cpp - transforms/builtins/OpHelpers.cpp - transforms/builtins/ArriCameras.cpp - transforms/builtins/CanonCameras.cpp - transforms/builtins/Displays.cpp - transforms/builtins/PanasonicCameras.cpp - transforms/builtins/RedCameras.cpp - transforms/builtins/SonyCameras.cpp - transforms/BuiltinTransform.cpp - transforms/CDLTransform.cpp - transforms/ColorSpaceTransform.cpp - transforms/DisplayViewTransform.cpp - transforms/ExponentTransform.cpp - transforms/ExponentWithLinearTransform.cpp - transforms/ExposureContrastTransform.cpp - transforms/FileTransform.cpp - transforms/FixedFunctionTransform.cpp - transforms/GradingPrimaryTransform.cpp - transforms/GradingRGBCurveTransform.cpp - transforms/GradingToneTransform.cpp - transforms/GroupTransform.cpp - transforms/LogAffineTransform.cpp - transforms/LogCameraTransform.cpp - transforms/LogTransform.cpp - transforms/LookTransform.cpp - transforms/Lut1DTransform.cpp - transforms/Lut3DTransform.cpp - transforms/MatrixTransform.cpp - transforms/RangeTransform.cpp - ViewingRules.cpp - ViewTransform.cpp - SystemMonitor.cpp + apphelpers/CategoryHelpers.cpp + apphelpers/ColorSpaceHelpers.cpp + apphelpers/DisplayViewHelpers.cpp + apphelpers/LegacyViewingPipeline.cpp + apphelpers/MixingHelpers.cpp + Baker.cpp + BitDepthUtils.cpp + Caching.cpp + ColorSpace.cpp + ColorSpaceSet.cpp + Config.cpp + Context.cpp + ContextVariableUtils.cpp + CPUProcessor.cpp + Display.cpp + DynamicProperty.cpp + Exception.cpp + fileformats/cdl/CDLParser.cpp + fileformats/cdl/CDLReaderHelper.cpp + fileformats/cdl/CDLWriter.cpp + fileformats/ctf/CTFReaderHelper.cpp + fileformats/ctf/CTFReaderUtils.cpp + fileformats/ctf/CTFTransform.cpp + fileformats/ctf/IndexMapping.cpp + fileformats/FileFormat3DL.cpp + fileformats/FileFormatCCC.cpp + fileformats/FileFormatCC.cpp + fileformats/FileFormatCDL.cpp + fileformats/FileFormatCSP.cpp + fileformats/FileFormatCTF.cpp + fileformats/FileFormatDiscreet1DL.cpp + fileformats/FileFormatHDL.cpp + fileformats/FileFormatICC.cpp + fileformats/FileFormatIridasCube.cpp + fileformats/FileFormatIridasItx.cpp + fileformats/FileFormatIridasLook.cpp + fileformats/FileFormatPandora.cpp + fileformats/FileFormatResolveCube.cpp + fileformats/FileFormatSpi1D.cpp + fileformats/FileFormatSpi3D.cpp + fileformats/FileFormatSpiMtx.cpp + fileformats/FileFormatTruelight.cpp + fileformats/FileFormatUtils.cpp + fileformats/FileFormatVF.cpp + fileformats/FormatMetadata.cpp + fileformats/xmlutils/XMLReaderHelper.cpp + fileformats/xmlutils/XMLReaderUtils.cpp + fileformats/xmlutils/XMLWriterUtils.cpp + FileRules.cpp + GPUProcessor.cpp + GpuShader.cpp + GpuShaderDesc.cpp + GpuShaderUtils.cpp + HashUtils.cpp + ImageDesc.cpp + ImagePacking.cpp + Logging.cpp + Look.cpp + LookParse.cpp + MathUtils.cpp + md5/md5.cpp + NamedTransform.cpp + OCIOYaml.cpp + Op.cpp + OpOptimizers.cpp + ops/allocation/AllocationOp.cpp + ops/cdl/CDLOpCPU.cpp + ops/cdl/CDLOpData.cpp + ops/cdl/CDLOpGPU.cpp + ops/cdl/CDLOp.cpp + ops/exponent/ExponentOp.cpp + ops/exposurecontrast/ExposureContrastOpCPU.cpp + ops/exposurecontrast/ExposureContrastOpData.cpp + ops/exposurecontrast/ExposureContrastOpGPU.cpp + ops/exposurecontrast/ExposureContrastOp.cpp + ops/fixedfunction/FixedFunctionOpCPU.cpp + ops/fixedfunction/FixedFunctionOpData.cpp + ops/fixedfunction/FixedFunctionOpGPU.cpp + ops/fixedfunction/FixedFunctionOp.cpp + ops/gamma/GammaOpCPU.cpp + ops/gamma/GammaOpData.cpp + ops/gamma/GammaOpGPU.cpp + ops/gamma/GammaOpUtils.cpp + ops/gamma/GammaOp.cpp + ops/gradingprimary/GradingPrimary.cpp + ops/gradingprimary/GradingPrimaryOpCPU.cpp + ops/gradingprimary/GradingPrimaryOpData.cpp + ops/gradingprimary/GradingPrimaryOpGPU.cpp + ops/gradingprimary/GradingPrimaryOp.cpp + ops/gradingrgbcurve/GradingBSplineCurve.cpp + ops/gradingrgbcurve/GradingRGBCurveOpCPU.cpp + ops/gradingrgbcurve/GradingRGBCurveOpData.cpp + ops/gradingrgbcurve/GradingRGBCurveOpGPU.cpp + ops/gradingrgbcurve/GradingRGBCurveOp.cpp + ops/gradingrgbcurve/GradingRGBCurve.cpp + ops/gradingtone/GradingTone.cpp + ops/gradingtone/GradingToneOpCPU.cpp + ops/gradingtone/GradingToneOpData.cpp + ops/gradingtone/GradingToneOpGPU.cpp + ops/gradingtone/GradingToneOp.cpp + ops/log/LogOpCPU.cpp + ops/log/LogOpData.cpp + ops/log/LogOpGPU.cpp + ops/log/LogOp.cpp + ops/log/LogUtils.cpp + ops/lut1d/Lut1DOp.cpp + ops/lut1d/Lut1DOpCPU.cpp + ops/lut1d/Lut1DOpData.cpp + ops/lut1d/Lut1DOpGPU.cpp + ops/lut3d/Lut3DOp.cpp + ops/lut3d/Lut3DOpCPU.cpp + ops/lut3d/Lut3DOpData.cpp + ops/lut3d/Lut3DOpGPU.cpp + ops/matrix/MatrixOpCPU.cpp + ops/matrix/MatrixOpData.cpp + ops/matrix/MatrixOpGPU.cpp + ops/matrix/MatrixOp.cpp + ops/noop/NoOps.cpp + ops/OpTools.cpp + ops/range/RangeOpCPU.cpp + ops/range/RangeOpData.cpp + ops/range/RangeOpGPU.cpp + ops/range/RangeOp.cpp + ops/reference/ReferenceOpData.cpp + ParseUtils.cpp + PathUtils.cpp + Platform.cpp + Processor.cpp + ScanlineHelper.cpp + Transform.cpp + transforms/AllocationTransform.cpp + transforms/builtins/ACES.cpp + transforms/builtins/BuiltinTransformRegistry.cpp + transforms/builtins/ColorMatrixHelpers.cpp + transforms/builtins/OpHelpers.cpp + transforms/builtins/ArriCameras.cpp + transforms/builtins/CanonCameras.cpp + transforms/builtins/Displays.cpp + transforms/builtins/PanasonicCameras.cpp + transforms/builtins/RedCameras.cpp + transforms/builtins/SonyCameras.cpp + transforms/BuiltinTransform.cpp + transforms/CDLTransform.cpp + transforms/ColorSpaceTransform.cpp + transforms/DisplayViewTransform.cpp + transforms/ExponentTransform.cpp + transforms/ExponentWithLinearTransform.cpp + transforms/ExposureContrastTransform.cpp + transforms/FileTransform.cpp + transforms/FixedFunctionTransform.cpp + transforms/GradingPrimaryTransform.cpp + transforms/GradingRGBCurveTransform.cpp + transforms/GradingToneTransform.cpp + transforms/GroupTransform.cpp + transforms/LogAffineTransform.cpp + transforms/LogCameraTransform.cpp + transforms/LogTransform.cpp + transforms/LookTransform.cpp + transforms/Lut1DTransform.cpp + transforms/Lut3DTransform.cpp + transforms/MatrixTransform.cpp + transforms/RangeTransform.cpp + ViewingRules.cpp + ViewTransform.cpp + SystemMonitor.cpp ) if(NOT WIN32) @@ -203,57 +203,74 @@ if(BUILD_SHARED_LIBS AND WIN32) set(SOURCES ${SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/version.rc) endif() + +set(HEADER_LOCATION "${CMAKE_SOURCE_DIR}/include/OpenColorIO") +file(GLOB_RECURSE INSTALL_HEADERS "${HEADER_LOCATION}/*.h") + +# Some part of the build process expect to find the ABI header here, +# notably the documentation. +set(ABI_HEADER_LOCATION "${CMAKE_BINARY_DIR}/include/OpenColorIO") +list(APPEND INSTALL_HEADERS ${ABI_HEADER_LOCATION}/OpenColorABI.h) +configure_file("${HEADER_LOCATION}/OpenColorABI.h.in" "${ABI_HEADER_LOCATION}/OpenColorABI.h" @ONLY) + +set(BUILD_INCLUDES + ${HEADER_LOCATION}/.. + ${HEADER_LOCATION} + ${CMAKE_CURRENT_SOURCE_DIR} + ${ABI_HEADER_LOCATION} +) + target_include_directories(OpenColorIO - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PUBLIC + "$" + "$" ) target_link_libraries(OpenColorIO - PUBLIC - OpenColorIOHeaders - PRIVATE - expat::expat - ${OCIO_HALF_LIB} - pystring::pystring - sampleicc::sampleicc - utils::strings - yaml-cpp + PRIVATE + expat::expat + ${OCIO_HALF_LIB} + pystring::pystring + sampleicc::sampleicc + utils::strings + yaml-cpp ) if(APPLE) - target_link_libraries(OpenColorIO - PRIVATE - "-framework Carbon" - "-framework IOKit" - ) + target_link_libraries(OpenColorIO + PRIVATE + "-framework Carbon" + "-framework IOKit" + ) endif() if(NOT BUILD_SHARED_LIBS) - target_compile_definitions(OpenColorIO - PRIVATE - OpenColorIO_SKIP_IMPORTS - ) + target_compile_definitions(OpenColorIO + PRIVATE + OpenColorIO_SKIP_IMPORTS + ) else() - # Only exports selected symbols. - target_compile_definitions(OpenColorIO - PRIVATE - OpenColorIO_EXPORTS - ) + # Only exports selected symbols. + target_compile_definitions(OpenColorIO + PRIVATE + OpenColorIO_EXPORTS + ) endif() if(BUILD_SHARED_LIBS OR (OCIO_BUILD_PYTHON AND UNIX)) - # The Python bindings is a 'module' which is a dynamic library on Linux - # (i.e. '-fPIC' needed), but a static library on Windows. + # The Python bindings is a 'module' which is a dynamic library on Linux + # (i.e. '-fPIC' needed), but a static library on Windows. - # If supported for the target machine, emit position-independent code - # suitable for dynamic linking. - set_property(TARGET OpenColorIO PROPERTY POSITION_INDEPENDENT_CODE ON) + # If supported for the target machine, emit position-independent code + # suitable for dynamic linking. + set_property(TARGET OpenColorIO PROPERTY POSITION_INDEPENDENT_CODE ON) endif() if(OCIO_USE_SSE) - target_compile_definitions(OpenColorIO - PRIVATE - USE_SSE - ) + target_compile_definitions(OpenColorIO + PRIVATE + USE_SSE + ) endif() if(MSVC AND BUILD_TYPE_DEBUG AND BUILD_SHARED_LIBS) @@ -276,6 +293,7 @@ set_target_properties(OpenColorIO PROPERTIES COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS}" VERSION ${OpenColorIO_VERSION} SOVERSION ${SOVERSION} + PUBLIC_HEADER "${INSTALL_HEADERS}" ) if (UNIX AND NOT APPLE) @@ -287,13 +305,14 @@ if (UNIX AND NOT APPLE) endif () if(MSVC AND BUILD_SHARED_LIBS) - # Install the pdb file if any. - install(FILES $ DESTINATION bin OPTIONAL) + # Install the pdb file if any. + install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) endif() install(TARGETS OpenColorIO - EXPORT ${PROJECT_NAME}_EXPORTED_TARGETS - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin - ARCHIVE DESTINATION lib + EXPORT ${PROJECT_NAME}_EXPORTED_TARGETS + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/OpenColorIO ) diff --git a/src/apps/ociobakelut/CMakeLists.txt b/src/apps/ociobakelut/CMakeLists.txt index 7eb1cd8a1..b5a57e0a9 100755 --- a/src/apps/ociobakelut/CMakeLists.txt +++ b/src/apps/ociobakelut/CMakeLists.txt @@ -40,5 +40,5 @@ target_link_libraries(ociobakelut ) install(TARGETS ociobakelut - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) diff --git a/src/apps/ociocheck/CMakeLists.txt b/src/apps/ociocheck/CMakeLists.txt index c232dc83b..d3700699d 100755 --- a/src/apps/ociocheck/CMakeLists.txt +++ b/src/apps/ociocheck/CMakeLists.txt @@ -28,5 +28,5 @@ target_link_libraries(ociocheck ) install(TARGETS ociocheck - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) diff --git a/src/apps/ociochecklut/CMakeLists.txt b/src/apps/ociochecklut/CMakeLists.txt index ce285dcf9..52514c0cc 100644 --- a/src/apps/ociochecklut/CMakeLists.txt +++ b/src/apps/ociochecklut/CMakeLists.txt @@ -36,5 +36,5 @@ target_link_libraries(ociochecklut ) install(TARGETS ociochecklut - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) diff --git a/src/apps/ocioconvert/CMakeLists.txt b/src/apps/ocioconvert/CMakeLists.txt index d2d50f4cc..2269286af 100755 --- a/src/apps/ocioconvert/CMakeLists.txt +++ b/src/apps/ocioconvert/CMakeLists.txt @@ -34,5 +34,5 @@ target_link_libraries(ocioconvert ) install(TARGETS ocioconvert - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) diff --git a/src/apps/ociodisplay/CMakeLists.txt b/src/apps/ociodisplay/CMakeLists.txt index 70ec5947d..f3ffb1f8d 100755 --- a/src/apps/ociodisplay/CMakeLists.txt +++ b/src/apps/ociodisplay/CMakeLists.txt @@ -45,5 +45,5 @@ target_link_libraries(ociodisplay OpenImageIO::OpenImageIO ) install(TARGETS ociodisplay - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) diff --git a/src/apps/ociolutimage/CMakeLists.txt b/src/apps/ociolutimage/CMakeLists.txt index ef24e6bba..c21a632fe 100755 --- a/src/apps/ociolutimage/CMakeLists.txt +++ b/src/apps/ociolutimage/CMakeLists.txt @@ -26,5 +26,5 @@ target_link_libraries(ociolutimage ) install(TARGETS ociolutimage - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) diff --git a/src/apps/ociomakeclf/CMakeLists.txt b/src/apps/ociomakeclf/CMakeLists.txt index ff103b7e6..752b26345 100644 --- a/src/apps/ociomakeclf/CMakeLists.txt +++ b/src/apps/ociomakeclf/CMakeLists.txt @@ -29,5 +29,5 @@ target_link_libraries(ociomakeclf ) install(TARGETS ociomakeclf - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) diff --git a/src/apps/ocioperf/CMakeLists.txt b/src/apps/ocioperf/CMakeLists.txt index 755525b0e..2772debc7 100644 --- a/src/apps/ocioperf/CMakeLists.txt +++ b/src/apps/ocioperf/CMakeLists.txt @@ -27,6 +27,5 @@ target_link_libraries(ocioperf ) install(TARGETS ocioperf - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) - diff --git a/src/apps/ociowrite/CMakeLists.txt b/src/apps/ociowrite/CMakeLists.txt index 9b7b93c9e..786ce57be 100644 --- a/src/apps/ociowrite/CMakeLists.txt +++ b/src/apps/ociowrite/CMakeLists.txt @@ -24,6 +24,5 @@ target_link_libraries(ociowrite ) install(TARGETS ociowrite - RUNTIME DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) - diff --git a/src/bindings/java/CMakeLists.txt b/src/bindings/java/CMakeLists.txt index 1db309e38..0abbfa9d4 100644 --- a/src/bindings/java/CMakeLists.txt +++ b/src/bindings/java/CMakeLists.txt @@ -155,7 +155,7 @@ set_target_properties(OpenColorIO-JNI # Installation install(TARGETS OpenColorIO-JNI - DESTINATION ${CMAKE_INSTALL_EXEC_PREFIX}/lib${LIB_SUFFIX} + DESTINATION ${CMAKE_INSTALL_EXEC_PREFIX}/${CMAKE_INSTALL_LIBDIR} ) install(FILES ${JNIOCIO_JAR} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/ocio/ diff --git a/src/bindings/python/CMakeLists.txt b/src/bindings/python/CMakeLists.txt index 63bbe028d..a20b75c56 100644 --- a/src/bindings/python/CMakeLists.txt +++ b/src/bindings/python/CMakeLists.txt @@ -203,14 +203,10 @@ target_include_directories(PyOpenColorIO # macOS, to prevent segfaults when potentially working with multiple Python # installations. See note in: # https://pybind11.readthedocs.io/en/stable/compiling.html#building-manually -set(PYOCIO_LINK_PUBLIC OpenColorIOHeaders) -if(WIN32) - list(INSERT PYOCIO_LINK_PUBLIC 0 ${Python_LIBRARIES}) -endif() target_link_libraries(PyOpenColorIO PUBLIC - ${PYOCIO_LINK_PUBLIC} + "$<$:${Python_LIBRARIES}>" PRIVATE OpenColorIO utils::strings @@ -226,9 +222,9 @@ target_compile_definitions(PyOpenColorIO ) if(WIN32) - set(_Python_VARIANT_PATH "lib${LIB_SUFFIX}/site-packages") + set(_Python_VARIANT_PATH "${CMAKE_INSTALL_LIBDIR}/site-packages") else() - set(_Python_VARIANT_PATH "lib${LIB_SUFFIX}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages") + set(_Python_VARIANT_PATH "${CMAKE_INSTALL_LIBDIR}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages") endif() # Create an internal global variable to access it in another scope but not publicly visible diff --git a/src/libutils/oglapphelpers/CMakeLists.txt b/src/libutils/oglapphelpers/CMakeLists.txt index 7b33d0f3b..1e160c1c4 100644 --- a/src/libutils/oglapphelpers/CMakeLists.txt +++ b/src/libutils/oglapphelpers/CMakeLists.txt @@ -90,10 +90,10 @@ if(${OCIO_EGL_HEADLESS}) endif() install(TARGETS oglapphelpers - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) install(FILES ${INCLUDES} - DESTINATION include/OpenColorIO/oglapphelpers + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/OpenColorIO/oglapphelpers ) diff --git a/src/libutils/oiiohelpers/CMakeLists.txt b/src/libutils/oiiohelpers/CMakeLists.txt index 5ed6c7366..6f0661c21 100644 --- a/src/libutils/oiiohelpers/CMakeLists.txt +++ b/src/libutils/oiiohelpers/CMakeLists.txt @@ -35,10 +35,10 @@ target_link_libraries(oiiohelpers ) install(TARGETS oiiohelpers - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/oiiohelpers.h - DESTINATION include/OpenColorIO/oiiohelpers + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/OpenColorIO/oiiohelpers ) diff --git a/tests/cpu/CMakeLists.txt b/tests/cpu/CMakeLists.txt index 4efeaac6f..3b3310437 100755 --- a/tests/cpu/CMakeLists.txt +++ b/tests/cpu/CMakeLists.txt @@ -11,12 +11,10 @@ function(add_ocio_test NAME SOURCES PRIVATE_INCLUDES) target_compile_definitions(${TEST_BINARY} PRIVATE OpenColorIO_SKIP_IMPORTS - ) target_link_libraries(${TEST_BINARY} - PUBLIC - OpenColorIOHeaders PRIVATE + OpenColorIO expat::expat ${OCIO_HALF_LIB} pystring::pystring @@ -39,7 +37,6 @@ function(add_ocio_test NAME SOURCES PRIVATE_INCLUDES) if(PRIVATE_INCLUDES) target_include_directories(${TEST_BINARY} PRIVATE - "${CMAKE_SOURCE_DIR}/src/OpenColorIO" "${CMAKE_SOURCE_DIR}/tests/cpu" ) endif(PRIVATE_INCLUDES)