[ilmbase] initial commit

This commit is contained in:
codicodi 2017-06-10 16:54:03 +02:00
parent 44a995d446
commit 1a30b7a8a1
3 changed files with 106 additions and 0 deletions

3
ports/ilmbase/CONTROL Normal file
View File

@ -0,0 +1,3 @@
Source: ilmbase
Version: 2.2.0
Description: Base libraries from ILM for OpenEXR

View File

@ -0,0 +1,54 @@
diff --git a/Half/CMakeLists.txt b/Half/CMakeLists.txt
index 6f9714d..0c43904 100644
--- a/Half/CMakeLists.txt
+++ b/Half/CMakeLists.txt
@@ -2,10 +2,10 @@
ADD_EXECUTABLE ( eLut eLut.cpp )
-ADD_CUSTOM_COMMAND (
- TARGET eLut POST_BUILD
+ADD_CUSTOM_TARGET ( make_eLut
COMMAND eLut > ${CMAKE_CURRENT_BINARY_DIR}/eLut.h
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS eLut
)
SET_SOURCE_FILES_PROPERTIES(
${CMAKE_CURRENT_BINARY_DIR}/eLut.h
@@ -13,25 +13,16 @@ SET_SOURCE_FILES_PROPERTIES(
)
ADD_EXECUTABLE ( toFloat toFloat.cpp )
-ADD_CUSTOM_COMMAND (
- TARGET toFloat POST_BUILD
+ADD_CUSTOM_TARGET ( make_toFloat
COMMAND toFloat > ${CMAKE_CURRENT_BINARY_DIR}/toFloat.h
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS toFloat
)
SET_SOURCE_FILES_PROPERTIES(
${CMAKE_CURRENT_BINARY_DIR}/toFloat.h
PROPERTIES HEADER_FILE_ONLY TRUE
)
-SET_SOURCE_FILES_PROPERTIES(
- half.cpp
- PROPERTIES
- OBJECT_DEPENDS
- ${CMAKE_CURRENT_BINARY_DIR}/eLut.h
- OBJECT_DEPENDS
- ${CMAKE_CURRENT_BINARY_DIR}/toFloat.h
- )
-
IF(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DHALF_EXPORTS)
ENDIF()
@@ -41,7 +32,7 @@ ADD_LIBRARY ( Half ${LIB_TYPE}
)
-ADD_DEPENDENCIES ( Half toFloat eLut )
+ADD_DEPENDENCIES ( Half make_toFloat make_eLut )
INSTALL ( TARGETS
Half

View File

@ -0,0 +1,49 @@
if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
message(FATAL_ERROR "UWP build not supported")
endif()
set(ILM_VERSION 2.2.0)
set(ILM_HASH 0bbad14ed2bd286dff3987b16ef8631470211da54f822cb3e29b7931807216845ded81c9bf41fd2d22a8b362e8b9904a5450f61f5a242e460083e86b846513f1)
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ilmbase-${ILM_VERSION})
vcpkg_download_distfile(ARCHIVE
URLS "http://download.savannah.nongnu.org/releases/openexr/ilmbase-${ILM_VERSION}.tar.gz"
FILENAME "ilmbase-${ILM_VERSION}.zip"
SHA512 ${ILM_HASH})
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH}
PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix-parallel-build.patch)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA)
vcpkg_install_cmake()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
foreach(SUBDIR "" "/debug")
file(GLOB DLLS ${CURRENT_PACKAGES_DIR}${SUBDIR}/lib/*.dll)
file(COPY ${DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}${SUBDIR}/bin)
file(REMOVE ${DLLS})
endforeach()
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_copy_pdbs()
foreach(HEADER halfExport.h IexExport.h IexMathFloatExc.h IlmThreadExport.h ImathExport.h)
file(READ ${CURRENT_PACKAGES_DIR}/include/OpenEXR/${HEADER} HEADER_FILE)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
string(REPLACE "defined(OPENEXR_DLL)" "1" HEADER_FILE "${HEADER_FILE}")
else()
string(REPLACE "defined(OPENEXR_DLL)" "0" HEADER_FILE "${HEADER_FILE}")
endif()
file(WRITE ${CURRENT_PACKAGES_DIR}/include/OpenEXR/${HEADER} "${HEADER_FILE}")
endforeach()
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/ilmbase)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/ilmbase/LICENSE ${CURRENT_PACKAGES_DIR}/share/ilmbase/copyright)