diff --git a/Source/cmOrderLinkDirectories.cxx b/Source/cmOrderLinkDirectories.cxx index 802891d3af..86a7cbe9b4 100644 --- a/Source/cmOrderLinkDirectories.cxx +++ b/Source/cmOrderLinkDirectories.cxx @@ -187,7 +187,9 @@ void cmOrderLinkDirectories::OrderPaths(std::vector& { cmOrderLinkDirectoriesCompare comp; comp.This = this; - std::sort(orderedPaths.begin(), orderedPaths.end(), comp); + // for some reason when cmake is run on InsightApplication + // if std::sort is used here cmake crashes, but stable_sort works + std::stable_sort(orderedPaths.begin(), orderedPaths.end(), comp); } //-------------------------------------------------------------------