dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #19093
Re: [Branch ~dolfin-core/dolfin/main] Rev 4984: CMake fix for Armadillo on Mac.
On Mon, 2010-08-16 at 09:01 +0000, noreply@xxxxxxxxxxxxx wrote:
> ------------------------------------------------------------
> revno: 4984
> committer: Johannes Ring <johannr@xxxxxxxxx>
> branch nick: dolfin
> timestamp: Mon 2010-08-16 10:59:55 +0200
> message:
> CMake fix for Armadillo on Mac.
Nice if you haver a Mac ;), but luck if you don't.
This test was working for me, but it broken now.
Garth
> modified:
> cmake/FindArmadillo.dolfin.cmake
> dolfin/CMakeLists.txt
>
>
> --
> lp:dolfin
> https://code.launchpad.net/~dolfin-core/dolfin/main
>
> Your team DOLFIN Core Team is subscribed to branch lp:dolfin.
> To unsubscribe from this branch go to https://code.launchpad.net/~dolfin-core/dolfin/main/+edit-subscription
> differences between files attachment (revision-diff.txt)
> === modified file 'cmake/FindArmadillo.dolfin.cmake'
> --- cmake/FindArmadillo.dolfin.cmake 2010-08-10 16:01:21 +0000
> +++ cmake/FindArmadillo.dolfin.cmake 2010-08-16 08:59:55 +0000
> @@ -4,6 +4,7 @@
> # ARMADILLO_FOUND - system has Armadillo
> # ARMADILLO_INCLUDE_DIR - the Armadillo include directory
> # ARMADILLO_LIBRARY - the library needed to use Armadillo
> +# ARMADILLO_LINK_FLAGS - linking flags for Armadillo
> # ARMADILLO_VERSION - the Armadillo version string (MAJOR.MINOR.PATCH)
> #
> # Setting these changes the behavior of the search
> @@ -30,12 +31,24 @@
> )
> mark_as_advanced(ARMADILLO_LIBRARY)
>
> + # On mac systems, we likely have to link against the vecLib framework
> + if(APPLE)
> + include(CMakeFindFrameworks)
> + CMAKE_FIND_FRAMEWORKS(vecLib)
> + if(vecLib_FRAMEWORKS)
> + set(ARMADILLO_LINK_FLAGS "-framework vecLib")
> + mark_as_advanced(ARMADILLO_LINK_FLAGS)
> + else(vecLib_FRAMEWORKS)
> + message(STATUS "vecLib framework not found.")
> + endif(vecLib_FRAMEWORKS)
> + endif(APPLE)
> +
> if(ARMADILLO_INCLUDE_DIR AND ARMADILLO_LIBRARY)
> include(CheckCXXSourceRuns)
>
> # These are needed for the try_run and check_cxx_source_runs commands below
> set(CMAKE_REQUIRED_INCLUDES ${ARMADILLO_INCLUDE_DIR})
> - set(CMAKE_REQUIRED_LIBRARIES ${ARMADILLO_LIBRARY})
> + set(CMAKE_REQUIRED_LIBRARIES "${ARMADILLO_LINK_FLAGS} ${ARMADILLO_LIBRARY}")
>
> set(ARMADILLO_CONFIG_TEST_VERSION_CPP ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/check_armadillo/armadillo_config_test_version.cpp)
> file(WRITE ${ARMADILLO_CONFIG_TEST_VERSION_CPP} "
>
> === modified file 'dolfin/CMakeLists.txt'
> --- dolfin/CMakeLists.txt 2010-08-15 10:54:05 +0000
> +++ dolfin/CMakeLists.txt 2010-08-16 08:59:55 +0000
> @@ -50,6 +50,7 @@
> # Armadillo
> list(APPEND DOLFIN_INCLUDE_DIRECTORIES ${ARMADILLO_INCLUDE_DIR})
> list(APPEND DOLFIN_TARGET_LINK_LIBRARIES ${ARMADILLO_LIBRARY})
> +list(APPEND DOLFIN_LINK_FLAGS ${ARMADILLO_LINK_FLAGS})
>
> # Boost
> list(APPEND DOLFIN_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR})
> @@ -177,6 +178,8 @@
> add_library(dolfin SHARED ${DOLFIN_H} ${HEADERS} ${SOURCES})
> set_target_properties(dolfin PROPERTIES ${DOLFIN_LIBRARY_PROPERTIES})
>
> +set_target_properties(dolfin PROPERTIES LINK_FLAGS ${DOLFIN_LINK_FLAGS})
> +
> # Add DOFLIN target libraries
> target_link_libraries(dolfin ${DOLFIN_TARGET_LINK_LIBRARIES})
>
>
Follow ups