Skip to content

Commit

Permalink
Output compiled examples in the root build directory
Browse files Browse the repository at this point in the history
  • Loading branch information
magiblot committed Feb 5, 2024
1 parent a7b2208 commit fa73977
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ endif()

project (turbo)

set(TURBO_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})

# Target 'scintilla'

# These two could be built in one single target, but we want to enable Unity Build
Expand Down Expand Up @@ -189,7 +191,7 @@ if (TURBO_BUILD_TESTS)
COMMAND ${TURBO}-test
COMMAND ${CMAKE_COMMAND} -E touch ${TURBO}-test-passed
DEPENDS ${TURBO}-test
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${TURBO_BINARY_DIR}
)
add_custom_target(${TURBO}-test-run ALL DEPENDS ${TURBO}-test-passed)
if (NOT TURBO_USE_SYSTEM_TVISION)
Expand Down
7 changes: 7 additions & 0 deletions source/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ project(turbo-examples)
set(MASTER_PROJECT FALSE)
if (CMAKE_CURRENT_LIST_DIR STREQUAL CMAKE_SOURCE_DIR)
set(MASTER_PROJECT TRUE)
set(TURBO_BINARY_DIR ${CMAKE_BINARY_DIR})
endif()

if (MASTER_PROJECT)
Expand All @@ -20,6 +21,12 @@ if (TURBO_BUILD_EXAMPLES OR MASTER_PROJECT)
function(add_example_generic app)
add_executable(${app} ${app}.cc)
target_link_libraries(${app} PRIVATE turbo-core)
# Place everything in the root build directory, for ease of use.
set_target_properties(${app} PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${TURBO_BINARY_DIR}
LIBRARY_OUTPUT_DIRECTORY ${TURBO_BINARY_DIR}
RUNTIME_OUTPUT_DIRECTORY ${TURBO_BINARY_DIR}
)
endfunction()

add_example_generic(demo-with-custom-editor-window)
Expand Down

0 comments on commit fa73977

Please sign in to comment.