build_environment: opencolorio 1.1.0
authorRay Molenkamp <github@lazydodo.com>
Wed, 15 Aug 2018 18:32:34 +0000 (12:32 -0600)
committerRay Molenkamp <github@lazydodo.com>
Wed, 15 Aug 2018 18:32:34 +0000 (12:32 -0600)
-Moved from dynamic link to static on windows
-gained lcms/tinyxml/yamlcpp deps, since we need a little more control over the build flags than the build-in options will provide.

build_files/build_environment/CMakeLists.txt
build_files/build_environment/cmake/lcms.cmake [new file with mode: 0644]
build_files/build_environment/cmake/opencolorio.cmake
build_files/build_environment/cmake/tinyxml.cmake [new file with mode: 0644]
build_files/build_environment/cmake/versions.cmake
build_files/build_environment/cmake/yamlcpp.cmake [new file with mode: 0644]
build_files/build_environment/patches/cmakelists_lcms.txt [new file with mode: 0644]
build_files/build_environment/patches/opencolorio_win.diff [new file with mode: 0644]
build_files/build_environment/patches/tinyxml.diff [new file with mode: 0644]

index 8376306caa1f48c0449de61f3f86b0100e294439..e9a4b69cd46e91a579cba69532db46a80093512d 100644 (file)
@@ -96,7 +96,13 @@ if(WITH_WEBP)
        include(cmake/webp.cmake)
 endif()
 if(WIN32)
+       #hmd_branch_deps
        include(cmake/hidapi.cmake)
+       #ocio deps
+       include(cmake/tinyxml.cmake)
+       include(cmake/yamlcpp.cmake)
+       #lcms is an ocio dep, but only if you build the apps, leaving it here for convenience 
+       #include(cmake/lcms.cmake)
 endif()
 
 if(NOT WIN32 OR ENABLE_MINGW64)
diff --git a/build_files/build_environment/cmake/lcms.cmake b/build_files/build_environment/cmake/lcms.cmake
new file mode 100644 (file)
index 0000000..943fab7
--- /dev/null
@@ -0,0 +1,38 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(LCMS_EXTRA_ARGS
+)
+
+ExternalProject_Add(external_lcms
+       URL ${LCMS_URI}
+       DOWNLOAD_DIR ${DOWNLOAD_DIR}
+       URL_HASH MD5=${LCMS_HASH}
+       PREFIX ${BUILD_DIR}/lcms
+       #patch taken from ocio 
+       PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_lcms.txt ${BUILD_DIR}/lcms/src/external_lcms/CMakeLists.txt
+       CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/lcms ${DEFAULT_CMAKE_FLAGS} ${LCMS_EXTRA_ARGS}
+       INSTALL_DIR ${LIBDIR}/lcms
+)
+
+#if(BUILD_MODE STREQUAL Release AND WIN32)
+       #ExternalProject_Add_Step(external_freetype after_install
+       #       COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freetype ${HARVEST_TARGET}/freetype
+       #       DEPENDEES install
+       #)
+#endif()
index d33c03eaa8d115a06ccf56dadd1194eb1fa6dbb6..f3d7c2b4c7be78f03e7fc507f6be4c3607ceba9a 100644 (file)
@@ -22,7 +22,7 @@ set(OPENCOLORIO_EXTRA_ARGS
        -DBoost_USE_STATIC_LIBS=ON
        -DBoost_USE_STATIC_RUNTIME=ON
        -DBOOST_ROOT=${LIBDIR}/boost
-       -DBOOST_INCLUDEDIR=${LIBDIR}/boost/include/boost_1_60/boost
+       -DBOOST_INCLUDEDIR=${LIBDIR}/boost/include/boost_1_68/boost
        -DBoost_NO_SYSTEM_PATHS=ON
        -DBoost_DEBUG=ON
        -DBoost_MAJOR_VERSION=1
@@ -33,13 +33,38 @@ set(OPENCOLORIO_EXTRA_ARGS
 )
 
 if(WIN32)
+       set(OCIO_PATCH opencolorio_win.diff)
        set(OPENCOLORIO_EXTRA_ARGS
                ${OPENCOLORIO_EXTRA_ARGS}
-               -DOCIO_USE_BOOST_PTR=ON
-               -DOCIO_BUILD_STATIC=OFF
-               -DOCIO_BUILD_SHARED=ON
+               -DOCIO_BUILD_SHARED=OFF
+               -DOCIO_BUILD_STATIC=ON
+               -DOCIO_BUILD_TRUELIGHT=OFF
+               -DOCIO_BUILD_APPS=OFF
+               -DOCIO_BUILD_NUKE=OFF
+               -DOCIO_BUILD_DOCS=OFF
+               -DOCIO_BUILD_TESTS=OFF
+               -DOCIO_BUILD_PYGLUE=OFF
+               -DOCIO_BUILD_JNIGLUE=OFF
+               -DOCIO_STATIC_JNIGLUE=OFF
+               -DOCIO_USE_SSE=ON
+               -DOCIO_INLINES_HIDDEN=OFF
+               -DOCIO_USE_BOOST_PTR=OFF
+               -DOCIO_PYGLUE_LINK=OFF
+               -DOCIO_PYGLUE_RESPECT_ABI=OFF
+               -DOCIO_PYGLUE_SONAME=OFF
+               -DOCIO_PYGLUE_LIB_PREFIX=OFF
+               -DUSE_EXTERNAL_TINYXML=ON
+               -DTINYXML_INCLUDE_DIR=${LIBDIR}/tinyxml/include
+               -DTINYXML_LIBRARY=${LIBDIR}/tinyxml/lib/tinyxml${libext}
+               -DUSE_EXTERNAL_YAML=ON
+               -DYAML_CPP_FOUND=ON
+               -DYAML_CPP_VERSION=${YAMLCPP_VERSION}
+               -DUSE_EXTERNAL_LCMS=ON
+               -DINC_1=${LIBDIR}/tinyxml/include
+               -DINC_2=${LIBDIR}/yamlcpp/include
        )
 else()
+       set(OCIO_PATCH opencolorio.diff)
        set(OPENCOLORIO_EXTRA_ARGS
                ${OPENCOLORIO_EXTRA_ARGS}
                -DOCIO_USE_BOOST_PTR=OFF
@@ -53,7 +78,7 @@ ExternalProject_Add(external_opencolorio
        DOWNLOAD_DIR ${DOWNLOAD_DIR}
        URL_HASH MD5=${OPENCOLORIO_HASH}
        PREFIX ${BUILD_DIR}/opencolorio
-       PATCH_COMMAND ${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/opencolorio/src/external_opencolorio < ${PATCH_DIR}/opencolorio.diff
+       PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/opencolorio/src/external_opencolorio < ${PATCH_DIR}/${OCIO_PATCH}
        CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opencolorio ${DEFAULT_CMAKE_FLAGS} ${OPENCOLORIO_EXTRA_ARGS}
        INSTALL_DIR ${LIBDIR}/opencolorio
 )
@@ -71,3 +96,22 @@ add_dependencies(
        external_opencolorio
        external_boost
 )
+
+if(WIN32)
+       add_dependencies(
+               external_opencolorio
+               external_tinyxml
+               external_yamlcpp
+       )
+       if(BUILD_MODE STREQUAL Release)
+               ExternalProject_Add_Step(external_opencolorio after_install
+                       COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/include ${HARVEST_TARGET}/opencolorio/include
+                       COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/lib/static ${HARVEST_TARGET}/opencolorio/lib
+                       COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/yamlcpp/lib/libyaml-cppmt.lib ${HARVEST_TARGET}/opencolorio/lib/libyaml-cpp.lib
+                       COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tinyxml/lib/tinyxml.lib ${HARVEST_TARGET}/opencolorio/lib/tinyxml.lib
+                       DEPENDEES install
+               )
+       endif()
+       
+endif()
+
diff --git a/build_files/build_environment/cmake/tinyxml.cmake b/build_files/build_environment/cmake/tinyxml.cmake
new file mode 100644 (file)
index 0000000..2896bf5
--- /dev/null
@@ -0,0 +1,38 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(TINYXML_EXTRA_ARGS
+)
+
+ExternalProject_Add(external_tinyxml
+       URL ${TINYXML_URI}
+       DOWNLOAD_DIR ${DOWNLOAD_DIR}
+       URL_HASH MD5=${TINYXML_HASH}
+       PREFIX ${BUILD_DIR}/tinyxml
+       #patch taken from ocio 
+       PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/tinyxml/src/external_tinyxml < ${PATCH_DIR}/tinyxml.diff
+       CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/tinyxml ${DEFAULT_CMAKE_FLAGS} ${TINYXML_EXTRA_ARGS}
+       INSTALL_DIR ${LIBDIR}/tinyxml
+)
+
+#if(BUILD_MODE STREQUAL Release AND WIN32)
+       #ExternalProject_Add_Step(external_freetype after_install
+       #       COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freetype ${HARVEST_TARGET}/freetype
+       #       DEPENDEES install
+       #)
+#endif()
index c21f2ae3760264208f8a0303df78ec5d3a628c40..c5e8f6f6d96821055ac0ce6ad7209ac31fb9bfe5 100644 (file)
@@ -105,8 +105,9 @@ set(OPENCOLLADA_VERSION v1.6.63)
 set(OPENCOLLADA_URI https://github.com/KhronosGroup/OpenCOLLADA/archive/${OPENCOLLADA_VERSION}.tar.gz)
 set(OPENCOLLADA_HASH e937c3897b86fc0da53cde97257f5156)
 
-set(OPENCOLORIO_URI https://github.com/imageworks/OpenColorIO/archive/6de971097c7f552300f669ed69ca0b6cf5a70843.zip)
-set(OPENCOLORIO_HASH c9de0fd98f26ce6f2e08d617ca68b8e4)
+set(OPENCOLORIO_VERSION 1.1.0)
+set(OPENCOLORIO_URI https://github.com/imageworks/OpenColorIO/archive/v${OPENCOLORIO_VERSION}.tar.gz)
+set(OPENCOLORIO_HASH 802d8f5b1d1fe316ec5f76511aa611b8)
 
 set(LLVM_VERSION 6.0.1)
 set(LLVM_URI http://releases.llvm.org/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz)
@@ -249,3 +250,19 @@ set(JEMALLOC_HASH 507f7b6b882d868730d644510491d18f)
 set(XML2_VERSION 2.9.4)
 set(XML2_URI ftp://xmlsoft.org/libxml2/libxml2-${XML2_VERSION}.tar.gz)
 set(XML2_HASH ae249165c173b1ff386ee8ad676815f5)
+
+set(TINYXML_VERSION 2_6_2)
+set(TINYXML_VERSION_DOTS 2.6.2)
+set(TINYXML_URI https://nchc.dl.sourceforge.net/project/tinyxml/tinyxml/${TINYXML_VERSION_DOTS}/tinyxml_${TINYXML_VERSION}.tar.gz)
+set(TINYXML_HASH c1b864c96804a10526540c664ade67f0)
+
+set(YAMLCPP_VERSION 0.6.2)
+set(YAMLCPP_URI https://codeload.github.com/jbeder/yaml-cpp/tar.gz/yaml-cpp-${YAMLCPP_VERSION})
+set(YAMLCPP_HASH 5b943e9af0060d0811148b037449ef82)
+
+set(LCMS_VERSION 2.9)
+set(LCMS_URI https://nchc.dl.sourceforge.net/project/lcms/lcms/${LCMS_VERSION}/lcms2-${LCMS_VERSION}.tar.gz)
+set(LCMS_HASH 8de1b7724f578d2995c8fdfa35c3ad0e)
+
+
+
diff --git a/build_files/build_environment/cmake/yamlcpp.cmake b/build_files/build_environment/cmake/yamlcpp.cmake
new file mode 100644 (file)
index 0000000..308f7d8
--- /dev/null
@@ -0,0 +1,41 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(YAMLCPP_EXTRA_ARGS
+       -DBUILD_GMOCK=OFF
+       -DYAML_CPP_BUILD_TESTS=OFF
+       -DYAML_CPP_BUILD_TOOLS=OFF
+       -DYAML_CPP_BUILD_CONTRIB=OFF
+       -DMSVC_SHARED_RT=OFF
+)
+
+ExternalProject_Add(external_yamlcpp
+       URL ${YAMLCPP_URI}
+       DOWNLOAD_DIR ${DOWNLOAD_DIR}
+       URL_HASH MD5=${YAMLCPP_HASH}
+       PREFIX ${BUILD_DIR}/yamlcpp
+       CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/yamlcpp ${DEFAULT_CMAKE_FLAGS} ${YAMLCPP_EXTRA_ARGS}
+       INSTALL_DIR ${LIBDIR}/yamlcpp
+)
+
+#if(BUILD_MODE STREQUAL Release AND WIN32)
+       #ExternalProject_Add_Step(external_freetype after_install
+       #       COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freetype ${HARVEST_TARGET}/freetype
+       #       DEPENDEES install
+       #)
+#endif()
diff --git a/build_files/build_environment/patches/cmakelists_lcms.txt b/build_files/build_environment/patches/cmakelists_lcms.txt
new file mode 100644 (file)
index 0000000..cd7b456
--- /dev/null
@@ -0,0 +1,51 @@
+project(lcms2)
+
+cmake_minimum_required(VERSION 2.8)
+
+include_directories(include)
+
+set(HEADERS
+       include/lcms2.h
+       include/lcms2_plugin.h
+)
+set(SOURCES
+    src/cmscam02.c
+    src/cmscgats.c
+    src/cmscnvrt.c
+    src/cmserr.c
+    src/cmsgamma.c
+    src/cmsgmt.c
+    src/cmsintrp.c
+    src/cmsio0.c
+    src/cmsio1.c
+    src/cmslut.c
+    src/cmsmd5.c
+    src/cmsmtrx.c
+    src/cmsnamed.c
+    src/cmsopt.c
+    src/cmspack.c
+    src/cmspcs.c
+    src/cmsplugin.c
+    src/cmsps2.c
+    src/cmssamp.c
+    src/cmssm.c
+    src/cmstypes.c
+    src/cmsvirt.c
+    src/cmswtpnt.c
+    src/cmsxform.c
+    src/lcms2_internal.h
+)
+
+add_library(${PROJECT_NAME} STATIC ${HEADERS} ${SOURCES})
+
+set_target_properties(${PROJECT_NAME} PROPERTIES
+       LIBRARY_OUTPUT_NAME "${PROJECT_NAME}"
+       PUBLIC_HEADER           "${HEADERS}"
+)
+
+install(TARGETS                ${PROJECT_NAME}
+               RUNTIME         DESTINATION             bin
+        LIBRARY         DESTINATION     lib
+        ARCHIVE         DESTINATION     lib
+        PUBLIC_HEADER  DESTINATION     include
+)
diff --git a/build_files/build_environment/patches/opencolorio_win.diff b/build_files/build_environment/patches/opencolorio_win.diff
new file mode 100644 (file)
index 0000000..eb65411
--- /dev/null
@@ -0,0 +1,51 @@
+diff -Naur external_opencolorio/CMakeLists.txt external_opencolorio.patched/CMakeLists.txt
+--- external_opencolorio/CMakeLists.txt        2018-01-04 18:38:27 -0700
++++ external_opencolorio.patched/CMakeLists.txt        2018-08-15 11:46:53 -0600
+@@ -251,25 +251,30 @@
+ if(USE_EXTERNAL_YAML)
+     # Set minimum yaml version for non-patched sources.
+     set(YAML_VERSION_MIN "0.3.0")
+-    include(FindPkgConfig)
+-    pkg_check_modules(PC_YAML_CPP REQUIRED QUIET yaml-cpp)
+-    find_path(YAML_CPP_INCLUDE_DIR yaml-cpp/yaml.h
+-        HINTS  ${PC_YAML_CPP_INCLUDEDIR} ${PC_YAML_CPP_INCLUDE_DIRS} )
+-    find_library(YAML_CPP_LIBRARY LIBRARY_NAMES yaml-cpp libyaml-cpp
+-        HINTS ${PC_YAML_CPP_LIBRARY_DIRS} )
+-    set(YAML_CPP_LIBRARIES ${YAML_CPP_LIBRARY})
+-    set(YAML_CPP_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR})
+-    set(YAML_CPP_VERSION ${PC_YAML_CPP_VERSION})
++    if(NOT WIN32)
++              include(FindPkgConfig)
++              pkg_check_modules(PC_YAML_CPP REQUIRED QUIET yaml-cpp)
++              find_path(YAML_CPP_INCLUDE_DIR yaml-cpp/yaml.h
++                      HINTS  ${PC_YAML_CPP_INCLUDEDIR} ${PC_YAML_CPP_INCLUDE_DIRS} )
++              find_library(YAML_CPP_LIBRARY LIBRARY_NAMES yaml-cpp libyaml-cpp
++                      HINTS ${PC_YAML_CPP_LIBRARY_DIRS} )
++              set(YAML_CPP_LIBRARIES ${YAML_CPP_LIBRARY})
++              set(YAML_CPP_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR})
++              set(YAML_CPP_VERSION ${PC_YAML_CPP_VERSION})
+-    if(YAML_CPP_VERSION VERSION_LESS ${YAML_VERSION_MIN})
+-        message(FATAL_ERROR "ERROR: yaml-cpp ${YAML_VERSION_MIN} or greater is required.")
+-    endif()
+-
+-    find_package_handle_standard_args(yaml-cpp
+-                                      REQUIRED_VARS YAML_CPP_LIBRARIES YAML_CPP_INCLUDE_DIRS )
+-    set(YAML_CPP_FOUND ${YAML-CPP_FOUND})
+-    mark_as_advanced(YAML_CPP_INCLUDE_DIR YAML_CPP_LIBRARY YAML-CPP_FOUND)
++              if(YAML_CPP_VERSION VERSION_LESS ${YAML_VERSION_MIN})
++                      message(FATAL_ERROR "ERROR: yaml-cpp ${YAML_VERSION_MIN} or greater is required.")
++              endif()
++              find_package_handle_standard_args(yaml-cpp
++                                                                                REQUIRED_VARS YAML_CPP_LIBRARIES YAML_CPP_INCLUDE_DIRS )
++              set(YAML_CPP_FOUND ${YAML-CPP_FOUND})
++              mark_as_advanced(YAML_CPP_INCLUDE_DIR YAML_CPP_LIBRARY YAML-CPP_FOUND)
++      else()
++              set(EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDE_DIRS} ${INC_1})
++              set(EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDE_DIRS} ${INC_2})
++              message("INCLUDE DIRS = i:${EXTERNAL_INCLUDE_DIRS} |1:${INC_1} |2:${INC_2}")
++      endif()
+     if(YAML_CPP_FOUND)
+         if(YAML_CPP_VERSION VERSION_GREATER "0.5.0")
+             # Need to also get the boost headers here, as yaml-cpp 0.5.0+ requires them.
diff --git a/build_files/build_environment/patches/tinyxml.diff b/build_files/build_environment/patches/tinyxml.diff
new file mode 100644 (file)
index 0000000..9965f3e
--- /dev/null
@@ -0,0 +1,34 @@
+diff -Naur tinyxml.orig/CMakeLists.txt tinyxml/CMakeLists.txt
+--- tinyxml.orig/CMakeLists.txt        1969-12-31 16:00:00.000000000 -0800
++++ tinyxml/CMakeLists.txt     2013-06-18 17:10:59.000000000 -0700
+@@ -0,0 +1,30 @@
++project(tinyxml)
++
++cmake_minimum_required(VERSION 2.8)
++
++add_library(tinyxml
++    STATIC
++    tinystr.cpp
++    tinyxml.cpp
++    tinyxmlerror.cpp
++    tinyxmlparser.cpp)
++
++set(TINYXML_COMPILE_FLAGS "-DTIXML_USE_STL")
++
++if(UNIX)
++    set(TINYXML_COMPILE_FLAGS "${TINYXML_COMPILE_FLAGS} -fPIC -fvisibility=hidden")
++endif()
++
++if(OCIO_INLINES_HIDDEN AND UNIX)
++    set(TINYXML_COMPILE_FLAGS "${TINYXML_COMPILE_FLAGS} -fvisibility-inlines-hidden")
++endif()
++
++set_target_properties(tinyxml PROPERTIES
++    COMPILE_FLAGS "${TINYXML_COMPILE_FLAGS}")
++
++install(TARGETS
++    tinyxml
++    DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
++install(FILES
++    tinyxml.h tinystr.h
++    DESTINATION ${CMAKE_INSTALL_PREFIX}/include)