diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0a7245e1..c9b8470cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,7 @@ jobs: openimageio_ver: v2.4.13.0 python_ver: 2.7 pybind11_ver: v2.4.2 + setenvs: export CMAKE_VERSION=3.15.5 - desc: clang9/C++14 llvm9 oiio-release boost1.66 avx2 exr2.3 py2.7 nametag: linux-clang9-llvm9 os: ubuntu-20.04 @@ -57,6 +58,7 @@ jobs: python_ver: 2.7 # pybind11_ver: v2.9.0 simd: avx + setenvs: export CMAKE_VERSION=3.15.5 - desc: gcc6/C++14 llvm10 py3.7 boost1.70 exr2.4 oiio2.2 sse4 nametag: linux-vfx2020 os: ubuntu-latest @@ -169,6 +171,7 @@ jobs: pybind11_ver: v2.6.2 simd: 0 setenvs: export PUGIXML_VERSION=v1.8 + CMAKE_VERSION=3.15.5 # Address and leak sanitizers - desc: sanitizers diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e70a7d5d..3e8c00c69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # SPDX-License-Identifier: BSD-3-Clause # https://github.com/AcademySoftwareFoundation/OpenShadingLanguage -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.15) set (OSL_VERSION "1.13.5.0") set (OSL_VERSION_OVERRIDE "" CACHE STRING diff --git a/INSTALL.md b/INSTALL.md index aefc02ecc..879eb2cd4 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -12,7 +12,7 @@ Dependencies OSL requires the following dependencies or tools. NEW or CHANGED dependencies since the last major release are **bold**. -* Build system: [CMake](https://cmake.org/) 3.12 or newer (tested through 3.26) +* Build system: [CMake](https://cmake.org/) **3.15 or newer** (tested through 3.27) * A suitable C++14 or C++17 compiler to build OSL itself, which may be any of: - GCC 6.1 or newer (tested through gcc 12.1) @@ -92,9 +92,16 @@ Here are the steps to check out, build, and test the OSL distribution: options, and note that 'make nuke' will blow everything away for the freshest possible compile. - NOTE: If the build breaks due to compiler warnings which have been - elevated to errors, you can try "make clean" followed by - "make STOP_ON_WARNING=0", that create a build that will only stop for + You can also ignore the top level Makefile wrapper, and instead use + CMake directly: + + cmake -B build -S . + cmake --build build --target install + + NOTE: If the build breaks due to compiler warnings which have been elevated + to errors, you can try "make clean" followed by "make STOP_ON_WARNING=0", + or if using cmake directly, add `-DSTOP_ON_WARNING=0` to the cmake + configuration command. That will create a build that will only stop for full errors, not warnings. 4. After compilation, you'll end up with a full OSL distribution in diff --git a/src/build-scripts/build_cmake.bash b/src/build-scripts/build_cmake.bash index f4460d515..8db9429dd 100755 --- a/src/build-scripts/build_cmake.bash +++ b/src/build-scripts/build_cmake.bash @@ -12,7 +12,7 @@ set -ex echo "Building cmake" uname -CMAKE_VERSION=${CMAKE_VERSION:=3.12.4} +CMAKE_VERSION=${CMAKE_VERSION:=3.18.5} LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext} CMAKE_INSTALL_DIR=${CMAKE_INSTALL_DIR:=${LOCAL_DEPS_DIR}/cmake} diff --git a/src/build-scripts/build_opencolorio.bash b/src/build-scripts/build_opencolorio.bash index 720cf325e..77a18e2d3 100755 --- a/src/build-scripts/build_opencolorio.bash +++ b/src/build-scripts/build_opencolorio.bash @@ -11,13 +11,14 @@ set -ex # Which OCIO to retrieve, how to build it OPENCOLORIO_REPO=${OPENCOLORIO_REPO:=https://github.com/AcademySoftwareFoundation/OpenColorIO.git} -OPENCOLORIO_VERSION=${OPENCOLORIO_VERSION:=v1.1.1} +OPENCOLORIO_VERSION=${OPENCOLORIO_VERSION:=v2.2.1} # Where to install the final results LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext} OPENCOLORIO_SOURCE_DIR=${OPENCOLORIO_SOURCE_DIR:=${LOCAL_DEPS_DIR}/OpenColorIO} OPENCOLORIO_BUILD_DIR=${OPENCOLORIO_BUILD_DIR:=${LOCAL_DEPS_DIR}/OpenColorIO-build} OPENCOLORIO_INSTALL_DIR=${OPENCOLORIO_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist} +OPENCOLORIO_BUILD_TYPE=${OPENCOLORIO_BUILD_TYPE:=Release} OPENCOLORIO_CXX_FLAGS=${OPENCOLORIO_CXX_FLAGS:="-Wno-unused-function -Wno-deprecated-declarations -Wno-cast-qual -Wno-write-strings"} # Just need libs: OPENCOLORIO_BUILDOPTS="-DOCIO_BUILD_APPS=OFF -DOCIO_BUILD_NUKE=OFF \ @@ -42,13 +43,12 @@ cd ${OPENCOLORIO_SOURCE_DIR} echo "git checkout ${OPENCOLORIO_VERSION} --force" git checkout ${OPENCOLORIO_VERSION} --force -mkdir -p ${OPENCOLORIO_BUILD_DIR} -cd ${OPENCOLORIO_BUILD_DIR} -time cmake -DCMAKE_BUILD_TYPE=Release \ +time cmake -S . -B ${OPENCOLORIO_BUILD_DIR} \ + -DCMAKE_BUILD_TYPE=${OPENCOLORIO_BUILD_TYPE} \ -DCMAKE_INSTALL_PREFIX=${OPENCOLORIO_INSTALL_DIR} \ -DCMAKE_CXX_FLAGS="${OPENCOLORIO_CXX_FLAGS}" \ - ${OPENCOLORIO_BUILDOPTS} ${OPENCOLORIO_SOURCE_DIR} -time cmake --build . --config Release --target install + ${OPENCOLORIO_BUILDOPTS} +time cmake --build ${OPENCOLORIO_BUILD_DIR} --config Release --target install popd # ls -R ${OPENCOLORIO_INSTALL_DIR} diff --git a/src/build-scripts/build_openexr.bash b/src/build-scripts/build_openexr.bash index c0b9457e2..672f1940d 100755 --- a/src/build-scripts/build_openexr.bash +++ b/src/build-scripts/build_openexr.bash @@ -44,8 +44,8 @@ git checkout ${OPENEXR_VERSION} --force if [[ ${OPENEXR_VERSION} == "v2.3.0" ]] ; then # Simplified setup for 2.3+ - cd ${OPENEXR_BUILD_DIR} - cmake -DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} \ + cmake -S . -B ${OPENEXR_BUILD_DIR} \ + -DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} \ -DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \ -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \ -DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \ @@ -54,11 +54,11 @@ if [[ ${OPENEXR_VERSION} == "v2.3.0" ]] ; then -DOPENEXR_BUILD_PYTHON_LIBS=0 \ -DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \ ${OPENEXR_CMAKE_FLAGS} ${OPENEXR_SOURCE_DIR} - time cmake --build . --target install --config ${OPENEXR_BUILD_TYPE} + time cmake --build ${OPENEXR_BUILD_DIR} --target install --config ${OPENEXR_BUILD_TYPE} else # Simplified setup for 2.4+ - cd ${OPENEXR_BUILD_DIR} - cmake -DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} \ + cmake -S . -B ${OPENEXR_BUILD_DIR} \ + -DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} \ -DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \ -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \ -DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \ @@ -71,7 +71,7 @@ else -DCMAKE_INSTALL_LIBDIR=lib \ -DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \ ${OPENEXR_CMAKE_FLAGS} ${OPENEXR_SOURCE_DIR} - time cmake --build . --target install --config ${OPENEXR_BUILD_TYPE} + time cmake --build ${OPENEXR_BUILD_DIR} --target install --config ${OPENEXR_BUILD_TYPE} fi popd diff --git a/src/build-scripts/build_pugixml.bash b/src/build-scripts/build_pugixml.bash index 9cf64699c..0bf7c206d 100755 --- a/src/build-scripts/build_pugixml.bash +++ b/src/build-scripts/build_pugixml.bash @@ -11,7 +11,7 @@ set -ex # Repo and branch/tag/commit of pugixml to download if we don't have it yet PUGIXML_REPO=${PUGIXML_REPO:=https://github.com/zeux/pugixml.git} -PUGIXML_VERSION=${PUGIXML_VERSION:=v1.10} +PUGIXML_VERSION=${PUGIXML_VERSION:=v1.11.4} # Where to put pugixml repo source (default to the ext area) PUGIXML_SRC_DIR=${PUGIXML_SRC_DIR:=${PWD}/ext/pugixml} @@ -34,17 +34,18 @@ if [[ ! -e ${PUGIXML_SRC_DIR} ]] ; then git clone ${PUGIXML_REPO} ${PUGIXML_SRC_DIR} fi cd ${PUGIXML_SRC_DIR} + echo "git checkout ${PUGIXML_VERSION} --force" git checkout ${PUGIXML_VERSION} --force -mkdir -p ${PUGIXML_BUILD_DIR} -cd ${PUGIXML_BUILD_DIR} -time cmake -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=${PUGIXML_INSTALL_DIR} \ - -DBUILD_SHARED_LIBS=ON \ - -DBUILD_TESTS=OFF \ - ${PUGIXML_BUILD_OPTS} .. -time cmake --build . --config Release --target install +if [[ -z $DEP_DOWNLOAD_ONLY ]]; then + time cmake -S . -B ${PUGIXML_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${PUGIXML_INSTALL_DIR} \ + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_TESTS=OFF \ + ${PUGIXML_BUILD_OPTS} .. + time cmake --build ${PUGIXML_BUILD_DIR} --config Release --target install +fi # ls -R ${PUGIXML_INSTALL_DIR} popd diff --git a/src/build-scripts/build_pybind11.bash b/src/build-scripts/build_pybind11.bash index 5b5bb85d6..d7b45c96d 100755 --- a/src/build-scripts/build_pybind11.bash +++ b/src/build-scripts/build_pybind11.bash @@ -42,15 +42,12 @@ cd ${PYBIND11_SRC_DIR} echo "git checkout ${PYBIND11_VERSION} --force" git checkout ${PYBIND11_VERSION} --force -mkdir -p ${PYBIND11_BUILD_DIR} -cd ${PYBIND11_BUILD_DIR} - if [[ -z $DEP_DOWNLOAD_ONLY ]]; then - time cmake -DCMAKE_BUILD_TYPE=Release \ + time cmake -S . -B ${PYBIND11_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=${PYBIND11_INSTALL_DIR} \ -DPYBIND11_TEST=OFF \ - ${PYBIND11_BUILD_OPTS} .. - time cmake --build . --config Release --target install + ${PYBIND11_BUILD_OPTS} + time cmake --build ${PYBIND11_BUILD_DIR} --config Release --target install fi # ls -R ${PYBIND11_INSTALL_DIR} diff --git a/src/build-scripts/gh-installdeps.bash b/src/build-scripts/gh-installdeps.bash index 3fda71c99..4ab5e9dab 100755 --- a/src/build-scripts/gh-installdeps.bash +++ b/src/build-scripts/gh-installdeps.bash @@ -126,6 +126,10 @@ else source src/build-scripts/build_llvm.bash fi +if [[ "$CMAKE_VERSION" != "" ]] ; then + source src/build-scripts/build_cmake.bash +fi +cmake --version if [[ "$OPTIX_VERSION" != "" ]] ; then @@ -147,11 +151,10 @@ if [[ "$OPTIX_VERSION" != "" ]] ; then fi -if [[ "$CMAKE_VERSION" != "" ]] ; then - source src/build-scripts/build_cmake.bash -fi -cmake --version +# +# Packages we need to build from scratch. +# source src/build-scripts/build_pybind11.bash diff --git a/src/cmake/compiler.cmake b/src/cmake/compiler.cmake index b02b2a591..a90730484 100644 --- a/src/cmake/compiler.cmake +++ b/src/cmake/compiler.cmake @@ -15,13 +15,11 @@ ########################################################################### # Print some basic status about the system and compiler # -if (VERBOSE) - message (STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}") - message (STATUS "CMAKE_SYSTEM_VERSION = ${CMAKE_SYSTEM_VERSION}") - message (STATUS "CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}") -endif () -message (STATUS "CMAKE_CXX_COMPILER = ${CMAKE_CXX_COMPILER}") -message (STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}") +message (VERBOSE "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}") +message (VERBOSE "CMAKE_SYSTEM_VERSION = ${CMAKE_SYSTEM_VERSION}") +message (VERBOSE "CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}") +message (STATUS "CMAKE_CXX_COMPILER = ${CMAKE_CXX_COMPILER}") +message (STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}") ########################################################################### @@ -44,9 +42,7 @@ if (CMAKE_COMPILER_IS_GNUCC) execute_process (COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) - if (VERBOSE) - message (STATUS "Using gcc ${GCC_VERSION} as the compiler") - endif () + message (VERBOSE "Using gcc ${GCC_VERSION} as the compiler") else () set (GCC_VERSION 0) endif () @@ -63,26 +59,18 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER MATCHES "[Cc]lan set (CMAKE_CXX_COMPILER_ID "AppleClang") set (CMAKE_COMPILER_IS_APPLECLANG 1) string (REGEX REPLACE ".* version ([0-9]+\\.[0-9]+).*" "\\1" APPLECLANG_VERSION_STRING ${clang_full_version_string}) - if (VERBOSE) - message (STATUS "The compiler is Clang: ${CMAKE_CXX_COMPILER_ID} version ${APPLECLANG_VERSION_STRING}") - endif () + message (VERBOSE "The compiler is Clang: ${CMAKE_CXX_COMPILER_ID} version ${APPLECLANG_VERSION_STRING}") elseif (CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM") set (CMAKE_COMPILER_IS_INTELCLANG 1) string (REGEX MATCH "[0-9]+(\\.[0-9]+)+" INTELCLANG_VERSION_STRING ${clang_full_version_string}) - if (VERBOSE) - message (STATUS "The compiler is Intel Clang: ${CMAKE_CXX_COMPILER_ID} version ${INTELCLANG_VERSION_STRING}") - endif () + message (VERBOSE "The compiler is Intel Clang: ${CMAKE_CXX_COMPILER_ID} version ${INTELCLANG_VERSION_STRING}") else () string (REGEX REPLACE ".* version ([0-9]+\\.[0-9]+).*" "\\1" CLANG_VERSION_STRING ${clang_full_version_string}) - if (VERBOSE) - message (STATUS "The compiler is Clang: ${CMAKE_CXX_COMPILER_ID} version ${CLANG_VERSION_STRING}") - endif () + message (VERBOSE "The compiler is Clang: ${CMAKE_CXX_COMPILER_ID} version ${CLANG_VERSION_STRING}") endif () elseif (CMAKE_CXX_COMPILER_ID MATCHES "Intel") set (CMAKE_COMPILER_IS_INTEL 1) - if (VERBOSE) - message (STATUS "Using Intel as the compiler") - endif () + message (VERBOSE "Using Intel as the compiler") endif () @@ -314,9 +302,7 @@ if (NOT USE_SIMD STREQUAL "") else () string (REPLACE "," ";" SIMD_FEATURE_LIST ${USE_SIMD}) foreach (feature ${SIMD_FEATURE_LIST}) - if (VERBOSE) - message (STATUS "SIMD feature: ${feature}") - endif () + message (VERBOSE "SIMD feature: ${feature}") if (MSVC OR CMAKE_COMPILER_IS_INTEL) set (SIMD_COMPILE_FLAGS ${SIMD_COMPILE_FLAGS} "/arch:${feature}") else () @@ -423,7 +409,7 @@ if (CLANG_TIDY) find_program(CLANG_TIDY_EXE NAMES "clang-tidy" DOC "Path to clang-tidy executable") message (STATUS "CLANG_TIDY_EXE ${CLANG_TIDY_EXE}") - if (CLANG_TIDY_EXE AND NOT ${CMAKE_VERSION} VERSION_LESS 3.6) + if (CLANG_TIDY_EXE) set (CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}" ) @@ -525,9 +511,7 @@ else () set (SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} CACHE STRING "Set the SO version for dynamic libraries") endif () -if (VERBOSE) - message(STATUS "Setting SOVERSION to: ${SOVERSION}") -endif () +message(VERBOSE "Setting SOVERSION to: ${SOVERSION}") ########################################################################### @@ -589,9 +573,7 @@ else () # add the automatically determined parts of the RPATH that # point to directories outside the build tree to the install RPATH set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - if (VERBOSE) - message (STATUS "CMAKE_INSTALL_RPATH = ${CMAKE_INSTALL_RPATH}") - endif () + message (VERBOSE "CMAKE_INSTALL_RPATH = ${CMAKE_INSTALL_RPATH}") endif () # OSL considerations because we run oslc in the course of building: # Use (i.e. don't skip) the full RPATH for the build tree diff --git a/src/cmake/cuda_macros.cmake b/src/cmake/cuda_macros.cmake index 40df534e6..d9f5b49e3 100644 --- a/src/cmake/cuda_macros.cmake +++ b/src/cmake/cuda_macros.cmake @@ -69,9 +69,7 @@ function ( MAKE_CUDA_BITCODE src suffix generated_bc extra_clang_args ) # Setup the compile flags get_property (CURRENT_DEFINITIONS DIRECTORY PROPERTY COMPILE_DEFINITIONS) - if (VERBOSE) - message (STATUS "Current #defines are ${CURRENT_DEFINITIONS}") - endif () + message (VERBOSE "Current #defines are ${CURRENT_DEFINITIONS}") foreach (def ${CURRENT_DEFINITIONS}) set (LLVM_COMPILE_FLAGS ${LLVM_COMPILE_FLAGS} "-D${def}") endforeach() @@ -90,9 +88,7 @@ function ( MAKE_CUDA_BITCODE src suffix generated_bc extra_clang_args ) if (NOT LLVM_BC_GENERATOR) message (FATAL_ERROR "You must have a valid llvm bitcode generator (clang++) somewhere.") endif () - if (VERBOSE) - message (STATUS "Using LLVM_BC_GENERATOR ${LLVM_BC_GENERATOR} to generate bitcode.") - endif() + message (VERBOSE "Using LLVM_BC_GENERATOR ${LLVM_BC_GENERATOR} to generate bitcode.") if (NOT LLVM_AS_TOOL) find_program (LLVM_AS_TOOL NAMES "llvm-as" diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake index ce47f2753..5d9261408 100644 --- a/src/cmake/externalpackages.cmake +++ b/src/cmake/externalpackages.cmake @@ -53,7 +53,9 @@ else () # cmake output (e.g. boost 1.70.0, cmake <= 3.14). Specifically it fails # to set the expected variables printed below. So until that's fixed # force FindBoost.cmake to use the original brute force path. - set (Boost_NO_BOOST_CMAKE ON) + if (NOT DEFINED Boost_NO_BOOST_CMAKE) + set (Boost_NO_BOOST_CMAKE ON) + endif () checked_find_package (Boost REQUIRED VERSION_MIN 1.55 COMPONENTS ${Boost_COMPONENTS} diff --git a/src/cmake/flexbison.cmake b/src/cmake/flexbison.cmake index 307f2acbd..9959cfa58 100644 --- a/src/cmake/flexbison.cmake +++ b/src/cmake/flexbison.cmake @@ -38,9 +38,7 @@ if ( FLEX_EXECUTABLE AND BISON_EXECUTABLE ) # XXX: This may be excessive now that OSL::pvt::ExtraArg is mangled into the function signature add_definitions(-D${prefix}parse=${PROJ_NAMESPACE_V}_${prefix}parse) - if (VERBOSE) - message (STATUS "FLEX_BISON flex=${flexsrc} bison=${bisonsrc} prefix=${prefix}") - endif () + message (VERBOSE "FLEX_BISON flex=${flexsrc} bison=${bisonsrc} prefix=${prefix}") get_filename_component ( bisonsrc_we ${bisonsrc} NAME_WE ) set ( bisonoutputcxx "${CMAKE_CURRENT_BINARY_DIR}/${bisonsrc_we}.cpp" ) set ( bisonoutputh "${CMAKE_CURRENT_BINARY_DIR}/${bisonsrc_we}.h" ) @@ -54,9 +52,7 @@ if ( FLEX_EXECUTABLE AND BISON_EXECUTABLE ) get_filename_component ( FLEX_UP ${FLEX_EXECUTABLE} PATH ) get_filename_component ( FLEX_UP_UP ${FLEX_UP} PATH ) set ( FLEX_INCLUDE_DIR "${FLEX_UP_UP}/include" ) - if (VERBOSE) - message (STATUS "Flex include dir = ${FLEX_INCLUDE_DIR}") - endif () + message (VERBOSE "Flex include dir = ${FLEX_INCLUDE_DIR}") include_directories ( ${FLEX_INCLUDE_DIR} ) # include_directories ( ${CMAKE_CURRENT_BINARY_DIR} ) diff --git a/src/cmake/llvm_macros.cmake b/src/cmake/llvm_macros.cmake index efed73117..fc7819018 100644 --- a/src/cmake/llvm_macros.cmake +++ b/src/cmake/llvm_macros.cmake @@ -7,25 +7,19 @@ set(_THIS_MODULE_BASE_DIR "${CMAKE_CURRENT_LIST_DIR}") function ( EMBED_LLVM_BITCODE_IN_CPP src_list suffix output_name list_to_append_cpp extra_clang_args include_dirs) - if (VERBOSE) - message (STATUS "EMBED_LLVM_BITCODE_IN_CPP src_list=${src_list}") - endif () + message (VERBOSE "EMBED_LLVM_BITCODE_IN_CPP src_list=${src_list}") foreach ( src ${src_list} ) get_filename_component ( src_we ${src} NAME_WE ) set ( src_asm "${CMAKE_CURRENT_BINARY_DIR}/${src_we}${suffix}.s" ) set ( src_bc "${CMAKE_CURRENT_BINARY_DIR}/${src_we}${suffix}.bc" ) - if (VERBOSE) - message (STATUS "EMBED_LLVM_BITCODE_IN_CPP in=${src}") - message (STATUS "EMBED_LLVM_BITCODE_IN_CPP asm=${src_asm}") - message (STATUS "EMBED_LLVM_BITCODE_IN_CPP bc=${src_bc}") - endif () + message (VERBOSE "EMBED_LLVM_BITCODE_IN_CPP in=${src}") + message (VERBOSE "EMBED_LLVM_BITCODE_IN_CPP asm=${src_asm}") + message (VERBOSE "EMBED_LLVM_BITCODE_IN_CPP bc=${src_bc}") list ( APPEND src_bc_list ${src_bc} ) get_property (CURRENT_DEFINITIONS DIRECTORY PROPERTY COMPILE_DEFINITIONS) - if (VERBOSE) - message (STATUS "Current #defines are ${CURRENT_DEFINITIONS}") - endif () + message (VERBOSE "Current #defines are ${CURRENT_DEFINITIONS}") foreach (def ${CURRENT_DEFINITIONS}) set (LLVM_COMPILE_FLAGS ${LLVM_COMPILE_FLAGS} "-D${def}") endforeach() @@ -44,9 +38,7 @@ function ( EMBED_LLVM_BITCODE_IN_CPP src_list suffix output_name list_to_append_ if (NOT LLVM_BC_GENERATOR) message (FATAL_ERROR "You must have a valid llvm bitcode generator (clang++) somewhere.") endif () - if (VERBOSE) - message (STATUS "Using LLVM_BC_GENERATOR ${LLVM_BC_GENERATOR} to generate bitcode.") - endif() + message (VERBOSE "Using LLVM_BC_GENERATOR ${LLVM_BC_GENERATOR} to generate bitcode.") if (NOT LLVM_AS_TOOL) find_program (LLVM_AS_TOOL NAMES "llvm-as" @@ -106,12 +98,9 @@ function ( EMBED_LLVM_BITCODE_IN_CPP src_list suffix output_name list_to_append_ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" ) endforeach () - - if (VERBOSE) - message ( STATUS "^^^^^^^^^^^^^^^^^^^^^^^^^^" ) - message ( STATUS "src_bc_list: ${src_bc_list} ") - message ( STATUS "^^^^^^^^^^^^^^^^^^^^^^^^^^" ) - endif() + message (VERBOSE "^^^^^^^^^^^^^^^^^^^^^^^^^^" ) + message (VERBOSE "src_bc_list: ${src_bc_list} ") + message (VERBOSE "^^^^^^^^^^^^^^^^^^^^^^^^^^" ) # Link all of the individual LLVM bitcode files set ( linked_src_bc "${CMAKE_CURRENT_BINARY_DIR}/${output_name}.bc" ) diff --git a/src/cmake/modules/Findpartio.cmake b/src/cmake/modules/Findpartio.cmake index 1d42c5039..c53cfe743 100644 --- a/src/cmake/modules/Findpartio.cmake +++ b/src/cmake/modules/Findpartio.cmake @@ -13,13 +13,9 @@ # Hack! prefer a config if it can be found find_package(partio CONFIG) if (PARTIO_FOUND OR partio_FOUND) - if (VERBOSE) - message (STATUS "partio found via config") - endif () + message (VERBOSE "partio found via config") else () - if (VERBOSE) - message (STATUS "partio falling back to FindPartio.cmake") - endif () + message (VERBOSE "partio falling back to FindPartio.cmake") find_path (PARTIO_INCLUDE_DIR NAMES Partio.h) diff --git a/src/cmake/modules/Findpugixml.cmake b/src/cmake/modules/Findpugixml.cmake index ff047fd61..418a8c9db 100644 --- a/src/cmake/modules/Findpugixml.cmake +++ b/src/cmake/modules/Findpugixml.cmake @@ -16,7 +16,7 @@ find_package (pugixml CONFIG) if (TARGET pugixml::pugixml) # New pugixml (>= 1.11) has nice config files we can rely on and makes a # pugixml::pugixml target. - message (STATUS "Found CONFIG for pugixml (>=1.11)") + message (VERBOSE "Found CONFIG for pugixml (>=1.11)") set (PUGIXML_FOUND true) set (pugixml_FOUND true) diff --git a/src/cmake/pythonutils.cmake b/src/cmake/pythonutils.cmake index c41fedfe0..7bbf1fc72 100644 --- a/src/cmake/pythonutils.cmake +++ b/src/cmake/pythonutils.cmake @@ -43,11 +43,9 @@ macro (find_python) if (NOT DEFINED PYTHON_SITE_DIR) set (PYTHON_SITE_DIR "${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_FOUND}/site-packages") endif () - if (VERBOSE) - message (STATUS " Python site packages dir ${PYTHON_SITE_DIR}") - message (STATUS " Python to include 'lib' prefix: ${PYLIB_LIB_PREFIX}") - message (STATUS " Python to include SO version: ${PYLIB_INCLUDE_SONAME}") - endif () + message (VERBOSE " Python site packages dir ${PYTHON_SITE_DIR}") + message (VERBOSE " Python to include 'lib' prefix: ${PYLIB_LIB_PREFIX}") + message (VERBOSE " Python to include SO version: ${PYLIB_INCLUDE_SONAME}") endmacro() @@ -95,9 +93,7 @@ macro (setup_python_module) endif () if (PYLIB_INCLUDE_SONAME) - if (VERBOSE) - message(STATUS "Setting Py${lib_MODULE} SOVERSION to: ${SOVERSION}") - endif () + message(VERBOSE "Setting Py${lib_MODULE} SOVERSION to: ${SOVERSION}") set_target_properties(${target_name} PROPERTIES VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} SOVERSION ${SOVERSION} ) diff --git a/src/cmake/testing.cmake b/src/cmake/testing.cmake index 17fd656fb..cce492e1d 100644 --- a/src/cmake/testing.cmake +++ b/src/cmake/testing.cmake @@ -236,9 +236,7 @@ macro ( TESTSUITE ) endif () endforeach () - if (VERBOSE) - message (STATUS "Added tests: ${ALL_TEST_LIST}") - endif () + message (VERBOSE "Added tests: ${ALL_TEST_LIST}") endmacro () macro (osl_add_all_tests) diff --git a/src/doc/CMakeLists.txt b/src/doc/CMakeLists.txt index 34db56ee6..79ea309b8 100644 --- a/src/doc/CMakeLists.txt +++ b/src/doc/CMakeLists.txt @@ -38,9 +38,7 @@ macro (docdeep_generate) # ^^ syntax: prefix options one-arg-keywords multi-arg-keywords args set (oslfile ${_docdeep_SOURCE}) set (mdfile "${_docdeep_NAME}.md.html") - if (VERBOSE) - message (STATUS "docdeep will make '${mdfile}'") - endif () + message (VERBOSE "docdeep will make '${mdfile}'") set (docdeep_program ${CMAKE_SOURCE_DIR}/src/build-scripts/docdeep.py) add_custom_command (OUTPUT ${mdfile} COMMAND ${Python_EXECUTABLE} ${docdeep_program} -d ${_docdeep_NAME} -s docs.css diff --git a/src/include/CMakeLists.txt b/src/include/CMakeLists.txt index 503bfa4b4..f9e51c6a6 100644 --- a/src/include/CMakeLists.txt +++ b/src/include/CMakeLists.txt @@ -28,16 +28,12 @@ endif() set (versionfile oslversion.h) -if (VERBOSE) - message (STATUS "Create ${versionfile} from ${versionfile}.in") -endif () +message (VERBOSE "Create ${versionfile} from ${versionfile}.in") configure_file (${PROJECT_NAME}/${versionfile}.in "${CMAKE_BINARY_DIR}/include/${PROJECT_NAME}/${versionfile}" @ONLY) list (APPEND public_headers "${CMAKE_BINARY_DIR}/include/${PROJECT_NAME}/${versionfile}") set (oslconfighfile oslconfig.h) -if (VERBOSE) - message (STATUS "Create ${oslconfighfile} from ${oslconfighfile}.in") -endif () +message (VERBOSE "Create ${oslconfighfile} from ${oslconfighfile}.in") configure_file (${PROJECT_NAME}/${oslconfighfile}.in "${CMAKE_BINARY_DIR}/include/${PROJECT_NAME}/${oslconfighfile}" @ONLY) list (APPEND public_headers "${CMAKE_BINARY_DIR}/include/${PROJECT_NAME}/${oslconfighfile}") diff --git a/src/shaders/CMakeLists.txt b/src/shaders/CMakeLists.txt index 1ea7beed5..44aaa2c52 100644 --- a/src/shaders/CMakeLists.txt +++ b/src/shaders/CMakeLists.txt @@ -29,9 +29,7 @@ macro (oslc_compile) get_filename_component ( oslsrc_we ${_shader_OSL} NAME_WE ) set (osofile "${CMAKE_CURRENT_BINARY_DIR}/${oslsrc_we}.oso") endif () - if (VERBOSE) - message (STATUS "oslc will make '${oslfile}' -> '${osofile}'") - endif () + message (VERBOSE "oslc will make '${oslfile}' -> '${osofile}'") set (stdosl_header "${CMAKE_SOURCE_DIR}/src/shaders/stdosl.h") set (oslc_args -q ${_shader_DEFINES} "-I${CMAKE_CURRENT_SOURCE_DIR}") foreach (_incdir ${_shader_INCLUDE_DIRS})