Commit 77463ac1 authored by GILLES Sebastien's avatar GILLES Sebastien

#1220 CMake: trying to make the find package work (code mostly commented at this point).

parent 47d95b4f
......@@ -140,6 +140,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)
set(MOREFEM_INSTALL_DIR_CMAKE ${MOREFEM_INSTALL_DIR}/cmake)
######################################################
# Settings to make shared library work correctly
......
......@@ -65,9 +65,6 @@ include(PostProcessing/CMakeLists.txt)
include(ModelInstances/CMakeLists.txt)
include(Test/CMakeLists.txt)
# How to get the list of files related to a library. But XCode project built is unstable; something is probably amiss in what I do.
#get_property(core_sources TARGET ${MOREFEM_CORE} PROPERTY SOURCES)
#string(REPLACE "//" " /" core_sources ${core_sources})
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/ DESTINATION ${MOREFEM_INSTALL_DIR_INCL}
FILES_MATCHING PATTERN "*.hpp")
......@@ -75,3 +72,56 @@ 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 "*.hxx")
message("CMAKE_CXX_FLAGS = " ${CMAKE_CXX_FLAGS})
# TODO: also make the multiple lib case work!
# list(APPEND header_files "")
# extract_header_files(MoReFEM header_files)
#
# #### Lifted from Xtl
#
# add_library(morefem INTERFACE)
# # target_include_directories(xtl INTERFACE $<BUILD_INTERFACE:${XTL_INCLUDE_DIR}>
# # $<INSTALL_INTERFACE:include>)
# #
#
#
# # Installation
# # ============
#
# #include(GNUInstallDirs)
# include(CMakePackageConfigHelpers)
#
# install(TARGETS morefem
# EXPORT ${PROJECT_NAME}-targets)
#
# # Makes the project importable from the build directory
# export(EXPORT ${PROJECT_NAME}-targets
# FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake")
#
# # install(FILES ${XTL_HEADERS}
# # DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/xtl)
#
# # 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}/../cmake/${PROJECT_NAME}Config.cmake"
# INSTALL_DESTINATION ${MOREFEM_INSTALL_DIR_CMAKE})
#
# write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
# VERSION 1.0
# COMPATIBILITY AnyNewerVersion)
#
#
# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
# ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
# DESTINATION ${MOREFEM_INSTALL_DIR_CMAKE})
#
# install(EXPORT ${PROJECT_NAME}-targets
# FILE ${PROJECT_NAME}Targets.cmake
# DESTINATION ${MOREFEM_INSTALL_DIR_CMAKE})
#
#
#
......@@ -5,6 +5,7 @@ include(TestCXXAcceptsFlag)
macro(add_cxx_compiler_flag _flag)
string(REPLACE "-" "_" _flag_var ${_flag})
check_cxx_accepts_flag("${_flag}" CXX_COMPILER_${_flag_var}_OK)
if(CXX_COMPILER_${_flag_var}_OK)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}")
endif()
......
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