diff --git a/.github/workflows/docker_linuxes.yml b/.github/workflows/docker_linuxes.yml index 3dd55501..3ed69bc5 100644 --- a/.github/workflows/docker_linuxes.yml +++ b/.github/workflows/docker_linuxes.yml @@ -203,3 +203,13 @@ jobs: - name: Run unit tests (ctest) within the Docker image run: docker run ctl:latest sh -c "cd ./build && ctest" + + ubuntu-openexr2-shared: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build the Docker image + run: docker build --no-cache --rm -f ./docker/Dockerfile_ubuntu_22.04_openexr2_shared -t ctl:latest . + + - name: Run unit tests (ctest) within the Docker image + run: docker run ctl:latest sh -c "cd ./build && ctest" diff --git a/.github/workflows/mac_release_shared.yml b/.github/workflows/mac_release_shared.yml new file mode 100644 index 00000000..57bdb20c --- /dev/null +++ b/.github/workflows/mac_release_shared.yml @@ -0,0 +1,184 @@ +name: macOS-Release-shared + +on: + push: + paths-ignore: + - 'README.md' + - 'doc/**' + pull_request: + paths-ignore: + - 'README.md' + - 'doc/**' + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + + build-openexr2: + + runs-on: macos-latest + + steps: + + # - name: uninstall openexr + # run: brew uninstall --ignore-dependencies openexr + + # - name: uninstall imath + # run: brew uninstall --ignore-dependencies imath + + - name: install dependencies - openexr v2.5 + run: | + cd .. + git clone https://github.com/AcademySoftwareFoundation/openexr.git && + cd openexr && + git checkout RB-2.5 && + mkdir build && + cd build && + cmake -DBUILD_SHARED_LIBS=ON .. && + make && + sudo make install + + - uses: actions/checkout@v4 + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_SHARED_LIBS=ON + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + build-openexr3: + runs-on: macos-latest + + steps: + + - name: install dependencies - imath + run: | + cd .. + git clone https://github.com/AcademySoftwareFoundation/Imath.git && + cd Imath && + mkdir build && + cd build && + cmake -DBUILD_SHARED_LIBS=ON .. && + make && + sudo make install + + - name: install dependencies - openexr v3.1 + run: | + cd .. + git clone https://github.com/AcademySoftwareFoundation/openexr.git && + cd openexr && + git checkout RB-3.1 && + mkdir build && + cd build && + cmake -DBUILD_SHARED_LIBS=ON .. && + make && + sudo make install + + - uses: actions/checkout@v4 + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_SHARED_LIBS=ON + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + test-openexr2: + + runs-on: macos-latest + + steps: + + # - name: uninstall openexr + # run: brew uninstall --ignore-dependencies openexr + + # - name: uninstall imath + # run: brew uninstall --ignore-dependencies imath + + - name: install dependencies - openexr v2.5 + run: | + cd .. + git clone https://github.com/AcademySoftwareFoundation/openexr.git && + cd openexr && + git checkout RB-2.5 && + mkdir build && + cd build && + cmake -DBUILD_SHARED_LIBS=ON .. && + make && + sudo make install + + - uses: actions/checkout@v4 + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_SHARED_LIBS=ON + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Install + run: sudo cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -V --output-on-failure + + test-openexr3: + runs-on: macos-latest + + steps: + + - name: install dependencies - imath + run: | + cd .. + git clone https://github.com/AcademySoftwareFoundation/Imath.git && + cd Imath && + mkdir build && + cd build && + cmake -DBUILD_SHARED_LIBS=ON .. && + make && + sudo make install + + - name: install dependencies - openexr v3.1 + run: | + cd .. + git clone https://github.com/AcademySoftwareFoundation/openexr.git && + cd openexr && + git checkout RB-3.1 && + mkdir build && + cd build && + cmake -DBUILD_SHARED_LIBS=ON .. && + make && + sudo make install + + - uses: actions/checkout@v4 + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_SHARED_LIBS=ON + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Install + run: sudo cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -V --output-on-failure + diff --git a/ctlrender/CMakeLists.txt b/ctlrender/CMakeLists.txt index f1878a51..fc433dbc 100644 --- a/ctlrender/CMakeLists.txt +++ b/ctlrender/CMakeLists.txt @@ -21,9 +21,15 @@ target_link_libraries(ctlrender IlmCtl ctldpx # For OpenEXR/Imath 3.x: - $<$:OpenEXR::OpenEXR> - # For OpenEXR 2.4/2.5: - $<$:OpenEXR::IlmImf> + $<$:OpenEXR::OpenEXR> + $<$:Imath::Imath> + $<$:Imath::Half> + # For OpenEXR 2.4/2.5: + $<$:OpenEXR::IlmImf> + $<$:IlmBase::Imath> + $<$:IlmBase::Half> + $<$:IlmBase::IlmThread> + $<$:IlmBase::Iex> ) if( OpenEXR_FOUND ) diff --git a/docker/Dockerfile_ubuntu_22.04_openexr2_shared b/docker/Dockerfile_ubuntu_22.04_openexr2_shared new file mode 100644 index 00000000..f053fd8e --- /dev/null +++ b/docker/Dockerfile_ubuntu_22.04_openexr2_shared @@ -0,0 +1,44 @@ +FROM ubuntu:22.04 + +RUN apt-get update + +# disable interactive install +ENV DEBIAN_FRONTEND noninteractive + +# install developement tools +RUN apt-get -y install cmake +RUN apt-get -y install g++ +RUN apt-get -y install git + +# install CTL dependencies +#RUN apt-get -y install libopenexr-dev +#RUN apt-get -y install libtiff-dev + +# install CTL dependencies - zlib +RUN apt-get -y install zlib1g-dev + +# install CTL dependecies - openexr +WORKDIR /usr/src/ +RUN git clone https://github.com/AcademySoftwareFoundation/openexr.git +WORKDIR /usr/src/openexr +RUN git checkout RB-2.5 +WORKDIR /usr/src/openexr/build +RUN cmake .. -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DOPENEXR_BUILD_TOOLS=OFF -DOPENEXR_INSTALL_EXAMPLES=OFF +RUN make +RUN make install + +# build CTL +WORKDIR /usr/src/CTL +COPY . . +WORKDIR /usr/src/CTL/build +RUN rm -R * || true +RUN cmake -DBUILD_SHARED_LIBS=ON .. +RUN make +RUN make install + +# add /usr/local/lib to the LD_LIBRARY_PATH +ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib + +# finalize docker environment +WORKDIR /usr/src/CTL + diff --git a/lib/IlmCtl/CMakeLists.txt b/lib/IlmCtl/CMakeLists.txt index f99062b5..5c0ad9c5 100644 --- a/lib/IlmCtl/CMakeLists.txt +++ b/lib/IlmCtl/CMakeLists.txt @@ -26,22 +26,19 @@ target_include_directories(IlmCtl ${CMAKE_CURRENT_SOURCE_DIR} ) -if( IlmBase_FOUND ) - target_link_libraries (IlmCtl +target_link_libraries (IlmCtl PRIVATE + # For OpenEXR/Imath 3.x: + $<$:OpenEXR::OpenEXR> + $<$:Imath::Imath> + $<$:Imath::Half> # For OpenEXR 2.4/2.5: + $<$:OpenEXR::IlmImf> + $<$:IlmBase::Imath> $<$:IlmBase::Half> $<$:IlmBase::IlmThread> $<$:IlmBase::Iex> ) -else() - target_link_libraries (IlmCtl - PRIVATE - # For OpenEXR/Imath 3.x: - $<$:OpenEXR::OpenEXR> - $<$:Imath::Half> - ) -endif() set_target_properties(IlmCtl PROPERTIES diff --git a/lib/IlmCtlMath/CMakeLists.txt b/lib/IlmCtlMath/CMakeLists.txt index 925d5a75..08fdf00a 100644 --- a/lib/IlmCtlMath/CMakeLists.txt +++ b/lib/IlmCtlMath/CMakeLists.txt @@ -11,25 +11,21 @@ target_include_directories(IlmCtlMath ${CMAKE_CURRENT_SOURCE_DIR} ) -if(IlmBase_FOUND) - target_link_libraries(IlmCtlMath +target_link_libraries (IlmCtlMath PUBLIC IlmCtl - PUBLIC - # For OpenEXR 2.4/2.5: - $<$:OpenEXR::IlmImf> - $<$:IlmBase::Imath> - ) -else() - target_link_libraries(IlmCtlMath - PUBLIC - IlmCtl - PUBLIC - # For OpenEXR/Imath 3.x: - $<$:OpenEXR::OpenEXR> - $<$:Imath::Imath> - ) -endif() + PRIVATE + # For OpenEXR/Imath 3.x: + $<$:OpenEXR::OpenEXR> + $<$:Imath::Imath> + $<$:Imath::Half> + # For OpenEXR 2.4/2.5: + $<$:OpenEXR::IlmImf> + $<$:IlmBase::Imath> + $<$:IlmBase::Half> + $<$:IlmBase::IlmThread> + $<$:IlmBase::Iex> + ) set_target_properties(IlmCtlMath PROPERTIES diff --git a/lib/IlmCtlSimd/CMakeLists.txt b/lib/IlmCtlSimd/CMakeLists.txt index c62e362f..d9dc6ece 100644 --- a/lib/IlmCtlSimd/CMakeLists.txt +++ b/lib/IlmCtlSimd/CMakeLists.txt @@ -73,6 +73,17 @@ target_link_libraries(IlmCtlSimd PUBLIC IlmCtlMath IlmCtl + PRIVATE + # For OpenEXR/Imath 3.x: + $<$:OpenEXR::OpenEXR> + $<$:Imath::Imath> + $<$:Imath::Half> + # For OpenEXR 2.4/2.5: + $<$:OpenEXR::IlmImf> + $<$:IlmBase::Imath> + $<$:IlmBase::Half> + $<$:IlmBase::IlmThread> + $<$:IlmBase::Iex> ) set_target_properties(IlmCtlSimd diff --git a/lib/IlmImfCtl/CMakeLists.txt b/lib/IlmImfCtl/CMakeLists.txt index 5f75bb19..a0cd5356 100644 --- a/lib/IlmImfCtl/CMakeLists.txt +++ b/lib/IlmImfCtl/CMakeLists.txt @@ -22,17 +22,17 @@ target_include_directories(IlmImfCtl target_link_libraries (IlmImfCtl PUBLIC IlmCtl - PUBLIC - # For OpenEXR/Imath 3.x: - $<$:OpenEXR::OpenEXR> -# $<$:Imath::Imath> - $<$:Imath::Half> - # For OpenEXR 2.4/2.5: - $<$:OpenEXR::IlmImf> - # $<$:IlmBase::Imath> - $<$:IlmBase::Half> - $<$:IlmBase::IlmThread> - $<$:IlmBase::Iex> + PRIVATE + # For OpenEXR/Imath 3.x: + $<$:OpenEXR::OpenEXR> + $<$:Imath::Imath> + $<$:Imath::Half> + # For OpenEXR 2.4/2.5: + $<$:OpenEXR::IlmImf> + $<$:IlmBase::Imath> + $<$:IlmBase::Half> + $<$:IlmBase::IlmThread> + $<$:IlmBase::Iex> ) set_target_properties(IlmImfCtl diff --git a/unittest/IlmCtl/CMakeLists.txt b/unittest/IlmCtl/CMakeLists.txt index a215cfe8..dc9e7a7a 100644 --- a/unittest/IlmCtl/CMakeLists.txt +++ b/unittest/IlmCtl/CMakeLists.txt @@ -20,6 +20,17 @@ target_link_libraries(IlmCtlTest PRIVATE IlmCtlSimd IlmCtl + PRIVATE + # For OpenEXR/Imath 3.x: + $<$:OpenEXR::OpenEXR> + $<$:Imath::Imath> + $<$:Imath::Half> + # For OpenEXR 2.4/2.5: + $<$:OpenEXR::IlmImf> + $<$:IlmBase::Imath> + $<$:IlmBase::Half> + $<$:IlmBase::IlmThread> + $<$:IlmBase::Iex> ) add_test(IlmCtl IlmCtlTest) diff --git a/unittest/IlmCtlMath/CMakeLists.txt b/unittest/IlmCtlMath/CMakeLists.txt index d050ac2f..0779ff6c 100644 --- a/unittest/IlmCtlMath/CMakeLists.txt +++ b/unittest/IlmCtlMath/CMakeLists.txt @@ -15,6 +15,17 @@ target_link_libraries(IlmCtlMathTest PRIVATE IlmCtlMath IlmCtl + PRIVATE + # For OpenEXR/Imath 3.x: + $<$:OpenEXR::OpenEXR> + $<$:Imath::Imath> + $<$:Imath::Half> + # For OpenEXR 2.4/2.5: + $<$:OpenEXR::IlmImf> + $<$:IlmBase::Imath> + $<$:IlmBase::Half> + $<$:IlmBase::IlmThread> + $<$:IlmBase::Iex> ) add_test(IlmCtlMath IlmCtlMathTest) diff --git a/unittest/IlmImfCtl/CMakeLists.txt b/unittest/IlmImfCtl/CMakeLists.txt index 30b1e53d..b9b33b77 100644 --- a/unittest/IlmImfCtl/CMakeLists.txt +++ b/unittest/IlmImfCtl/CMakeLists.txt @@ -17,6 +17,17 @@ target_link_libraries( IlmImfCtlTest IlmCtlSimd IlmCtlMath IlmCtl + PRIVATE + # For OpenEXR/Imath 3.x: + $<$:OpenEXR::OpenEXR> + $<$:Imath::Imath> + $<$:Imath::Half> + # For OpenEXR 2.4/2.5: + $<$:OpenEXR::IlmImf> + $<$:IlmBase::Imath> + $<$:IlmBase::Half> + $<$:IlmBase::IlmThread> + $<$:IlmBase::Iex> ) add_test( IlmImfCtl IlmImfCtlTest )