diff --git a/cmake/DARTConfig.cmake.in b/cmake/DARTConfig.cmake.in index 84450a92ab342..4145b8d4ed12c 100644 --- a/cmake/DARTConfig.cmake.in +++ b/cmake/DARTConfig.cmake.in @@ -10,6 +10,20 @@ # dart - Main target. # dart- - Target for specific component (e.g., dart-collision-bullet). +# Specify CMake minimum required version +if(NOT CMAKE_MINIMUM_REQUIRED_VERSION) + if(MSVC) + cmake_minimum_required(VERSION 3.8.0) + else() + cmake_minimum_required(VERSION 3.5.1) + endif() +else() + # Support if() IN_LIST operator + if(POLICY CMP0057) + cmake_policy(SET CMP0057 NEW) + endif() +endif() + #=============================================================================== # Helper Function Definitions #=============================================================================== diff --git a/cmake/DARTFindBullet.cmake b/cmake/DARTFindBullet.cmake index 0a6ece7219ef6..b99c32a3df9c9 100644 --- a/cmake/DARTFindBullet.cmake +++ b/cmake/DARTFindBullet.cmake @@ -12,7 +12,6 @@ find_package(Bullet COMPONENTS BulletMath BulletCollision MODULE QUIET) if((BULLET_FOUND OR Bullet_FOUND) AND NOT TARGET Bullet) - cmake_policy(SET CMP0057 NEW) if(WIN32 AND "optimized" IN_LIST BULLET_LIBRARIES AND "debug" IN_LIST BULLET_LIBRARIES) cmake_parse_arguments(BULLET_INTERFACE_LIBRARIES "" "" "debug;optimized"