Skip to content

Commit

Permalink
Handle single-config and multi-config generators in CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-ai-integration[bot] committed Sep 17, 2024
1 parent 9fb6cde commit 634c474
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ endif()

set(OPENMIND_PRIME_TABLE Boost CACHE STRING "Table of predefined prime numbers")

set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (default to Release)" FORCE)
if(NOT CMAKE_CONFIGURATION_TYPES)
# Only set CMAKE_BUILD_TYPE for single-configuration generators
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type for single-configuration generators" FORCE)
else()
# For multi-configuration generators, set the available configuration types
set(CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING "Configuration types" FORCE)
endif()

if(CMAKE_BUILD_TYPE MATCHES [Dd][Ee][Bb][Uu][Gg])
set(CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR} CACHE PATH "hint for find_package")
Expand Down

0 comments on commit 634c474

Please sign in to comment.