Skip to content

Instantly share code, notes, and snippets.

@zardoru
Created July 3, 2026 23:00
Show Gist options
  • Select an option

  • Save zardoru/59250e14dcfe415efc096a8e1845a5c0 to your computer and use it in GitHub Desktop.

Select an option

Save zardoru/59250e14dcfe415efc096a8e1845a5c0 to your computer and use it in GitHub Desktop.
quetoo build orchestration cmake script
cmake_minimum_required(VERSION 4.2)
project(QuetooSuperbuild)
include(ExternalProject)
# we're putting our files in here!
set(INSTALL_DIR "${CMAKE_BINARY_DIR}/install")
# go grab the right make
find_program(MAKE gmake make REQUIRED)
# depending on system, we can find the # of logical cores...
set(JOB_COUNT 1)
if (LINUX)
execute_process(
COMMAND nproc
OUTPUT_VARIABLE JOB_COUNT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
# pkg-config: apuntar a los .pc que instalen nuestros ExternalProject
set(PC_PATH "${INSTALL_DIR}/lib/pkgconfig")
function(add_autotools_dep name git_tag)
cmake_parse_arguments(A "" "" "DEPENDS" ${ARGN})
ExternalProject_Add(${name}
GIT_REPOSITORY "https://github.com/jdolan/${name}"
GIT_TAG ${git_tag}
BUILD_IN_SOURCE 1
PATCH_COMMAND autoreconf -i
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env
"PKG_CONFIG_PATH=${PC_PATH}:$ENV{PKG_CONFIG_PATH}"
<SOURCE_DIR>/configure --prefix=${INSTALL_DIR}
BUILD_COMMAND ${MAKE} -j${JOB_COUNT}
INSTALL_COMMAND ${MAKE} install
DEPENDS ${A_DEPENDS}
)
endfunction()
add_autotools_dep(Objectively main)
add_autotools_dep(ObjectivelyGPU main DEPENDS Objectively)
add_autotools_dep(ObjectivelyMVC main DEPENDS Objectively ObjectivelyGPU)
add_autotools_dep(Quetoo "jdolan-sdl-gpu-renderer" DEPENDS Objectively ObjectivelyGPU ObjectivelyMVC)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment