From 2c44fccbb70a961bd42640e4ccc3ee3e4cf58644 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Fri, 26 Apr 2024 15:52:16 +0900 Subject: [PATCH] Rename lib, rename sources, set up cmake install --- CMakeLists.txt | 19 +++++++++++-------- src/{sd_sacd.cpp => sc_sacd.cpp} | 2 +- src/{sd_sacd.h => sc_sacd.h} | 0 src/test.cpp | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) rename src/{sd_sacd.cpp => sc_sacd.cpp} (99%) rename src/{sd_sacd.h => sc_sacd.h} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index c6b9984..ce00a45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,12 @@ cmake_minimum_required(VERSION 3.22.1) -project(SC_SeparatingAxisCollisionDetection CXX) +project(SC_3D_CollisionDetectionHelpers CXX) -set(SC_SeparatingAxisCollisionDetection_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/sd_sacd.cpp") -set(SC_SeparatingAxisCollisionDetection_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/sd_sacd.h") +set(SC_3D_CollisionDetectionHelpers_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/sc_sacd.cpp") +set(SC_3D_CollisionDetectionHelpers_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/sc_sacd.h") -add_library(SC_SeparatingAxisCollisionDetection ${SC_SeparatingAxisCollisionDetection_SOURCES}) +add_library(SC_3D_CollisionDetectionHelpers ${SC_3D_CollisionDetectionHelpers_SOURCES}) -set_target_properties(SC_SeparatingAxisCollisionDetection PROPERTIES VERSION 1.0.0 SOVERSION 1) +set_target_properties(SC_3D_CollisionDetectionHelpers PROPERTIES VERSION 1.0.0 SOVERSION 1) if(NOT DEFINED CMAKE_BUILD_TYPE OR "${CMAKE_BUILD_TYPE}" STREQUAL "") message("Defaulting to \"Debug\" build type.") @@ -15,7 +15,7 @@ else() message("Using build type \"${CMAKE_BUILD_TYPE}\".") endif() -target_compile_options(SC_SeparatingAxisCollisionDetection PUBLIC +target_compile_options(SC_3D_CollisionDetectionHelpers PUBLIC $,-Og,-fno-delete-null-pointer-checks -fno-strict-overflow -fno-strict-aliasing -ftrivial-auto-var-init=zero> -Wall -Wformat -Wformat=2 -Wconversion -Wimplicit-fallthrough -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 @@ -25,7 +25,7 @@ $,-Og,-fno-delete-null-pointer-checks -fno-strict-overflow -f -fPIC ) -target_link_options(SC_SeparatingAxisCollisionDetection PUBLIC +target_link_options(SC_3D_CollisionDetectionHelpers PUBLIC $,-Og,-fno-delete-null-pointer-checks -fno-strict-overflow -fno-strict-aliasing -ftrivial-auto-var-init=zero> -Wall -Wformat -Wformat=2 -Wconversion -Wimplicit-fallthrough -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 @@ -38,7 +38,7 @@ $,-Og,-fno-delete-null-pointer-checks -fno-strict-overflow -f ) add_executable(UnitTest src/test.cpp) -target_link_libraries(UnitTest SC_SeparatingAxisCollisionDetection) +target_link_libraries(UnitTest SC_3D_CollisionDetectionHelpers) target_include_directories(UnitTest PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src") target_compile_features(UnitTest PUBLIC cxx_std_20) @@ -64,3 +64,6 @@ $,-Og,-fno-delete-null-pointer-checks -fno-strict-overflow -f -fPIE -pie ) + +install(TARGETS SC_3D_CollisionDetectionHelpers DESTINATION "lib") +install(FILES ${SC_3D_CollisionDetectionHelpers_HEADERS} DESTINATION "include") diff --git a/src/sd_sacd.cpp b/src/sc_sacd.cpp similarity index 99% rename from src/sd_sacd.cpp rename to src/sc_sacd.cpp index 90e8e9d..f97bb3c 100644 --- a/src/sd_sacd.cpp +++ b/src/sc_sacd.cpp @@ -1,4 +1,4 @@ -#include "sd_sacd.h" +#include "sc_sacd.h" // Standard library includes. #include diff --git a/src/sd_sacd.h b/src/sc_sacd.h similarity index 100% rename from src/sd_sacd.h rename to src/sc_sacd.h diff --git a/src/test.cpp b/src/test.cpp index 124a5a6..ea09c49 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -25,7 +25,7 @@ static int checks_passed = 0; } \ } while (false); -#include "sd_sacd.h" +#include "sc_sacd.h" int main() { // Test 2D AABB.