Set up CMake-based build system

This commit is contained in:
Xavier Del Campo Romero 2025-01-26 23:30:08 +01:00
parent 94800874a8
commit 277f32db5d
Signed by: xavi
GPG key ID: 84FF3612A9BF43F2
4 changed files with 96 additions and 0 deletions

21
CMakeLists.txt Normal file
View file

@ -0,0 +1,21 @@
# FreeSOLID - Interference Detection Library.
# Copyright (C) 2025 Xavier Del Campo Romero
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
cmake_minimum_required(VERSION 3.12)
project(soliditf LANGUAGES C CXX VERSION 2.1.2)
add_subdirectory(libsolid)
add_subdirectory(libmoto)
add_subdirectory(libbroad)
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(${PROJECT_NAME} INTERFACE include)
install(TARGETS ${PROJECT_NAME})
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/solidConfigVersion.cmake
COMPATIBILITY SameMajorVersion
)

19
libbroad/CMakeLists.txt Normal file
View file

@ -0,0 +1,19 @@
# FreeSOLID - Interference Detection Library.
# Copyright (C) 2025 Xavier Del Campo Romero
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
add_library(broad
BP_C-api.cpp
BP_Endpoint.cpp
BP_Proxy.cpp
BP_Scene.cpp
)
target_link_libraries(broad INTERFACE ${PROJECT_NAME} PRIVATE moto)
target_include_directories(broad PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_compile_options(broad PRIVATE -Wall)
install(TARGETS broad)

25
libmoto/CMakeLists.txt Normal file
View file

@ -0,0 +1,25 @@
# FreeSOLID - Interference Detection Library.
# Copyright (C) 2025 Xavier Del Campo Romero
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
add_library(moto
GEN_random.cpp
MT_Matrix3x3.cpp
MT_Point2.cpp
MT_Point3.cpp
MT_Quaternion.cpp
MT_Transform.cpp
MT_Vector2.cpp
MT_Vector3.cpp
MT_Vector4.cpp
)
target_link_libraries(moto INTERFACE ${PROJECT_NAME} PRIVATE)
target_include_directories(moto PUBLIC ${CMAKE_CURRENT_LIST_DIR})
target_compile_options(moto PRIVATE -Wall)
install(TARGETS moto)

31
libsolid/CMakeLists.txt Normal file
View file

@ -0,0 +1,31 @@
# FreeSOLID - Interference Detection Library.
# Copyright (C) 2025 Xavier Del Campo Romero
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
add_library(solid
BBoxTree.cpp
Box.cpp
C-api.cpp
Complex.cpp
Cone.cpp
Convex.cpp
Cylinder.cpp
Ellipsoid.cpp
Object.cpp
Polygon.cpp
Polyhedron.cpp
Response.cpp
RespTable.cpp
Simplex.cpp
Sphere.cpp
Transform.cpp
)
target_include_directories(solid PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_compile_options(solid PRIVATE -Wall)
target_link_libraries(solid INTERFACE ${PROJECT_NAME} PRIVATE moto broad)
install(TARGETS solid)