Commit f46a4bb8 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Remove the MSVC option and warn when trying to build with MSVC

parent 6bf6cd1a
......@@ -13,7 +13,7 @@ cmake_minimum_required(VERSION 2.8.6)
if(NOT SUBMAKE_JOBS)
set(SUBMAKE_JOBS 1)
endif(NOT SUBMAKE_JOBS)
endif()
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "Compiling in the source directory is not supported. Use for example 'mkdir build; cd build; cmake ..'.")
......@@ -59,8 +59,8 @@ if (MINGW)
message(STATUS "WindowsSdkDir is set to '$ENV{WindowsSdkDir}'")
else (DEFINED ENV{WindowsSdkDir})
message(FATAL_ERROR "Environment variable 'WindowsSdkDir' not set! Please set it to path of Windows 10 SDK or disable QT_ENABLE_DYNAMIC_OPENGL")
endif (DEFINED ENV{WindowsSdkDir})
endif (QT_ENABLE_DYNAMIC_OPENGL)
endif ()
endif ()
endif (MINGW)
set(SECURITY_EXE_LINKER_FLAGS "")
......@@ -84,19 +84,18 @@ if (MINGW)
-DCMAKE_SHARED_LINKER_FLAGS=${SECURITY_SHARED_LINKER_FLAGS}
-DCMAKE_MODULE_LINKER_FLAGS=${SECURITY_MODULE_LINKER_FLAGS}
)
endif ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
else (USE_MINGW_HARDENING_LINKER)
endif ()
else ()
message(WARNING "Linker Security Flags not enabled!")
endif (USE_MINGW_HARDENING_LINKER)
endif (MINGW)
endif ()
endif ()
if (DEFINED EP_PREFIX)
set_directory_properties(PROPERTIES EP_PREFIX ${EP_PREFIX})
endif (DEFINED EP_PREFIX)
endif ()
if (MSVC)
set(GLOBAL_PROFILE ${GLOBAL_PROFILE} -DCMAKE_EXE_LINKER_FLAGS=/PROFILE -DCMAKE_SHARED_LINKER_FLAGS=/PROFILE)
set(PATCH_COMMAND myptch)
message(FATAL_ERROR "Krita cannot be built with MSVC. See the README.md file!")
endif()
if (MINGW)
......@@ -132,7 +131,7 @@ function(TestCompileLinkPythonLibs OUTPUT_VARNAME)
set(CMAKE_REQUIRED_LIBRARIES ${PYTHON_LIBRARIES})
if (MINGW)
set(CMAKE_REQUIRED_DEFINITIONS -D_hypot=hypot)
endif (MINGW)
endif ()
unset(${OUTPUT_VARNAME} CACHE)
CHECK_CXX_SOURCE_COMPILES("
#include <Python.h>
......@@ -149,31 +148,27 @@ if (MINGW)
else(ENABLE_PYTHON_2)
find_package(PythonInterp 3.6 EXACT)
find_package(PythonLibs 3.6 EXACT)
endif(ENABLE_PYTHON_2)
endif()
if (PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
message(STATUS "Python requirements met.")
TestCompileLinkPythonLibs(CAN_USE_PYTHON_LIBS)
if (NOT CAN_USE_PYTHON_LIBS)
message(FATAL_ERROR "Compiling with Python library failed, please check whether the architecture is correct!")
endif (NOT CAN_USE_PYTHON_LIBS)
endif ()
else (PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
message(FATAL_ERROR "Python requirements not met. To disable Python deps, set ENABLE_PYTHON_DEPS to OFF.")
endif (PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND)
endif (ENABLE_PYTHON_DEPS)
endif (MINGW)
endif ()
endif ()
endif ()
# this list must be dependency-ordered
if (ENABLE_PYTHON_DEPS OR NOT MINGW)
add_subdirectory( ext_python )
endif (ENABLE_PYTHON_DEPS OR NOT MINGW)
if (MSVC)
add_subdirectory( ext_patch )
add_subdirectory( ext_png2ico )
endif (MSVC)
endif ()
if (MINGW)
add_subdirectory( ext_patch )
add_subdirectory( ext_png2ico )
endif (MINGW)
endif ()
add_subdirectory( ext_iconv )
add_subdirectory( ext_gettext )
add_subdirectory( ext_zlib )
......@@ -191,9 +186,6 @@ add_subdirectory( ext_vc )
add_subdirectory( ext_gsl )
add_subdirectory( ext_fftw3 )
add_subdirectory( ext_ocio )
if (MSVC)
add_subdirectory( ext_pthreads )
endif (MSVC)
add_subdirectory( ext_fontconfig)
add_subdirectory( ext_freetype)
add_subdirectory( ext_qt )
......@@ -203,15 +195,15 @@ add_subdirectory( ext_frameworks )
if (ENABLE_PYTHON_DEPS OR NOT MINGW)
add_subdirectory( ext_sip )
add_subdirectory( ext_pyqt )
endif (ENABLE_PYTHON_DEPS OR NOT MINGW)
endif ()
if (MSVC OR MINGW)
if (MINGW)
add_subdirectory( ext_drmingw )
# add_subdirectory( ext_ffmpeg )
endif (MSVC OR MINGW)
endif ()
if (NOT APPLE)
add_subdirectory( ext_gmic )
endif (NOT APPLE)
endif ()
add_subdirectory(ext_giflib)
SET(PREFIX_ext_boost "${EXTPREFIX}" )
if (MSVC)
if (${CMAKE_GENERATOR} STREQUAL "Visual Studio 14 2015 Win64")
ExternalProject_Add(
ext_boost
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/boost_1_61_0.zip
URL_MD5 015ae4afa6f3e597232bfe1dab949ace
CONFIGURE_COMMAND <SOURCE_DIR>/bootstrap.bat --prefix=${PREFIX_ext_boost}
BUILD_COMMAND <SOURCE_DIR>/b2.exe -j${SUBMAKE_JOBS} --with-system --build-dir=build-dir --prefix=${PREFIX_ext_boost} toolset=msvc-14.0 variant=release link=shared threading=multi architecture=x86 address-model=64 variant=release install
INSTALL_COMMAND ""
INSTALL_DIR ${EXTPREFIX_boost}
UPDATE_COMMAND ""
BUILD_IN_SOURCE 1
)
ExternalProject_Add_Step(
ext_boost
post_install
COMMAND ${CMAKE_COMMAND} -E copy ${PREFIX_ext_boost}/lib/boost_system-vc140-mt-1_61.dll ${PREFIX_ext_boost}/bin/boost_system-vc140-mt-1_61.dll
DEPENDEES install
)
else()
ExternalProject_Add(
ext_boost
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/boost_1_61_0.zip
URL_MD5 015ae4afa6f3e597232bfe1dab949ace
CONFIGURE_COMMAND <SOURCE_DIR>/bootstrap.bat --prefix=${PREFIX_ext_boost}
BUILD_COMMAND <SOURCE_DIR>/b2.exe -j${SUBMAKE_JOBS} --with-system --build-dir=build-dir --prefix=${PREFIX_ext_boost} toolset=msvc-14.0 variant=release link=shared threading=multi architecture=x86 variant=release install
INSTALL_COMMAND ""
INSTALL_DIR ${EXTPREFIX_boost}
UPDATE_COMMAND ""
BUILD_IN_SOURCE 1
)
ExternalProject_Add_Step(
ext_boost
post_install
COMMAND ${CMAKE_COMMAND} -E copy ${PREFIX_ext_boost}/lib/boost_system-vc140-mt-1_61.dll ${PREFIX_ext_boost}/bin/boost_system-vc140-mt-1_61.dll
DEPENDEES install
)
endif()
elseif(MINGW)
if(MINGW)
string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
KRITA_boost_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
ExternalProject_Add(
......
SET (PREFIX_ext_drmingw "${EXTPREFIX}")
if (MSVC OR MINGW)
if (MINGW)
ExternalProject_Add(ext_drmingw
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://files.kde.org/krita/build/dependencies/drmingw-25e5211.zip
......@@ -43,4 +43,4 @@ if (MSVC OR MINGW)
endif ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
add_dependencies(ext_drmingw ext_drmingw_deps)
endif (MSVC OR MINGW)
endif (MINGW)
SET(PREFIX_ext_ffmpeg "${EXTPREFIX}" )
if(MSVC OR MINGW)
if(MINGW)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
ExternalProject_Add( ext_ffmpeg
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
......
SET(PREFIX_ext_gettext "${EXTPREFIX}" )
if (MSVC OR MINGW)
if (MINGW)
ExternalProject_Add(
ext_gettext
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
......@@ -13,7 +13,7 @@ ExternalProject_Add(
UPDATE_COMMAND ""
DEPENDS ext_patch ext_iconv
)
else (MSVC OR MINGW)
else (MINGW)
ExternalProject_Add( ext_gettext
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/gettext-0.19.8.tar.gz
......@@ -27,4 +27,4 @@ ExternalProject_Add( ext_gettext
UPDATE_COMMAND ""
DEPENDS ext_iconv
)
endif (MSVC OR MINGW)
endif (MINGW)
SET(PREFIX_ext_giflib "${EXTPREFIX}" )
if (MINGW OR MSVC)
if (MINGW )
ExternalProject_Add(
ext_giflib
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
......
SET(PREFIX_ext_iconv "${EXTPREFIX}" )
if (MSVC OR MINGW)
if (MINGW)
ExternalProject_Add( ext_iconv
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/win-iconv-0.0.6.tar.bz2
......
......@@ -8,20 +8,6 @@ ExternalProject_Add( ext_ilmbase
UPDATE_COMMAND ""
)
if (MSVC)
ExternalProject_Add_Step(
ext_ilmbase
post_install
COMMAND ${CMAKE_COMMAND} -E copy ${PREFIX_ext_ilmbase}/lib/Half.dll ${PREFIX_ext_ilmbase}/bin/Half.dll
COMMAND ${CMAKE_COMMAND} -E copy ${PREFIX_ext_ilmbase}/lib/Iex.dll ${PREFIX_ext_ilmbase}/bin/Iex.dll
COMMAND ${CMAKE_COMMAND} -E copy ${PREFIX_ext_ilmbase}/lib/Imath.dll ${PREFIX_ext_ilmbase}/bin/Imath.dll
COMMAND ${CMAKE_COMMAND} -E copy ${PREFIX_ext_ilmbase}/lib/IlmThread.dll ${PREFIX_ext_ilmbase}/bin/IlmThread.dll
COMMAND ${CMAKE_COMMAND} -E copy ${PREFIX_ext_ilmbase}/lib/IexMath.dll ${PREFIX_ext_ilmbase}/bin/IexMath.dll
DEPENDEES install
)
endif()
if (MINGW)
ExternalProject_Add_Step(
ext_ilmbase
......
SET(PREFIX_ext_jpeg "${EXTPREFIX}" )
if (MSVC OR MINGW)
if (MINGW)
ExternalProject_Add( ext_jpeg
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/libjpeg-turbo-1.5.3.tar.gz
......
SET(PREFIX_ext_lcms2 "${EXTPREFIX}" )
if (MSVC OR MINGW)
if (MINGW)
ExternalProject_Add( ext_lcms2
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/lcms2-2.9.tar.gz
......@@ -12,7 +12,7 @@ ExternalProject_Add( ext_lcms2
UPDATE_COMMAND ""
DEPENDS ext_patch
)
else (MSVC OR MINGW)
else ()
ExternalProject_Add( ext_lcms2
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/lcms2-2.9.tar.gz
......@@ -24,4 +24,4 @@ ExternalProject_Add( ext_lcms2
UPDATE_COMMAND ""
)
endif (MSVC OR MINGW)
endif ()
......@@ -4,7 +4,7 @@
# ocio on Windows.
#
SET(EXTPREFIX_ocio "${EXTPREFIX}" )
if (MSVC OR MINGW)
if (MINGW)
ExternalProject_Add(
ext_ocio
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
......
SET(EXTPREFIX_openexr "${EXTPREFIX}" )
if (MSVC OR MINGW)
if (MINGW)
ExternalProject_Add( ext_openexr
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/openexr-2.2.1.tar.gz
......
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