cycles/GNUmakefile
Brecht Van Lommel 4a91d24da4 Build: changes to improve Windows build
* Change default install directory to install/, so that multi config always
  install files to the same directory regardless of build config
* Install Hydra dll in install/hydra subdirectory, to make the directory
  layout a bit cleaner and be more consistent with the Houdini case
* Init install prefix and build type to good defaults even when not using
  the make wrapper
* Tweak build instructions to work for Windows, using a cmake command instead
  of BUILD_CMAKE_ARGS
* Build with Visual Studio project files for make wrapper. Speeds up builds
  since NMake is single threaded, and gives a Visual Studio project to work
  with.
* Workaround odd OCIO linking error with SCENE_LINEAR string
2022-04-25 13:53:56 +02:00

52 lines
981 B
Makefile

# Convenience wrapper for CMake commands
ifeq ($(OS),Windows_NT)
$(error On Windows, use "cmd //c make.bat" instead of "make")
endif
OS:=$(shell uname -s)
ifndef BUILD_CMAKE_ARGS
BUILD_CMAKE_ARGS:=
endif
ifndef BUILD_DIR
BUILD_DIR:=./build
endif
ifndef PYTHON
PYTHON:=python3
endif
ifndef PARALLEL_JOBS
PARALLEL_JOBS:=1
ifeq ($(OS), Linux)
PARALLEL_JOBS:=$(shell nproc)
endif
ifneq (,$(filter $(OS),Darwin FreeBSD))
PARALLEL_JOBS:=$(shell sysctl -n hw.ncpu)
endif
endif
all: release
release:
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) && cmake $(BUILD_CMAKE_ARGS) -DCMAKE_BUILD_TYPE=Release .. && cmake --build . -j $(PARALLEL_JOBS) --target install
debug:
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) && cmake $(BUILD_CMAKE_ARGS) -DCMAKE_BUILD_TYPE=Debug .. && cmake --build . -j $(PARALLEL_JOBS) --target install
clean:
rm -rf $(BUILD_DIR)
test:
cd $(BUILD_DIR) && ctest
update:
$(PYTHON) src/cmake/make_update.py
format:
$(PYTHON) src/cmake/make_format.py