Commit b378feaf authored by Boudewijn Rempt's avatar Boudewijn Rempt

Fix building with OCIO on Windows

parent 5bc6d626
......@@ -38,7 +38,6 @@ if (${CMAKE_GENERATOR} STREQUAL "Visual Studio 14 2015 Win64")
-DCMAKE_EXE_LINKER_FLAGS=/machine:x64
-DCMAKE_SHARED_LINKER_FLAGS=/machine:x64
-DCMAKE_STATIC_LINKER_FLAGS=/machine:x64
-DCMAKE_RC_COMPILER = "C:/Program Files (x86)/Windows Kits/8.0/bin/x64/rc.exe"
)
endif ()
......
......@@ -23,7 +23,7 @@ Note: on all operating systems the entire procedure is done in a terminal window
1. git: https://git-scm.com/downloads. Make sure git is in your path
2. cmake: https://cmake.org/download/. Make sure cmake is in your path.
3. Make sure you have a compiler:
* Linux: gcc, minimum version 4.5
* Linux: gcc, minimum version 4.8
* OSX: clang, you need to install xcode for this
* Windows: MSVC 2015 Community Edition: https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx
......@@ -31,7 +31,8 @@ Note: on all operating systems the entire procedure is done in a terminal window
== Prepare your directory layout ==
1. Make a toplevel build directory, say $HOME/dev or c:\dev. We'll refer to this directory as BUILDROOT
1. Make a toplevel build directory, say $HOME/dev or c:\dev. We'll refer to this directory as BUILDROOT. You can use a variable for this, on WINDOWS %BUILDROOT%, on OSX and Linux $BUILDROOT.
2. Checkout krita in BUILDROOT
cd BUILDROOT
git clone git://anongit.kde.org/krita.git
......@@ -83,6 +84,34 @@ When installing from source, you can use these example configure commands:
* OSX
./configure \
-skip qt3d \
-skip qtactiveqt \
-skip qtcanvas3d \
-skip qtconnectivity \
-skip qtdeclarative \
-skip qtdoc \
-skip qtenginio \
-skip qtgraphicaleffects \
-skip qtlocation \
-skip qtmultimedia \
-skip qtsensors \
-skip qtserialport \
-skip qtwayland \
-skip qtwebchannel \
-skip qtwebengine \
-skip qtwebsockets \
-skip qtxmlpatterns \
-opensource -confirm-license -release \
-no-qml-debug -no-mtdev -no-journald \
-no-openssl -no-libproxy \
-no-pulseaudio -no-alsa -no-nis \
-no-cups -no-tslib -no-pch \
-no-dbus -no-gstreamer -no-system-proxies \
-no-openssl -no-libproxy -no-pulseaudio \
-nomake examples -nomake demos \
-prefix $BUILDROOT/i
* Windows
configure -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdoc -skip qtenginio -skip qtgraphicaleffects -skip qtlocation -skip qtmultimedia -skip qtsensors -skip qtserialport -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtxmlpatterns -opensource -confirm-license -release -no-qml-debug -no-mtdev -no-openssl -no-libproxy -no-nis -no-dbus -no-system-proxies -no-libproxy -opengl desktop -prefix %BUILDROOT%\i
......@@ -149,6 +178,7 @@ Note for Windows:
With MSVC 2015, the boost library has a name that later on makes the libraries unfindable, so you need to copy them.
cd BUILDROOT\i\lib
copy boost_system-vc-mt-1_55.dll boost_system140-mt-1_55.ddl
copy boost_system-vc-mt-1_55.lib boost_system140-mt-1_55.lib
......@@ -209,6 +239,7 @@ On OSX
On Linux and OSX
make
make install
On Windows
cmake --build . --config RelWithDebInfo --target INSTALL
......
#
# The latest opencolorio doesn't build on Windows without using boost::ptr, but if you build
# it with boost::ptr, you cannot link to it because of missing dll exports, so build an older
# ocio on Windows.
#
SET(EXTPREFIX_ocio "${EXTPREFIX}" )
if (MSVC)
ExternalProject_Add(
ext_ocio
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/opencolorio-a557a85454ee1ffa8cb66f8a96238e079c452f08.tgz
URL_MD5 c7db4cdcac40ab12870cdeb6bbd0b875
PATCH_COMMAND ${PATCH_COMMAND} -binary -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/patch.diff
URL http://files.kde.org/krita/build/dependencies/ext_ocio.zip
URL_MD5 e0bc2c7177dc02bdc82e8f38f52b1058
INSTALL_DIR ${EXTPREFIX_ocio}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_ocio} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DOCIO_BUILD_APPS=OFF -DOCIO_BUILD_TRUELIGHT=OFF -DOCIO_BUILD_NUKE=OFF -DOCIO_BUILD_DOCS=OFF -DOCIO_BUILD_TESTS=OFF -DOCIO_BUILD_PYGLUE=OFF -DOCIO_BUILD_STATIC_JNIGLUE=OFF -DOCIO_USE_BOOST_PTR=ON
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_ocio} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} -DOCIO_BUILD_APPS=OFF -DOCIO_BUILD_TRUELIGHT=OFF -DOCIO_BUILD_NUKE=OFF -DOCIO_BUILD_DOCS=OFF -DOCIO_BUILD_TESTS=OFF -DOCIO_BUILD_PYGLUE=OFF -DOCIO_BUILD_STATIC_JNIGLUE=OFF
UPDATE_COMMAND ""
ALWAYS 0
......
......@@ -325,9 +325,6 @@ target_link_libraries(kritaimage kritaversion kritawidgets kritaglobal kritapsd
target_link_libraries(kritaimage LINK_INTERFACE_LIBRARIES kritaversion kritaglobal kritapsd kritaodf kritapigment kritaundo2 kritawidgetutils Qt5::Concurrent)
target_link_libraries(kritaimage ${Boost_SYSTEM_LIBRARY})
message("DEBUG_BOOST_LIBRARIES = " ${Boost_LIBRARIES})
message("DEBUG_BOOST_SYSTEM_FOUND = " ${Boost_SYSTEM_FOUND})
message("DEBUG_BOOST_SYSTEM_LIBRARY = " ${Boost_SYSTEM_LIBRARY})
if(OPENEXR_FOUND)
target_link_libraries(kritaimage ${OPENEXR_LIBRARIES})
......
......@@ -15,5 +15,5 @@ ki18n_wrap_ui(KRITA_LUTDOCKER_SOURCES
add_library(kritalutdocker MODULE ${KRITA_LUTDOCKER_SOURCES})
generate_export_header(kritalutdocker BASE_NAME kritalutdocker)
target_link_libraries(kritalutdocker kritaui ${OCIO_LIBRARIES})
target_link_libraries(kritalutdocker kritaui ${Boost_SYSTEM_LIBRARY} ${OCIO_LIBRARIES})
install(TARGETS kritalutdocker DESTINATION ${CALLIGRA_PLUGIN_INSTALL_DIR})
rem
rem Follow the instructions in 3rdparty/README.md to setup Qt and the
rem build dirs and checkout krita
rem
set PATH=c:\dev\i\bin\;c:\dev\i\lib;%PATH%
cd c:\dev\b
cmake ..\krita\3rdparty -DEXTERNALS_DOWNLOAD_DIR=/dev/d -DINSTALL_ROOT=/dev/i -G "Visual Studio 14 Win64"
cmake --build . --config RelWithDebInfo --target ext_patch
cmake --build . --config RelWithDebInfo --target ext_png2ico
cmake --build . --config RelWithDebInfo --target ext_pthreads
cmake --build . --config RelWithDebInfo --target ext_boost
copy c:\dev\i\lib\boost_system-vc-mt-1_55.dll c:\dev\i\lib\boost_system-vc140-mt-1_55.dll
copy c:\dev\i\lib\boost_system-vc-mt-1_55.lib c:\dev\i\lib\boost_system-vc140-mt-1_55.lib
cmake --build . --config RelWithDebInfo --target ext_eigen3
cmake --build . --config RelWithDebInfo --target ext_fftw3
xcopy ext_fftw3\ext_fftw3-prefix\src\ext_fftw3\bin c:\dev\i
xcopy ext_fftw3\ext_fftw3-prefix\src\ext_fftw3\lib c:\dev\i
xcopy ext_fftw3\ext_fftw3-prefix\src\ext_fftw3\include c:\dev\i
cmake --build . --config RelWithDebInfo --target ext_ilmbase
cmake --build . --config RelWithDebInfo --target ext_jpeg
cmake --build . --config RelWithDebInfo --target ext_lcms2
cmake --build . --config RelWithDebInfo --target ext_png
cmake --build . --config RelWithDebInfo --target ext_tiff
cmake --build . --config RelWithDebInfo --target ext_gsl
cmake --build . --config RelWithDebInfo --target ext_vc
cmake --build . --config RelWithDebInfo --target ext_libraw
cmake --build . --config RelWithDebInfo --target ext_openjpeg
cmake --build . --config RelWithDebInfo --target ext_freetype
cmake --build . --config RelWithDebInfo --target ext_ocio
cmake --build . --config RelWithDebInfo --target ext_openexr
cmake --build . --config RelWithDebInfo --target ext_exiv2
cmake --build . --config RelWithDebInfo --target ext_kwindowsystem
REM cmake --build . --config RelWithDebInfo --target ext_poppler
cd c:\dev\build
cmake ..\krita -G"Visual Studio 14 Win64" -DBoost_DEBUG=OFF -DBOOST_INCLUDEDIR=c:\dev\i\include -DBOOST_DEBUG=ON -DBOOST_ROOT=c:\dev\i -DBOOST_LIBRARYDIR=c:\dev\i\lib -DCMAKE_INSTALL_PREFIX=c:\dev\i -DCMAKE_PREFIX_PATH=c:\dev\i -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF -DKDE4_BUILD_TESTS=OFF -DHAVE_MEMORY_LEAK_TRACKER=OFF -DPACKAGERS_BUILD=ON -Wno-dev -DDEFINE_NO_DEPRECATED=1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment