Commit 438646ed authored by GILLES Sebastien's avatar GILLES Sebastien

#1217 CMake: enable properly release mode.

parent 30215062
......@@ -79,8 +79,6 @@ else()
set(ALL_LOAD_FLAG "")
endif()
#MESSAGE("ALL_LOAD_FLAG: ${ALL_LOAD_FLAG}")
MESSAGE("Generated with config types: ${CMAKE_CONFIGURATION_TYPES}")
include(cmake/Compiler.cmake)
......@@ -88,8 +86,13 @@ include(cmake/Compiler.cmake)
# Add LTO support in non debug mode.
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)
set(PETSC_SPECIFIC_INCL_DIR ${PETSC_DEBUG_INCL_DIR} )
set(PETSC_SPECIFIC_LIB_DIR ${PETSC_DEBUG_LIB_DIR} )
add_definitions(-DSELDON_CHECK_BOUNDS -DSELDON_CHECK_DIMENSIONS -DDEBUG=1)
else()
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
set(PETSC_SPECIFIC_INCL_DIR ${PETSC_RELEASE_INCL_DIR} )
set(PETSC_SPECIFIC_LIB_DIR ${PETSC_RELEASE_LIB_DIR} )
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Sources /
......@@ -98,20 +101,19 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Sources /
${SELDON_DIR} /
${OPEN_MPI_INCL_DIR} /
${PETSC_GENERAL_INCL_DIR} /
${PETSC_DEBUG_INCL_DIR} /
${PETSC_SPECIFIC_INCL_DIR} /
${PARMETIS_INCL_DIR} /
${LUA_INCL_DIR} /
${BOOST_INCL_DIR}
)
# To complete for release mode! (see SCons)
add_definitions(-DOPS_WITH_EXCEPTION)
add_definitions(-DSELDON_WITH_LAPACK -DSELDON_WITH_LAPACK -DSELDON_WITH_BLAS -DSELDON_WITH_COMPILED_LIBRARY -DSELDON_CHECK_BOUNDS -DSELDON_CHECK_DIMENSIONS)
add_definitions(-DSELDON_WITH_LAPACK -DSELDON_WITH_BLAS -DSELDON_WITH_COMPILED_LIBRARY)
morefem_find_library(LIB_OPEN_MPI "mpi" ${OPEN_MPI_LIB_DIR} "Openmpi")
morefem_find_library(LIB_OPEN_MPI_CXX "mpi_cxx" ${OPEN_MPI_LIB_DIR} "Openmpi (C++)")
morefem_find_library(LIB_PETSC "petsc" ${PETSC_DEBUG_LIB_DIR} "Petsc")
morefem_find_library(LIB_PETSC "petsc" ${PETSC_SPECIFIC_LIB_DIR} "Petsc")
morefem_find_library(LIB_PARMETIS "parmetis" ${PARMETIS_LIB_DIR} "Parmetis")
morefem_find_library(LIB_LUA "lua" ${LUA_LIB_DIR} "Lua")
morefem_find_library(LIB_BOOST_FILESYSTEM "boost_filesystem" ${BOOST_LIB_DIR} "Boost filesystem")
......@@ -139,6 +141,7 @@ set(MOREFEM_COMMON_DEP
set(MOREFEM_INSTALL_DIR_EXE ${MOREFEM_INSTALL_DIR}/bin)
set(MOREFEM_INSTALL_DIR_LIB ${MOREFEM_INSTALL_DIR}/lib)
set(MOREFEM_INSTALL_DIR_INCL ${MOREFEM_INSTALL_DIR}/include)
######################################################
# Settings to make shared library work correctly
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment