Skip to content

Commit

Permalink
Disable in-source build
Browse files Browse the repository at this point in the history
  • Loading branch information
howetuft committed Jan 5, 2025
1 parent 3d37f25 commit 6ef5bd3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,3 @@ release/*
# For ignored files in bin/ subdirectory, see the .gitignore file in bin/
wheels/

# CMake various files
build/
CMakeCache.txt
CMakeFiles/
Makefile
cmake_install.cmake
18 changes: 13 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
# To build extension:
# cmake -B/path/to/my/build/folder -S/path/to/source/folder
# cd /path/to/my/build/folder && cmake --build .

cmake_minimum_required(VERSION 3.25)
project(BlendLuxCore LANGUAGES NONE)

file(MAKE_DIRECTORY build)
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)

project(BlendLuxCore LANGUAGES NONE)
if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
message(SEND_ERROR "In-source builds are not allowed.")
endif()

function(validate_blender_version result blender)
execute_process(
Expand Down Expand Up @@ -37,10 +46,9 @@ find_program(BLENDER blender NAMES blender.exe VALIDATOR validate_blender_versio

# Add BlendLuxCore target
add_custom_target(
extension ALL
COMMAND ${BLENDER}
extension ALL ${BLENDER}
--command extension build
--source-dir ${CMAKE_CURRENT_SOURCE_DIR}
--output-filepath ${CMAKE_CURRENT_BINARY_DIR}/build/BlendLuxCore-${BLC_VERSION}.zip
--output-filepath ${CMAKE_CURRENT_BINARY_DIR}/BlendLuxCore-${BLC_VERSION}.zip
VERBATIM
)

0 comments on commit 6ef5bd3

Please sign in to comment.