Commit 4237a94c authored by GILLES Sebastien's avatar GILLES Sebastien

#1220 CMake: modifications so that AcousticWave model install works as well.

parent 6bcf6eb2
......@@ -39,8 +39,6 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
"MinSizeRel" "RelWithDebInfo")
endif()
set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/${CMAKE_BUILD_TYPE})
set(MOREFEM_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/cmake)
......@@ -95,10 +93,6 @@ set(MOREFEM_COMMON_DEP
${LIB_BLAS}
)
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)
set(MOREFEM_INSTALL_DIR_CMAKE ${MOREFEM_INSTALL_DIR}/cmake)
######################################################
......
......@@ -79,19 +79,13 @@ install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/ DESTINATION ${MOREFEM_INSTALL_DIR_I
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/ DESTINATION ${MOREFEM_INSTALL_DIR_INCL}
FILES_MATCHING PATTERN "*.cxx")
# TODO: also make the multiple lib case work!
# list(APPEND header_files "")
# extract_header_files(MoReFEM header_files ${CMAKE_CURRENT_LIST_DIR})
#message("HEAD" ${header_files})
#
# #### Lifted from Xtl
# #### Lifted and adapted from Xtl
#
add_library(morefem_cmake INTERFACE)
target_include_directories(morefem_cmake INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>)
$<INSTALL_INTERFACE:${PROJECT_NAME}/include>)
target_link_libraries(morefem_cmake INTERFACE ${MOREFEM_MODEL} )
......@@ -101,13 +95,8 @@ target_link_libraries(morefem_cmake INTERFACE ${MOREFEM_MODEL} )
# # Installation
# # ============
#
# #include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
#Alias
#set(MoReFEM_CMAKE_INCLUDE_DIRS ${MOREFEM_INSTALL_DIR_INCL})
include(CMakePackageConfigHelpers)
install(TARGETS morefem_cmake ${MOREFEM_MODEL} Ops Seldon MoReFEMPostProcessing_lib
EXPORT ${PROJECT_NAME}-targets
......@@ -119,16 +108,10 @@ install(TARGETS morefem_cmake ${MOREFEM_MODEL} Ops Seldon MoReFEMPostProcessing_
export(EXPORT ${PROJECT_NAME}-targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake")
# install(FILES ${header_files}
# DESTINATION ${MOREFEM_INSTALL_DIR_INCL})
# set(XTL_CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE
# STRING "install path for xtlConfig.cmake")
configure_package_config_file(../cmake/${PROJECT_NAME}Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION ${MOREFEM_INSTALL_DIR_CMAKE})
#
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
DESTINATION ${MOREFEM_INSTALL_DIR_CMAKE})
......@@ -137,10 +120,6 @@ install(FILES
${CMAKE_CURRENT_BINARY_DIR}/../../cmake/Compiler.cmake
DESTINATION ${MOREFEM_INSTALL_DIR_CMAKE})
#
install(EXPORT ${PROJECT_NAME}-targets
FILE ${PROJECT_NAME}Targets.cmake
DESTINATION ${MOREFEM_INSTALL_DIR_CMAKE})
#
#
#
......@@ -100,3 +100,10 @@ else()
message(FATAL_ERROR "Sorry, your compiler family wasn't recognized. If CMake has updated its flag, please modify the cmake/Compiler.cmake file in MoReFEM accoerdingly. See CMAKE_LANG_COMPILER_ID in CMake tutorial to find out the valid options.")
endif()
set(MOREFEM_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME})
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)
set(MOREFEM_INSTALL_DIR_CMAKE ${MOREFEM_INSTALL_DIR}/cmake)
# morefem cmake module
# This module sets the following variables in your project::
#
# MoReFEM_CMAKE_FOUND - true if morefem found on the system
# MoReFEM_CMAKE_INCLUDE_DIRS - the directory containing morefem headers
# MoReFEM_CMAKE_LIBRARY - empty
# This module sets the following variables in your project:
#
# MoReFEM_CMAKE_INCLUDE_DIRS - the directory containing MoReFEM headers
$. MoReFEM main library
#. MoReFEMPostProcessing_lib MoReFEM post-processing lib
@PACKAGE_INIT@
if(NOT TARGET @PROJECT_NAME@)
message("CMAKE ${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
get_target_property(@PROJECT_NAME@_INCLUDE_DIRS morefem_cmake INTERFACE_INCLUDE_DIRECTORIES)
message("INCL " ${@PROJECT_NAME@_INCLUDE_DIRS})
include("${CMAKE_CURRENT_LIST_DIR}/CustomCommands.cmake")
endif()
\ No newline at end of file
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