# Transform some cmake lists into a string that the old Makefile
# mechanism actually understands:
#
+ # TODO: Come up with an idea how to get the link line directly from
+ # CMake...
+ #
+
TO_STRING_AND_ADD_PREFIX(MAKEFILE_INCLUDE_DIRS "${CMAKE_INCLUDE_FLAG_CXX}"
${DEAL_II_USER_INCLUDE_DIRS}
${DEAL_II_INCLUDE_DIRS}
${DEAL_II_USER_DEFINITIONS_${build}}
)
- #
- # Add an rpath directive in front of each library, so that libraries
- # outside of the default search directories will be found by the runtime
- # dynamic linker:
- #
- FOREACH(lib
+
+ FOREACH(_lib
${MAKEFILE_LIBRARY_${build}}
${DEAL_II_EXTERNAL_LIBRARIES}
${DEAL_II_EXTERNAL_LIBRARIES_${build}}
)
- GET_FILENAME_COMPONENT(path ${lib} PATH)
- LIST(APPEND MAKEFILE_LIBS_${build} "-Wl,-rpath -Wl,${path}")
- LIST(APPEND MAKEFILE_LIBS_${build} ${lib})
+ LIST(APPEND MAKEFILE_LIBS_${build} ${_lib})
+ #
+ # Add an rpath directive for each library:
+ #
+ GET_FILENAME_COMPONENT(_path ${_lib} PATH)
+ LIST(APPEND MAKEFILE_LIBS_${build} "-Wl,-rpath,${_path}")
ENDFOREACH()
+
TO_STRING(MAKEFILE_LIBS_${build} ${MAKEFILE_LIBS_${build}})
+
#
- # Put our linker flags directly in front of this string:
+ # Set up our linker flags:
#
- SET(MAKEFILE_LIBS_${build}
- "${CMAKE_SHARED_LINKER_FLAGS} ${DEAL_II_SHARED_LINKER_FLAGS_${build}} ${MAKEFILE_LIBS_${build}}"
+ SET(MAKEFILE_LDFLAGS_${build}
+ "${CMAKE_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${build}} ${CMAKE_SHARED_LINKER_FLAGS} ${DEAL_II_SHARED_LINKER_FLAGS_${build}}"
)
ENDFOREACH()
COND_SET_TO_YES(BUILD_SHARED_LIBS MAKEFILE_enableshared)
COND_SET_TO_YES(DEAL_II_WITH_PETSC MAKEFILE_PETSC)
+ COND_SET_TO_YES(DEAL_II_WITH_SLEPC MAKEFILE_SLEPC)
COND_SET_TO_YES(DEAL_II_WITH_TRILINOS MAKEFILE_TRILINOS)
+ COND_SET_TO_YES(DEAL_II_WITH_HDF5 MAKEFILE_HDF5)
COND_SET_TO_YES(DEAL_II_WITH_BLAS MAKEFILE_BLAS)
+ COND_SET_TO_YES(DEAL_II_WITH_MUMPS MAKEFILE_MUMPS)
COND_SET_TO_YES(DEAL_II_WITH_LAPACK MAKEFILE_LAPACK)
COND_SET_TO_YES(DEAL_II_WITH_ARPACK MAKEFILE_ARPACK)
COND_SET_TO_YES(DEAL_II_WITH_METIS MAKEFILE_METIS)
COND_SET_TO_YES(DEAL_II_WITH_P4EST MAKEFILE_P4EST)
COND_SET_TO_YES(DEAL_II_WITH_MPI MAKEFILE_MPI)
+
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/Make.global_options.in
${CMAKE_CURRENT_BINARY_DIR}/Make.global_options
CXX = @CMAKE_CXX_COMPILER@
CXX-ID = @CMAKE_CXX_COMPILER_ID@
CXX-VERSION = @CMAKE_CXX_COMPILER_VERSION@
-LDFLAGS = # intentionally left empty and specified in LIBS
ifeq ($(debug-mode), on)
+ LDFLAGS = @MAKEFILE_LDFLAGS_DEBUG@
LIBS = @MAKEFILE_LIBS_DEBUG@
else
+ LDFLAGS = @MAKEFILE_LDFLAGS_RELEASE@
LIBS = @MAKEFILE_LIBS_RELEASE@
endif
USE_CONTRIB_PETSC = @MAKEFILE_PETSC@
-USE_CONTRIB_SLEPC = @USE_CONTRIB_SLEPC@
+USE_CONTRIB_SLEPC = @MAKEFILE_SLEPC@
USE_CONTRIB_TRILINOS = @MAKEFILE_TRILINOS@
-#USE_CONTRIB_HDF5 = @USE_CONTRIB_HDF5@
-USE_CONTRIB_BLAS = @MAKEFILE_BLAS@
-USE_CONTRIB_LAPACK = @MAKEFILE_LAPACK@
-#USE_CONTRIB_MUMPS = @USE_CONTRIB_MUMPS@
-USE_CONTRIB_ARPACK = @MAKEFILE_ARPACK@
+USE_CONTRIB_HDF5 = @MAKEFILE_HDF5@
+USE_CONTRIB_BLAS = @MAKEFILE_BLAS@
+USE_CONTRIB_LAPACK = @MAKEFILE_LAPACK@
+USE_CONTRIB_MUMPS = @MAKEFILE_MUMPS@
+USE_CONTRIB_ARPACK = @MAKEFILE_ARPACK@
USE_CONTRIB_METIS = @MAKEFILE_METIS@
USE_CONTRIB_UMFPACK = @MAKEFILE_UMFPACK@
USE_CONTRIB_P4EST = @MAKEFILE_P4EST@
@echo =====debug========= $<
@echo Compiling > $(dir $@)/status
@-rm -f $(dir $@)/ncpu*/status
- @$(CXX) $(flags) -c $< -o $@
+ $(CXX) $(flags) -c $< -o $@
%/obj.$(OBJEXT) : %.cc
@echo =====optimized===== $<
@echo Compiling > $(dir $@)/status
@-rm -f $(dir $@)/ncpu*/status
- @$(CXX) $(CXXFLAGS.o) -c $< -o $@
+ $(CXX) $(CXXFLAGS.o) -c $< -o $@
######################################################################
# Don't put $(libraries) into this line since it is already in $^
%/exe : %/obj.g.$(OBJEXT)
@echo =====linking======= $@
@echo Linking > $(dir $@)/status
- @$(CXX) -o $@ $^ $(LDFLAGS) $(LIBS)
+ $(CXX) -o $@ $^ $(LDFLAGS) $(LIBS)
############################################################