]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
add cmake scripts for MSVC 2012 (not working yet)
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 20 Feb 2013 01:06:46 +0000 (01:06 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 20 Feb 2013 01:06:46 +0000 (01:06 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@28487 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/setup_compiler_flags.cmake
deal.II/cmake/setup_compiler_flags_msvc.cmake [new file with mode: 0644]

index 7102e0105d92f5bba060a20c8bcb8647663ae447..c2524fdecc7a29cdefa3765335b872e9ebbdb656 100644 (file)
@@ -90,7 +90,11 @@ IF(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
     SET(DEAL_II_KNOWN_COMPILER TRUE)
   ENDIF()
 
-
+  IF(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+    INCLUDE(setup_compiler_flags_msvc)
+    SET(DEAL_II_KNOWN_COMPILER TRUE)
+  ENDIF()
+  
   IF(NOT DEAL_II_KNOWN_COMPILER)
     MESSAGE(FATAL_ERROR "\n"
       "Unknown compiler!\n"
diff --git a/deal.II/cmake/setup_compiler_flags_msvc.cmake b/deal.II/cmake/setup_compiler_flags_msvc.cmake
new file mode 100644 (file)
index 0000000..3afea55
--- /dev/null
@@ -0,0 +1,85 @@
+#####
+##
+## Copyright (C) 2012 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## <TODO: Full License information>
+## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
+## version of the LGPL license.
+##
+## Author: Timo Heister
+##
+#####
+
+#
+# General setup for the Microsoft Visual Studio C++ Compiler (Windows)
+#
+# Please read the fat note in setup_compiler_flags.cmake prior to
+# editing this file.
+#
+
+#TODO: this check is not working, my version is 17.0.51106.1 (2012)
+#IF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "17.0.0.0" )
+##  MESSAGE(WARNING "\n"
+#    "You're using an old version of the MSVC C++ Compiler!\n"
+#    "It is strongly recommended to use at least version 2012.\n"
+#    )
+#ENDIF()
+
+
+########################
+#                      #
+#    General setup:    #
+#                      #
+########################
+
+# enable exception handling:
+ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "/EHsc")
+
+#enable warnings:
+ADD_FLAGS(CMAKE_CXX_FLAGS "/W3")
+
+#############################
+#                           #
+#    For Release target:    #
+#                           #
+#############################
+
+IF (CMAKE_BUILD_TYPE MATCHES "Release")
+  #
+  # General optimization flags: (very basic for now)
+  #
+  ADD_FLAGS(DEAL_II_CXX_FLAGS_RELEASE "/O2")
+ENDIF()
+
+
+###########################
+#                         #
+#    For Debug target:    #
+#                         #
+###########################
+
+IF (CMAKE_BUILD_TYPE MATCHES "Debug")
+  LIST(APPEND DEAL_II_DEFINITIONS_DEBUG "DEBUG")
+  LIST(APPEND DEAL_II_USER_DEFINITIONS_DEBUG "DEBUG")
+
+  # generate some debug info:
+  ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "/Zi")
+ENDIF()
+
+
+#########################
+#                       #
+#    Set up C FLAGS:    #
+#                       #
+#########################
+
+#
+# For the moment we assume that CC and CXX are the same compiler and that
+# we can set (almost) the same default flags for both:
+#
+SET(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS})
+SET(DEAL_II_C_FLAGS_RELEASE ${DEAL_II_CXX_FLAGS_RELEASE})
+SET(DEAL_II_C_FLAGS_DEBUG ${DEAL_II_CXX_FLAGS_DEBUG})
+

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.