diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:35:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:35:54 +0300 |
commit | 3076d95ba441cd32706a27d18922a30f8fd28b8a (patch) | |
tree | 1c4f33b41c3d6d94a738e598c95423cdcfa8a34d /build_files/cmake/platform/platform_unix.cmake | |
parent | 91a9cd0a94000047248598394c41ac30f893f147 (diff) |
Cleanup: use 2 space indentation for CMake
Diffstat (limited to 'build_files/cmake/platform/platform_unix.cmake')
-rw-r--r-- | build_files/cmake/platform/platform_unix.cmake | 630 |
1 files changed, 315 insertions, 315 deletions
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake index 0d486c84fe6..0f5b45d722b 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -22,34 +22,34 @@ # Detect precompiled library directory if(NOT DEFINED LIBDIR) - set(LIBDIR_NAME ${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_PROCESSOR}) - string(TOLOWER ${LIBDIR_NAME} LIBDIR_NAME) - set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_NAME}) + set(LIBDIR_NAME ${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_PROCESSOR}) + string(TOLOWER ${LIBDIR_NAME} LIBDIR_NAME) + set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_NAME}) else() - message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}") + message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}") endif() if(EXISTS ${LIBDIR}) - file(GLOB LIB_SUBDIRS ${LIBDIR}/*) - # NOTE: Make sure "proper" compiled zlib comes first before the one - # which is a part of OpenCollada. They have different ABI, and we - # do need to use the official one. - set(CMAKE_PREFIX_PATH ${LIBDIR}/zlib ${LIB_SUBDIRS}) - set(WITH_STATIC_LIBS ON) - set(WITH_OPENMP_STATIC ON) + file(GLOB LIB_SUBDIRS ${LIBDIR}/*) + # NOTE: Make sure "proper" compiled zlib comes first before the one + # which is a part of OpenCollada. They have different ABI, and we + # do need to use the official one. + set(CMAKE_PREFIX_PATH ${LIBDIR}/zlib ${LIB_SUBDIRS}) + set(WITH_STATIC_LIBS ON) + set(WITH_OPENMP_STATIC ON) endif() if(WITH_STATIC_LIBS) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++") endif() # Wrapper to prefer static libraries macro(find_package_wrapper) - if(WITH_STATIC_LIBS) - find_package_static(${ARGV}) - else() - find_package(${ARGV}) - endif() + if(WITH_STATIC_LIBS) + find_package_static(${ARGV}) + else() + find_package(${ARGV}) + endif() endmacro() find_package_wrapper(JPEG REQUIRED) @@ -58,360 +58,360 @@ find_package_wrapper(ZLIB REQUIRED) find_package_wrapper(Freetype REQUIRED) if(WITH_LZO AND WITH_SYSTEM_LZO) - find_package_wrapper(LZO) - if(NOT LZO_FOUND) - message(FATAL_ERROR "Failed finding system LZO version!") - endif() + find_package_wrapper(LZO) + if(NOT LZO_FOUND) + message(FATAL_ERROR "Failed finding system LZO version!") + endif() endif() if(WITH_SYSTEM_EIGEN3) - find_package_wrapper(Eigen3) - if(NOT EIGEN3_FOUND) - message(FATAL_ERROR "Failed finding system Eigen3 version!") - endif() + find_package_wrapper(Eigen3) + if(NOT EIGEN3_FOUND) + message(FATAL_ERROR "Failed finding system Eigen3 version!") + endif() endif() # else values are set below for all platforms if(WITH_PYTHON) - # No way to set py35, remove for now. - # find_package(PythonLibs) + # No way to set py35, remove for now. + # find_package(PythonLibs) - # Use our own instead, since without py is such a rare case, - # require this package - # XXX Linking errors with debian static python :/ -# find_package_wrapper(PythonLibsUnix REQUIRED) - find_package(PythonLibsUnix REQUIRED) + # Use our own instead, since without py is such a rare case, + # require this package + # XXX Linking errors with debian static python :/ +# find_package_wrapper(PythonLibsUnix REQUIRED) + find_package(PythonLibsUnix REQUIRED) endif() if(WITH_IMAGE_OPENEXR) - find_package_wrapper(OpenEXR) # our own module - if(NOT OPENEXR_FOUND) - set(WITH_IMAGE_OPENEXR OFF) - endif() + find_package_wrapper(OpenEXR) # our own module + if(NOT OPENEXR_FOUND) + set(WITH_IMAGE_OPENEXR OFF) + endif() endif() if(WITH_IMAGE_OPENJPEG) - find_package_wrapper(OpenJPEG) - if(NOT OPENJPEG_FOUND) - set(WITH_IMAGE_OPENJPEG OFF) - endif() + find_package_wrapper(OpenJPEG) + if(NOT OPENJPEG_FOUND) + set(WITH_IMAGE_OPENJPEG OFF) + endif() endif() if(WITH_IMAGE_TIFF) - # XXX Linking errors with debian static tiff :/ -# find_package_wrapper(TIFF) - find_package(TIFF) - if(NOT TIFF_FOUND) - set(WITH_IMAGE_TIFF OFF) - endif() + # XXX Linking errors with debian static tiff :/ +# find_package_wrapper(TIFF) + find_package(TIFF) + if(NOT TIFF_FOUND) + set(WITH_IMAGE_TIFF OFF) + endif() endif() # Audio IO if(WITH_SYSTEM_AUDASPACE) - find_package_wrapper(Audaspace) - if(NOT AUDASPACE_FOUND OR NOT AUDASPACE_C_FOUND) - message(FATAL_ERROR "Audaspace external library not found!") - endif() + find_package_wrapper(Audaspace) + if(NOT AUDASPACE_FOUND OR NOT AUDASPACE_C_FOUND) + message(FATAL_ERROR "Audaspace external library not found!") + endif() endif() if(WITH_OPENAL) - find_package_wrapper(OpenAL) - if(NOT OPENAL_FOUND) - set(WITH_OPENAL OFF) - endif() + find_package_wrapper(OpenAL) + if(NOT OPENAL_FOUND) + set(WITH_OPENAL OFF) + endif() endif() if(WITH_SDL) - if(WITH_SDL_DYNLOAD) - set(SDL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extern/sdlew/include/SDL2") - set(SDL_LIBRARY) - else() - find_package_wrapper(SDL2) - if(SDL2_FOUND) - # Use same names for both versions of SDL until we move to 2.x. - set(SDL_INCLUDE_DIR "${SDL2_INCLUDE_DIR}") - set(SDL_LIBRARY "${SDL2_LIBRARY}") - set(SDL_FOUND "${SDL2_FOUND}") - else() - find_package_wrapper(SDL) - endif() - mark_as_advanced( - SDL_INCLUDE_DIR - SDL_LIBRARY - ) - # unset(SDLMAIN_LIBRARY CACHE) - if(NOT SDL_FOUND) - set(WITH_SDL OFF) - endif() - endif() + if(WITH_SDL_DYNLOAD) + set(SDL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extern/sdlew/include/SDL2") + set(SDL_LIBRARY) + else() + find_package_wrapper(SDL2) + if(SDL2_FOUND) + # Use same names for both versions of SDL until we move to 2.x. + set(SDL_INCLUDE_DIR "${SDL2_INCLUDE_DIR}") + set(SDL_LIBRARY "${SDL2_LIBRARY}") + set(SDL_FOUND "${SDL2_FOUND}") + else() + find_package_wrapper(SDL) + endif() + mark_as_advanced( + SDL_INCLUDE_DIR + SDL_LIBRARY + ) + # unset(SDLMAIN_LIBRARY CACHE) + if(NOT SDL_FOUND) + set(WITH_SDL OFF) + endif() + endif() endif() if(WITH_JACK) - find_package_wrapper(Jack) - if(NOT JACK_FOUND) - set(WITH_JACK OFF) - endif() + find_package_wrapper(Jack) + if(NOT JACK_FOUND) + set(WITH_JACK OFF) + endif() endif() # Codecs if(WITH_CODEC_SNDFILE) - find_package_wrapper(SndFile) - if(NOT LIBSNDFILE_FOUND) - set(WITH_CODEC_SNDFILE OFF) - endif() + find_package_wrapper(SndFile) + if(NOT LIBSNDFILE_FOUND) + set(WITH_CODEC_SNDFILE OFF) + endif() endif() if(WITH_CODEC_FFMPEG) - if(EXISTS ${LIBDIR}) - # For precompiled lib directory, all ffmpeg dependencies are in the same folder - file(GLOB ffmpeg_libs ${LIBDIR}/ffmpeg/lib/*.a ${LIBDIR}/sndfile/lib/*.a) - set(FFMPEG ${LIBDIR}/ffmpeg CACHE PATH "FFMPEG Directory") - set(FFMPEG_LIBRARIES ${ffmpeg_libs} ${ffmpeg_libs} CACHE STRING "FFMPEG Libraries") - else() - set(FFMPEG /usr CACHE PATH "FFMPEG Directory") - set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries") - endif() + if(EXISTS ${LIBDIR}) + # For precompiled lib directory, all ffmpeg dependencies are in the same folder + file(GLOB ffmpeg_libs ${LIBDIR}/ffmpeg/lib/*.a ${LIBDIR}/sndfile/lib/*.a) + set(FFMPEG ${LIBDIR}/ffmpeg CACHE PATH "FFMPEG Directory") + set(FFMPEG_LIBRARIES ${ffmpeg_libs} ${ffmpeg_libs} CACHE STRING "FFMPEG Libraries") + else() + set(FFMPEG /usr CACHE PATH "FFMPEG Directory") + set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries") + endif() - mark_as_advanced(FFMPEG) + mark_as_advanced(FFMPEG) - # lame, but until we have proper find module for ffmpeg - set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include) - if(EXISTS "${FFMPEG}/include/ffmpeg/") - list(APPEND FFMPEG_INCLUDE_DIRS "${FFMPEG}/include/ffmpeg") - endif() - # end lameness + # lame, but until we have proper find module for ffmpeg + set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include) + if(EXISTS "${FFMPEG}/include/ffmpeg/") + list(APPEND FFMPEG_INCLUDE_DIRS "${FFMPEG}/include/ffmpeg") + endif() + # end lameness - mark_as_advanced(FFMPEG_LIBRARIES) - set(FFMPEG_LIBPATH ${FFMPEG}/lib) + mark_as_advanced(FFMPEG_LIBRARIES) + set(FFMPEG_LIBPATH ${FFMPEG}/lib) endif() if(WITH_FFTW3) - find_package_wrapper(Fftw3) - if(NOT FFTW3_FOUND) - set(WITH_FFTW3 OFF) - endif() + find_package_wrapper(Fftw3) + if(NOT FFTW3_FOUND) + set(WITH_FFTW3 OFF) + endif() endif() if(WITH_OPENCOLLADA) - find_package_wrapper(OpenCOLLADA) - if(OPENCOLLADA_FOUND) - find_package_wrapper(XML2) - find_package_wrapper(PCRE) - else() - set(WITH_OPENCOLLADA OFF) - endif() + find_package_wrapper(OpenCOLLADA) + if(OPENCOLLADA_FOUND) + find_package_wrapper(XML2) + find_package_wrapper(PCRE) + else() + set(WITH_OPENCOLLADA OFF) + endif() endif() if(WITH_MEM_JEMALLOC) - find_package_wrapper(JeMalloc) - if(NOT JEMALLOC_FOUND) - set(WITH_MEM_JEMALLOC OFF) - endif() + find_package_wrapper(JeMalloc) + if(NOT JEMALLOC_FOUND) + set(WITH_MEM_JEMALLOC OFF) + endif() endif() if(WITH_INPUT_NDOF) - find_package_wrapper(Spacenav) - if(SPACENAV_FOUND) - # use generic names within blenders buildsystem. - set(NDOF_INCLUDE_DIRS ${SPACENAV_INCLUDE_DIRS}) - set(NDOF_LIBRARIES ${SPACENAV_LIBRARIES}) - else() - set(WITH_INPUT_NDOF OFF) - endif() + find_package_wrapper(Spacenav) + if(SPACENAV_FOUND) + # use generic names within blenders buildsystem. + set(NDOF_INCLUDE_DIRS ${SPACENAV_INCLUDE_DIRS}) + set(NDOF_LIBRARIES ${SPACENAV_LIBRARIES}) + else() + set(WITH_INPUT_NDOF OFF) + endif() endif() if(WITH_CYCLES_OSL) - set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation") - if(NOT OSL_ROOT) - set(OSL_ROOT ${CYCLES_OSL}) - endif() - find_package_wrapper(OpenShadingLanguage) - if(OSL_FOUND) - if(${OSL_LIBRARY_VERSION_MAJOR} EQUAL "1" AND ${OSL_LIBRARY_VERSION_MINOR} LESS "6") - # Note: --whole-archive is needed to force loading of all symbols in liboslexec, - # otherwise LLVM is missing the osl_allocate_closure_component function - set(OSL_LIBRARIES - ${OSL_OSLCOMP_LIBRARY} - -Wl,--whole-archive ${OSL_OSLEXEC_LIBRARY} - -Wl,--no-whole-archive ${OSL_OSLQUERY_LIBRARY} - ) - endif() - else() - message(STATUS "OSL not found, disabling it from Cycles") - set(WITH_CYCLES_OSL OFF) - endif() + set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation") + if(NOT OSL_ROOT) + set(OSL_ROOT ${CYCLES_OSL}) + endif() + find_package_wrapper(OpenShadingLanguage) + if(OSL_FOUND) + if(${OSL_LIBRARY_VERSION_MAJOR} EQUAL "1" AND ${OSL_LIBRARY_VERSION_MINOR} LESS "6") + # Note: --whole-archive is needed to force loading of all symbols in liboslexec, + # otherwise LLVM is missing the osl_allocate_closure_component function + set(OSL_LIBRARIES + ${OSL_OSLCOMP_LIBRARY} + -Wl,--whole-archive ${OSL_OSLEXEC_LIBRARY} + -Wl,--no-whole-archive ${OSL_OSLQUERY_LIBRARY} + ) + endif() + else() + message(STATUS "OSL not found, disabling it from Cycles") + set(WITH_CYCLES_OSL OFF) + endif() endif() if(WITH_OPENVDB) - find_package_wrapper(OpenVDB) - find_package_wrapper(TBB) - find_package_wrapper(Blosc) - if(NOT TBB_FOUND) - set(WITH_OPENVDB OFF) - set(WITH_OPENVDB_BLOSC OFF) - message(STATUS "TBB not found, disabling OpenVDB") - elseif(NOT OPENVDB_FOUND) - set(WITH_OPENVDB OFF) - set(WITH_OPENVDB_BLOSC OFF) - message(STATUS "OpenVDB not found, disabling it") - elseif(NOT BLOSC_FOUND) - set(WITH_OPENVDB_BLOSC OFF) - message(STATUS "Blosc not found, disabling it for OpenVBD") - endif() + find_package_wrapper(OpenVDB) + find_package_wrapper(TBB) + find_package_wrapper(Blosc) + if(NOT TBB_FOUND) + set(WITH_OPENVDB OFF) + set(WITH_OPENVDB_BLOSC OFF) + message(STATUS "TBB not found, disabling OpenVDB") + elseif(NOT OPENVDB_FOUND) + set(WITH_OPENVDB OFF) + set(WITH_OPENVDB_BLOSC OFF) + message(STATUS "OpenVDB not found, disabling it") + elseif(NOT BLOSC_FOUND) + set(WITH_OPENVDB_BLOSC OFF) + message(STATUS "Blosc not found, disabling it for OpenVBD") + endif() endif() if(WITH_ALEMBIC) - find_package_wrapper(Alembic) + find_package_wrapper(Alembic) - if(WITH_ALEMBIC_HDF5) - set(HDF5_ROOT_DIR ${LIBDIR}/hdf5) - find_package_wrapper(HDF5) - endif() + if(WITH_ALEMBIC_HDF5) + set(HDF5_ROOT_DIR ${LIBDIR}/hdf5) + find_package_wrapper(HDF5) + endif() - if(NOT ALEMBIC_FOUND OR (WITH_ALEMBIC_HDF5 AND NOT HDF5_FOUND)) - set(WITH_ALEMBIC OFF) - set(WITH_ALEMBIC_HDF5 OFF) - endif() + if(NOT ALEMBIC_FOUND OR (WITH_ALEMBIC_HDF5 AND NOT HDF5_FOUND)) + set(WITH_ALEMBIC OFF) + set(WITH_ALEMBIC_HDF5 OFF) + endif() endif() if(WITH_BOOST) - # uses in build instructions to override include and library variables - if(NOT BOOST_CUSTOM) - if(WITH_STATIC_LIBS) - set(Boost_USE_STATIC_LIBS ON) - endif() - set(Boost_USE_MULTITHREADED ON) - set(__boost_packages filesystem regex thread date_time) - if(WITH_CYCLES_OSL) - if(NOT (${OSL_LIBRARY_VERSION_MAJOR} EQUAL "1" AND ${OSL_LIBRARY_VERSION_MINOR} LESS "6")) - list(APPEND __boost_packages wave) - else() - endif() - endif() - if(WITH_INTERNATIONAL) - list(APPEND __boost_packages locale) - endif() - if(WITH_CYCLES_NETWORK) - list(APPEND __boost_packages serialization) - endif() - if(WITH_OPENVDB) - list(APPEND __boost_packages iostreams) - endif() - list(APPEND __boost_packages system) - find_package(Boost 1.48 COMPONENTS ${__boost_packages}) - if(NOT Boost_FOUND) - # try to find non-multithreaded if -mt not found, this flag - # doesn't matter for us, it has nothing to do with thread - # safety, but keep it to not disturb build setups - set(Boost_USE_MULTITHREADED OFF) - find_package(Boost 1.48 COMPONENTS ${__boost_packages}) - endif() - unset(__boost_packages) - if(Boost_USE_STATIC_LIBS AND WITH_BOOST_ICU) - find_package(IcuLinux) - endif() - mark_as_advanced(Boost_DIR) # why doesn't boost do this? - endif() - - set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS}) - set(BOOST_LIBRARIES ${Boost_LIBRARIES}) - set(BOOST_LIBPATH ${Boost_LIBRARY_DIRS}) - set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB") + # uses in build instructions to override include and library variables + if(NOT BOOST_CUSTOM) + if(WITH_STATIC_LIBS) + set(Boost_USE_STATIC_LIBS ON) + endif() + set(Boost_USE_MULTITHREADED ON) + set(__boost_packages filesystem regex thread date_time) + if(WITH_CYCLES_OSL) + if(NOT (${OSL_LIBRARY_VERSION_MAJOR} EQUAL "1" AND ${OSL_LIBRARY_VERSION_MINOR} LESS "6")) + list(APPEND __boost_packages wave) + else() + endif() + endif() + if(WITH_INTERNATIONAL) + list(APPEND __boost_packages locale) + endif() + if(WITH_CYCLES_NETWORK) + list(APPEND __boost_packages serialization) + endif() + if(WITH_OPENVDB) + list(APPEND __boost_packages iostreams) + endif() + list(APPEND __boost_packages system) + find_package(Boost 1.48 COMPONENTS ${__boost_packages}) + if(NOT Boost_FOUND) + # try to find non-multithreaded if -mt not found, this flag + # doesn't matter for us, it has nothing to do with thread + # safety, but keep it to not disturb build setups + set(Boost_USE_MULTITHREADED OFF) + find_package(Boost 1.48 COMPONENTS ${__boost_packages}) + endif() + unset(__boost_packages) + if(Boost_USE_STATIC_LIBS AND WITH_BOOST_ICU) + find_package(IcuLinux) + endif() + mark_as_advanced(Boost_DIR) # why doesn't boost do this? + endif() + + set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS}) + set(BOOST_LIBRARIES ${Boost_LIBRARIES}) + set(BOOST_LIBPATH ${Boost_LIBRARY_DIRS}) + set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB") endif() if(WITH_OPENIMAGEIO) - find_package_wrapper(OpenImageIO) - if(NOT OPENIMAGEIO_PUGIXML_FOUND AND WITH_CYCLES_STANDALONE) - find_package_wrapper(PugiXML) - else() - set(PUGIXML_INCLUDE_DIR "${OPENIMAGEIO_INCLUDE_DIR/OpenImageIO}") - set(PUGIXML_LIBRARIES "") - endif() - - set(OPENIMAGEIO_LIBRARIES - ${OPENIMAGEIO_LIBRARIES} - ${PNG_LIBRARIES} - ${JPEG_LIBRARIES} - ${ZLIB_LIBRARIES} - ${BOOST_LIBRARIES} - ) - set(OPENIMAGEIO_LIBPATH) # TODO, remove and reference the absolute path everywhere - set(OPENIMAGEIO_DEFINITIONS "") - - if(WITH_IMAGE_TIFF) - list(APPEND OPENIMAGEIO_LIBRARIES "${TIFF_LIBRARY}") - endif() - if(WITH_IMAGE_OPENEXR) - list(APPEND OPENIMAGEIO_LIBRARIES "${OPENEXR_LIBRARIES}") - endif() - - if(NOT OPENIMAGEIO_FOUND) - set(WITH_OPENIMAGEIO OFF) - message(STATUS "OpenImageIO not found, disabling WITH_CYCLES") - endif() + find_package_wrapper(OpenImageIO) + if(NOT OPENIMAGEIO_PUGIXML_FOUND AND WITH_CYCLES_STANDALONE) + find_package_wrapper(PugiXML) + else() + set(PUGIXML_INCLUDE_DIR "${OPENIMAGEIO_INCLUDE_DIR/OpenImageIO}") + set(PUGIXML_LIBRARIES "") + endif() + + set(OPENIMAGEIO_LIBRARIES + ${OPENIMAGEIO_LIBRARIES} + ${PNG_LIBRARIES} + ${JPEG_LIBRARIES} + ${ZLIB_LIBRARIES} + ${BOOST_LIBRARIES} + ) + set(OPENIMAGEIO_LIBPATH) # TODO, remove and reference the absolute path everywhere + set(OPENIMAGEIO_DEFINITIONS "") + + if(WITH_IMAGE_TIFF) + list(APPEND OPENIMAGEIO_LIBRARIES "${TIFF_LIBRARY}") + endif() + if(WITH_IMAGE_OPENEXR) + list(APPEND OPENIMAGEIO_LIBRARIES "${OPENEXR_LIBRARIES}") + endif() + + if(NOT OPENIMAGEIO_FOUND) + set(WITH_OPENIMAGEIO OFF) + message(STATUS "OpenImageIO not found, disabling WITH_CYCLES") + endif() endif() if(WITH_OPENCOLORIO) - find_package_wrapper(OpenColorIO) + find_package_wrapper(OpenColorIO) - set(OPENCOLORIO_LIBRARIES ${OPENCOLORIO_LIBRARIES}) - set(OPENCOLORIO_LIBPATH) # TODO, remove and reference the absolute path everywhere - set(OPENCOLORIO_DEFINITIONS) + set(OPENCOLORIO_LIBRARIES ${OPENCOLORIO_LIBRARIES}) + set(OPENCOLORIO_LIBPATH) # TODO, remove and reference the absolute path everywhere + set(OPENCOLORIO_DEFINITIONS) - if(NOT OPENCOLORIO_FOUND) - set(WITH_OPENCOLORIO OFF) - message(STATUS "OpenColorIO not found") - endif() + if(NOT OPENCOLORIO_FOUND) + set(WITH_OPENCOLORIO OFF) + message(STATUS "OpenColorIO not found") + endif() endif() if(WITH_CYCLES_EMBREE) - find_package(Embree 3.2.4 REQUIRED) + find_package(Embree 3.2.4 REQUIRED) endif() if(WITH_LLVM) - if(EXISTS ${LIBDIR}) - set(LLVM_STATIC ON) - endif() + if(EXISTS ${LIBDIR}) + set(LLVM_STATIC ON) + endif() - find_package_wrapper(LLVM) + find_package_wrapper(LLVM) - # Symbol conflicts with same UTF library used by OpenCollada - if(EXISTS ${LIBDIR}) - if(WITH_OPENCOLLADA AND (${LLVM_VERSION} VERSION_LESS "4.0.0")) - list(REMOVE_ITEM OPENCOLLADA_LIBRARIES ${OPENCOLLADA_UTF_LIBRARY}) - endif() - endif() + # Symbol conflicts with same UTF library used by OpenCollada + if(EXISTS ${LIBDIR}) + if(WITH_OPENCOLLADA AND (${LLVM_VERSION} VERSION_LESS "4.0.0")) + list(REMOVE_ITEM OPENCOLLADA_LIBRARIES ${OPENCOLLADA_UTF_LIBRARY}) + endif() + endif() - if(NOT LLVM_FOUND) - set(WITH_LLVM OFF) - message(STATUS "LLVM not found") - endif() + if(NOT LLVM_FOUND) + set(WITH_LLVM OFF) + message(STATUS "LLVM not found") + endif() endif() if(WITH_LLVM OR WITH_SDL_DYNLOAD) - # Fix for conflict with Mesa llvmpipe - set(PLATFORM_LINKFLAGS - "${PLATFORM_LINKFLAGS} -Wl,--version-script='${CMAKE_SOURCE_DIR}/source/creator/blender.map'" - ) + # Fix for conflict with Mesa llvmpipe + set(PLATFORM_LINKFLAGS + "${PLATFORM_LINKFLAGS} -Wl,--version-script='${CMAKE_SOURCE_DIR}/source/creator/blender.map'" + ) endif() if(WITH_OPENSUBDIV) - find_package_wrapper(OpenSubdiv) + find_package_wrapper(OpenSubdiv) - set(OPENSUBDIV_LIBRARIES ${OPENSUBDIV_LIBRARIES}) - set(OPENSUBDIV_LIBPATH) # TODO, remove and reference the absolute path everywhere + set(OPENSUBDIV_LIBRARIES ${OPENSUBDIV_LIBRARIES}) + set(OPENSUBDIV_LIBPATH) # TODO, remove and reference the absolute path everywhere - if(NOT OPENSUBDIV_FOUND) - set(WITH_OPENSUBDIV OFF) - message(STATUS "OpenSubdiv not found") - endif() + if(NOT OPENSUBDIV_FOUND) + set(WITH_OPENSUBDIV OFF) + message(STATUS "OpenSubdiv not found") + endif() endif() # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed if(HAIKU) - list(APPEND PLATFORM_LINKLIBS -lnetwork) + list(APPEND PLATFORM_LINKLIBS -lnetwork) else() - list(APPEND PLATFORM_LINKLIBS -lutil -lc -lm) + list(APPEND PLATFORM_LINKLIBS -lutil -lc -lm) endif() find_package(Threads REQUIRED) @@ -420,15 +420,15 @@ list(APPEND PLATFORM_LINKLIBS ${CMAKE_THREAD_LIBS_INIT}) set(PTHREADS_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) if(CMAKE_DL_LIBS) - list(APPEND PLATFORM_LINKLIBS ${CMAKE_DL_LIBS}) + list(APPEND PLATFORM_LINKLIBS ${CMAKE_DL_LIBS}) endif() if(CMAKE_SYSTEM_NAME MATCHES "Linux") - if(NOT WITH_PYTHON_MODULE) - # binreloc is linux only - set(BINRELOC_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/binreloc/include) - set(WITH_BINRELOC ON) - endif() + if(NOT WITH_PYTHON_MODULE) + # binreloc is linux only + set(BINRELOC_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/binreloc/include) + set(WITH_BINRELOC ON) + endif() endif() # lfs on glibc, all compilers should use @@ -436,43 +436,43 @@ add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE # GNU Compiler if(CMAKE_COMPILER_IS_GNUCC) - set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing") - - if(WITH_LINKER_GOLD) - execute_process( - COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version - ERROR_QUIET OUTPUT_VARIABLE LD_VERSION) - if("${LD_VERSION}" MATCHES "GNU gold") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold") - else() - message(STATUS "GNU gold linker isn't available, using the default system linker.") - endif() - unset(LD_VERSION) - endif() + set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing") + + if(WITH_LINKER_GOLD) + execute_process( + COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version + ERROR_QUIET OUTPUT_VARIABLE LD_VERSION) + if("${LD_VERSION}" MATCHES "GNU gold") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold") + else() + message(STATUS "GNU gold linker isn't available, using the default system linker.") + endif() + unset(LD_VERSION) + endif() # CLang is the same as GCC for now. elseif(CMAKE_C_COMPILER_ID MATCHES "Clang") - set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing") + set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing") # Intel C++ Compiler elseif(CMAKE_C_COMPILER_ID MATCHES "Intel") - # think these next two are broken - find_program(XIAR xiar) - if(XIAR) - set(CMAKE_AR "${XIAR}") - endif() - mark_as_advanced(XIAR) - - find_program(XILD xild) - if(XILD) - set(CMAKE_LINKER "${XILD}") - endif() - mark_as_advanced(XILD) - - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fp-model precise -prec_div -parallel") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fp-model precise -prec_div -parallel") - - # set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -diag-enable sc3") - set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing") - set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -static-intel") + # think these next two are broken + find_program(XIAR xiar) + if(XIAR) + set(CMAKE_AR "${XIAR}") + endif() + mark_as_advanced(XIAR) + + find_program(XILD xild) + if(XILD) + set(CMAKE_LINKER "${XILD}") + endif() + mark_as_advanced(XILD) + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fp-model precise -prec_div -parallel") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fp-model precise -prec_div -parallel") + + # set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -diag-enable sc3") + set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing") + set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -static-intel") endif() |