diff --git a/spine-c/CMakeLists.txt b/spine-c/CMakeLists.txt index 892c73f59..ca28c22fa 100644 --- a/spine-c/CMakeLists.txt +++ b/spine-c/CMakeLists.txt @@ -34,8 +34,6 @@ target_include_directories(spine-c PUBLIC ../spine-cpp/spine-cpp/include ) -# Export compile commands for better IDE support -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Create test executable only if this is the top-level project if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) diff --git a/spine-c/CMakePresets.json b/spine-c/CMakePresets.json new file mode 100644 index 000000000..3aa553b04 --- /dev/null +++ b/spine-c/CMakePresets.json @@ -0,0 +1,35 @@ +{ + "version": 3, + "configurePresets": [ + { + "name": "debug", + "displayName": "Debug Config", + "description": "Debug build using Ninja generator", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" + } + }, + { + "name": "release", + "inherits": "debug", + "displayName": "Release Config", + "description": "Release build using Ninja generator", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + } + ], + "buildPresets": [ + { + "name": "debug", + "configurePreset": "debug" + }, + { + "name": "release", + "configurePreset": "release" + } + ] +} \ No newline at end of file diff --git a/spine-c/build.sh b/spine-c/build.sh index 53543b1fe..1ee62b779 100755 --- a/spine-c/build.sh +++ b/spine-c/build.sh @@ -15,6 +15,5 @@ if [ "$1" = "clean" ]; then fi # Always build -mkdir -p build && cd build -[ -f CMakeCache.txt ] || cmake .. -DCMAKE_BUILD_TYPE=Debug -make -j$(sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo 4) \ No newline at end of file +cmake --preset=debug . +cmake --build --preset=debug \ No newline at end of file diff --git a/spine-cpp/CMakePresets.json b/spine-cpp/CMakePresets.json new file mode 100644 index 000000000..3aa553b04 --- /dev/null +++ b/spine-cpp/CMakePresets.json @@ -0,0 +1,35 @@ +{ + "version": 3, + "configurePresets": [ + { + "name": "debug", + "displayName": "Debug Config", + "description": "Debug build using Ninja generator", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" + } + }, + { + "name": "release", + "inherits": "debug", + "displayName": "Release Config", + "description": "Release build using Ninja generator", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + } + ], + "buildPresets": [ + { + "name": "debug", + "configurePreset": "debug" + }, + { + "name": "release", + "configurePreset": "release" + } + ] +} \ No newline at end of file diff --git a/spine-cpp/build.sh b/spine-cpp/build.sh index b03b82928..1fd7eb5fc 100755 --- a/spine-cpp/build.sh +++ b/spine-cpp/build.sh @@ -9,6 +9,5 @@ if [ "$1" = "clean" ]; then fi # Always build -mkdir -p build && cd build -[ -f CMakeCache.txt ] || cmake .. -DCMAKE_BUILD_TYPE=Debug -make -j$(sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo 4) \ No newline at end of file +cmake --preset=debug . +cmake --build --preset=debug \ No newline at end of file