Skip to content

minimal change to enable true OOS build while defaulting to original … #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,27 @@ endif()

project(camera)

#NOTE: by default the existing camera-interface build system puts binaries in the source tree
#regardless of where the build is configured. This is not "expected" cmake behaviour.
#This option enables out of source builds by not doing that. But it defaults to the old behaviour
#so as not to break any existing build instances
option(ENABLE_OOS_BUILD "Enable true out of source build" OFF)


set(CMAKE_GXX_STANDARD 17)
set(CMAKE_GXX_STANDARD_REQUIRED ON)
set(CMAKE_GXX_EXTENSIONS OFF)

# Run "cmake .." from the project's build/ directory!
#
set(PROJECT_BASE_DIR $ENV{PWD}/../)
set(PROJECT_BASE_DIR ${CMAKE_SOURCE_DIR})

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BASE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BASE_DIR}/lib)

#if we're not doing an OOS build we want binaries in the source tree
if(NOT ${ENABLE_OOS_BUILD})
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BASE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BASE_DIR}/lib)
endif()


if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
Expand Down