cmake_minimum_required(VERSION 3.5) project(vfxpreopenexr-c VERSION 0.0.1) set(CMAKE_CXX_STANDARD 14 CACHE STRING "") set(SOURCES std_vector.cpp imf_huf.cpp imf_keycode.cpp imf_imagelevel.cpp imf_tiledescription.cpp imf_rational.cpp imf_rgba.cpp imf_framebuffer.cpp imf_deepscanlineoutputfile.cpp imf_flatimageio.cpp imf_wav.cpp imf_deepscanlineinputpart.cpp imf_deeptiledinputfile.cpp imf_framespersecond.cpp imf_io.cpp imf_outputpart.cpp imf_lut.cpp imf_envmap.cpp imath_matrix.cpp imf_tiledinputfile.cpp imf_array.cpp std_set.cpp imf_compression.cpp imf_deeptiledoutputfile.cpp imf_inputpart.cpp c-half.cpp imf_inputfile.cpp imf_deepscanlineinputfile.cpp imf_attribute.cpp imf_deepimage.cpp imf_tiledrgbafile.cpp imf_deepframebuffer.cpp imf_convert.cpp imf_timecode.cpp imf_deepscanlineoutputpart.cpp imf_tiledoutputfile.cpp imf_deeptiledinputpart.cpp imf_deepimagelevel.cpp imf_tiledinputpart.cpp imf_multipartinputfile.cpp imf_testfile.cpp imf_header.cpp imf_compositedeepscanline.cpp imf_deepimagestate.cpp imf_rgbayca.cpp imf_threading.cpp imf_deepimageio.cpp imf_parthelper.cpp imf_imagedatawindow.cpp std_map.cpp imf_lineorder.cpp imf_flatimage.cpp imf_previewimage.cpp imath_vec.cpp imf_deepimagechannel.cpp imf_channellist.cpp imf_deeptiledoutputpart.cpp imf_flatimagechannel.cpp imf_imagechannel.cpp imf_version.cpp imf_parttype.cpp imath_box.cpp imf_imageio.cpp imf_deepcompositing.cpp imf_rgbafile.cpp imf_aces_file.cpp imf_tiledoutputpart.cpp imf_samplecountchannel.cpp std_string.cpp imf_outputfile.cpp imf_multiview.cpp imf_pixeltype.cpp imf_image.cpp imf_name.cpp imf_multipartoutputfile.cpp imf_chromaticities.cpp imf_flatimagelevel.cpp vfxpreopenexr-errors.cpp ) set(LIBNAME vfxpreopenexr-c-0_0) add_library(${LIBNAME} STATIC ${SOURCES}) add_library(${LIBNAME}-shared SHARED ${SOURCES}) target_include_directories(${LIBNAME} PRIVATE .) target_include_directories(${LIBNAME}-shared PRIVATE .) target_include_directories(${LIBNAME} PRIVATE /home/anders/packages/imath/3.0.1/include) target_include_directories(${LIBNAME}-shared PRIVATE /home/anders/packages/imath/3.0.1/include) target_include_directories(${LIBNAME} PRIVATE /home/anders/packages/imath/3.0.1/include/Imath) target_include_directories(${LIBNAME}-shared PRIVATE /home/anders/packages/imath/3.0.1/include/Imath) target_include_directories(${LIBNAME} PRIVATE /home/anders/packages/openexr/3.0.1/include) target_include_directories(${LIBNAME}-shared PRIVATE /home/anders/packages/openexr/3.0.1/include) target_include_directories(${LIBNAME} PRIVATE /home/anders/packages/openexr/3.0.1/include/OpenEXR) target_include_directories(${LIBNAME}-shared PRIVATE /home/anders/packages/openexr/3.0.1/include/OpenEXR) find_package(OpenEXR REQUIRED) find_package(Imath REQUIRED) target_link_libraries(${LIBNAME} OpenEXR::OpenEXR) target_link_libraries(${LIBNAME}-shared OpenEXR::OpenEXR) target_link_libraries(${LIBNAME} OpenEXR::OpenEXRUtil) target_link_libraries(${LIBNAME}-shared OpenEXR::OpenEXRUtil) install(TARGETS ${LIBNAME} DESTINATION ${CMAKE_INSTALL_PREFIX})