Update CMakeLists.txt
authorMartin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Sat, 5 Nov 2016 11:47:15 +0000 (12:47 +0100)
committerGitHub <noreply@github.com>
Sat, 5 Nov 2016 11:47:15 +0000 (12:47 +0100)
CMakeLists.txt

index 01d27d5..6cdbbe4 100644 (file)
@@ -30,15 +30,23 @@ set(NO_LAPACK 1)
 set(NO_LAPACKE 1)
 endif()
 
-if( NOT CMAKE_BUILD_TYPE )
-       if(BUILD_DEBUG)
-               set(CMAKE_BUILD_TYPE Debug)
-       else()
-               set(CMAKE_BUILD_TYPE Release)
+if(CMAKE_CONFIGURATION_TYPES) # multiconfig generator?
+        set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
+       set(OpenBLAS_LIBNAME
+               $<$<CONFIG:Debug>:"${OpenBLAS_LIBNAME}_d">
+               $<$<CONFIG:Release>:"${OpenBLAS_LIBNAME}"> 
+       )
+else()
+       if( NOT CMAKE_BUILD_TYPE )
+               if(BUILD_DEBUG)
+                       set(CMAKE_BUILD_TYPE Debug)
+               else()
+                       set(CMAKE_BUILD_TYPE Release)
+               endif()
        endif()
 endif()
 
-if (CMAKE_BUILD_TYPE = Debug)
+if (CMAKE_BUILD_TYPE STREQUAL Debug)
        set(OpenBLAS_LIBNAME "${OpenBLAS_LIBNAME}_d")
 endif()