Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.vscode/
.vs/
build/
_deps/
cmake-build*/
cmake-*/
.idea/
Expand Down
55 changes: 27 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.21)

project(
Blast
VERSION 0.1.0
DESCRIPTION "Blast: A fast trajectory optimization library for robot manipulators"
LANGUAGES CXX
Blast
VERSION 0.1.0
DESCRIPTION "Blast: A fast trajectory optimization library for robot manipulators"
LANGUAGES CXX
)

include(GNUInstallDirs)
Expand All @@ -18,21 +18,20 @@ option(ENABLE_TRACY "Enable Tracy Profiler support" OFF)
# --------------------------------------------------------------------------
# Tracy (optional profiling dependency, fetched only when requested)
# --------------------------------------------------------------------------
if (ENABLE_TRACY)
if(ENABLE_TRACY)
message(STATUS "Tracy Profiler is enabled — fetching dependency...")
include(FetchContent)
set(FETCHCONTENT_BASE_DIR ${CMAKE_BINARY_DIR}/_deps)
FetchContent_Declare(
tracy
GIT_REPOSITORY https://github.com/wolfpld/tracy.git
GIT_TAG v0.12.2
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
tracy
GIT_REPOSITORY https://github.com/wolfpld/tracy.git
GIT_TAG v0.12.2
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable(tracy)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
message(STATUS "Building with Tracy enabled — make sure the server is launched when executing.")
endif ()
endif()

# --------------------------------------------------------------------------
# Core library
Expand All @@ -43,48 +42,48 @@ add_subdirectory(blast)
# Python bindings (optional)
# --------------------------------------------------------------------------
option(BLAST_BUILD_PYTHON "Build Python bindings via nanobind" OFF)
if (BLAST_BUILD_PYTHON)
if(BLAST_BUILD_PYTHON)
add_subdirectory(python)
endif ()
endif()

# --------------------------------------------------------------------------
# Developer targets — tests, benchmarks, examples
# Only built when Blast is the top-level project; silently absent when
# consumed via add_subdirectory() or find_package().
# --------------------------------------------------------------------------
if (PROJECT_IS_TOP_LEVEL)
if(PROJECT_IS_TOP_LEVEL)
set(CMAKE_CXX_EXTENSIONS OFF)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

add_subdirectory(examples)

enable_testing()
add_subdirectory(tests)
endif ()
endif()

# --------------------------------------------------------------------------
# Install + Export
# --------------------------------------------------------------------------
install(EXPORT BlastTargets
FILE BlastTargets.cmake
NAMESPACE Blast::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Blast
FILE BlastTargets.cmake
NAMESPACE Blast::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Blast
)

configure_package_config_file(
cmake/BlastConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/BlastConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Blast
cmake/BlastConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/BlastConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Blast
)

write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/BlastConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
${CMAKE_CURRENT_BINARY_DIR}/BlastConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/BlastConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/BlastConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Blast
${CMAKE_CURRENT_BINARY_DIR}/BlastConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/BlastConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Blast
)
7 changes: 6 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@
"name": "dev",
"configurePreset": "dev"
},
{
"name": "dev-msvc",
"configurePreset": "dev-msvc",
"configuration": "RelWithDebInfo"
},
{
"name": "ci",
"configurePreset": "ci"
}
]
}
}
Loading