#
-#
#
# ######################
# # FAT NOTE 2: #
"CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}\n"
)
ENDIF()
+
#
-# ... and that we can set the same _default_ flags for both,
-# so we can just set all C-Flags to the corrersponding CXX-Flags at the end
-# of this script.
+# Setup CMAKE_CXX_FLAGS<_RELEASE|_DEBUG>:
#
IF(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
)
ENDIF(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
+
+#
+# Setup CMAKE_C_FLAGS<_RELEASE|_DEBUG>:
+#
+
#
# For the moment we assume that CC and CXX are the same compiler and that
-# we can set the same _default_ flags for both.
+# we can set (almost) the same default flags for both.
#
+
SET(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS})
SET(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
SET(CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
+
+#
+# Strip some CXX-only flags
+#
+
+STRIP_FLAG(CMAKE_C_FLAGS "-Wsynth")
+STRIP_FLAG(CMAKE_C_FLAGS_RELEASE "-felide-constructors")
umfpack_triplet_to_col.c
)
+#
+# Disable some warning for the compilation of UMFPACK:
+#
+ENABLE_IF_SUPPORTED(obj_umfpack_COMPILE_FLAGS "-Wno-pragmas")
+ENABLE_IF_SUPPORTED(obj_umfpack_COMPILE_FLAGS "-Wno-sign-compare")
+
#-------------------------------------------------------------------------------
# compile each int and long routine (with no real/complex version)
#-------------------------------------------------------------------------------
ADD_LIBRARY(obj_umfpack_I_UMF OBJECT ${src_umfpack_UMF})
-SET_TARGET_PROPERTIES(obj_umfpack_I_UMF PROPERTIES COMPILE_FLAGS "-DDINT")
+SET_TARGET_PROPERTIES(obj_umfpack_I_UMF PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDINT")
ADD_LIBRARY(obj_umfpack_L_UMF OBJECT ${src_umfpack_UMF})
-SET_TARGET_PROPERTIES(obj_umfpack_L_UMF PROPERTIES COMPILE_FLAGS "-DDLONG")
+SET_TARGET_PROPERTIES(obj_umfpack_L_UMF PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDLONG")
ADD_LIBRARY(obj_umfpack_I_UMFPACK OBJECT ${src_umfpack_UMFPACK})
-SET_TARGET_PROPERTIES(obj_umfpack_I_UMFPACK PROPERTIES COMPILE_FLAGS "-DDINT")
+SET_TARGET_PROPERTIES(obj_umfpack_I_UMFPACK PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDINT")
ADD_LIBRARY(obj_umfpack_L_UMFPACK OBJECT ${src_umfpack_UMFPACK})
-SET_TARGET_PROPERTIES(obj_umfpack_L_UMFPACK PROPERTIES COMPILE_FLAGS "-DDLONG")
+SET_TARGET_PROPERTIES(obj_umfpack_L_UMFPACK PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDLONG")
#-------------------------------------------------------------------------------
# compile each routine in the DI version
#-------------------------------------------------------------------------------
ADD_LIBRARY(obj_umfpack_DI_TSOLVE OBJECT umf_ltsolve.c umf_utsolve.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DI_TSOLVE PROPERTIES COMPILE_FLAGS "-DDINT -DCONJUGATE_SOLVE")
+SET_TARGET_PROPERTIES(obj_umfpack_DI_TSOLVE PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDINT -DCONJUGATE_SOLVE")
ADD_LIBRARY(obj_umfpack_DI_TRIPLET_MAP_NOX OBJECT umf_triplet.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DI_TRIPLET_MAP_NOX PROPERTIES COMPILE_FLAGS "-DDINT -DDO_MAP")
+SET_TARGET_PROPERTIES(obj_umfpack_DI_TRIPLET_MAP_NOX PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDINT -DDO_MAP")
ADD_LIBRARY(obj_umfpack_DI_TRIPLET_MAP_X OBJECT umf_triplet.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DI_TRIPLET_MAP_X PROPERTIES COMPILE_FLAGS "-DDINT -DDO_MAP -DDO_VALUES")
+SET_TARGET_PROPERTIES(obj_umfpack_DI_TRIPLET_MAP_X PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDINT -DDO_MAP -DDO_VALUES")
ADD_LIBRARY(obj_umfpack_DI_TRIPLET_NOMAP_X OBJECT umf_triplet.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DI_TRIPLET_NOMAP_X PROPERTIES COMPILE_FLAGS "-DDINT -DDO_VALUES")
+SET_TARGET_PROPERTIES(obj_umfpack_DI_TRIPLET_NOMAP_X PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDINT -DDO_VALUES")
ADD_LIBRARY(obj_umfpack_DI_STORE OBJECT umf_store_lu.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DI_STORE PROPERTIES COMPILE_FLAGS "-DDINT -DDROP")
+SET_TARGET_PROPERTIES(obj_umfpack_DI_STORE PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDINT -DDROP")
ADD_LIBRARY(obj_umfpack_DI_ASSEMBLE OBJECT umf_assemble.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DI_ASSEMBLE PROPERTIES COMPILE_FLAGS "-DDINT -DFIXQ")
+SET_TARGET_PROPERTIES(obj_umfpack_DI_ASSEMBLE PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDINT -DFIXQ")
ADD_LIBRARY(obj_umfpack_DI_SOLVE OBJECT umfpack_solve.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DI_SOLVE PROPERTIES COMPILE_FLAGS "-DDINT -DWSOLVE")
+SET_TARGET_PROPERTIES(obj_umfpack_DI_SOLVE PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDINT -DWSOLVE")
#-------------------------------------------------------------------------------
# compile each routine in the DL version
#-------------------------------------------------------------------------------
ADD_LIBRARY(obj_umfpack_DL_TSOLVE OBJECT umf_ltsolve.c umf_utsolve.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DL_TSOLVE PROPERTIES COMPILE_FLAGS "-DDLONG -DCONJUGATE_SOLVE")
+SET_TARGET_PROPERTIES(obj_umfpack_DL_TSOLVE PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDLONG -DCONJUGATE_SOLVE")
ADD_LIBRARY(obj_umfpack_DL_TRIPLET_MAP_NOX OBJECT umf_triplet.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DL_TRIPLET_MAP_NOX PROPERTIES COMPILE_FLAGS "-DDLONG -DDO_MAP")
+SET_TARGET_PROPERTIES(obj_umfpack_DL_TRIPLET_MAP_NOX PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDLONG -DDO_MAP")
ADD_LIBRARY(obj_umfpack_DL_TRIPLET_MAP_X OBJECT umf_triplet.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DL_TRIPLET_MAP_X PROPERTIES COMPILE_FLAGS "-DDLONG -DDO_MAP -DDO_VALUES")
+SET_TARGET_PROPERTIES(obj_umfpack_DL_TRIPLET_MAP_X PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDLONG -DDO_MAP -DDO_VALUES")
ADD_LIBRARY(obj_umfpack_DL_TRIPLET_NOMAP_X OBJECT umf_triplet.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DL_TRIPLET_NOMAP_X PROPERTIES COMPILE_FLAGS "-DDLONG -DDO_VALUES")
+SET_TARGET_PROPERTIES(obj_umfpack_DL_TRIPLET_NOMAP_X PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDLONG -DDO_VALUES")
ADD_LIBRARY(obj_umfpack_DL_STORE OBJECT umf_store_lu.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DL_STORE PROPERTIES COMPILE_FLAGS "-DDLONG -DDROP")
+SET_TARGET_PROPERTIES(obj_umfpack_DL_STORE PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDLONG -DDROP")
ADD_LIBRARY(obj_umfpack_DL_ASSEMBLE OBJECT umf_assemble.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DL_ASSEMBLE PROPERTIES COMPILE_FLAGS "-DDLONG -DFIXQ")
+SET_TARGET_PROPERTIES(obj_umfpack_DL_ASSEMBLE PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDLONG -DFIXQ")
ADD_LIBRARY(obj_umfpack_DL_SOLVE OBJECT umfpack_solve.c)
-SET_TARGET_PROPERTIES(obj_umfpack_DL_SOLVE PROPERTIES COMPILE_FLAGS "-DDLONG -DWSOLVE")
+SET_TARGET_PROPERTIES(obj_umfpack_DL_SOLVE PROPERTIES COMPILE_FLAGS "${obj_umfpack_COMPILE_FLAGS} -DDLONG -DWSOLVE")
#-------------------------------------------------------------------------------
# Create the generic routines (GN) using a generic rule
ADD_SUBDIRECTORY(numerics)
-#
-# Combine all OBJECT targets to a shared library:
-#
-
-ADD_LIBRARY(deal_II SHARED
- $<TARGET_OBJECTS:obj_base>
- $<TARGET_OBJECTS:obj_distributed>
- $<TARGET_OBJECTS:obj_dofs>
- $<TARGET_OBJECTS:obj_fe>
- $<TARGET_OBJECTS:obj_grid>
- $<TARGET_OBJECTS:obj_hp>
- $<TARGET_OBJECTS:obj_lac>
- $<TARGET_OBJECTS:obj_multigrid>
- $<TARGET_OBJECTS:obj_numerics>
-
- # for contrib stuff:
- ${deal_ii_additional_object_files}
- )
-
+ADD_LIBRARY(deal_II #whether SHARED or STATIC is set by BUILD_SHARED_LIBS#
+ $<TARGET_OBJECTS:obj_base>
+ $<TARGET_OBJECTS:obj_distributed>
+ $<TARGET_OBJECTS:obj_dofs>
+ $<TARGET_OBJECTS:obj_fe>
+ $<TARGET_OBJECTS:obj_grid>
+ $<TARGET_OBJECTS:obj_hp>
+ $<TARGET_OBJECTS:obj_lac>
+ $<TARGET_OBJECTS:obj_multigrid>
+ $<TARGET_OBJECTS:obj_numerics>
+
+ # for contrib stuff:
+ ${deal_ii_additional_object_files}
+ )
#
# Sonaming: Well... we just use the version number.
DEBUG_POSTFIX ".g"
)
-
SET_TARGET_PROPERTIES(deal_II PROPERTIES
LINK_FLAGS "${deal_ii_required_linker_flags}"
)
-
TARGET_LINK_LIBRARIES(deal_II ${deal_ii_external_libraries})