Merge pull request #321 from akva2/super_build

Some changes to facilitate building using a super project
This commit is contained in:
Atgeirr Flø Rasmussen 2018-01-29 16:28:09 +01:00 committed by GitHub
commit b46348f074
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,4 @@
project(opm-common C CXX)
cmake_minimum_required (VERSION 2.8)
option(SIBLING_SEARCH "Search for other modules in sibling directories?" ON)

View File

@ -269,7 +269,7 @@ macro(opm_add_test TestName)
# the libraries to link against
if (NOT CURTEST_LIBRARIES)
SET(CURTEST_LIBRARIES "${${CMAKE_PROJECT_NAME}_LIBRARIES}")
SET(CURTEST_LIBRARIES "${${project}_LIBRARIES}")
endif()
# determine if the test should be completely ignored, i.e., the
@ -291,6 +291,9 @@ macro(opm_add_test TestName)
add_executable("${CURTEST_EXE_NAME}" ${CURTEST_EXCLUDE_FROM_ALL} ${CURTEST_SOURCES})
target_link_libraries (${CURTEST_EXE_NAME} ${CURTEST_LIBRARIES})
if(TARGET ${opm}_prepare)
add_dependencies("${CURTEST_EXE_NAME}" ${opm}_prepare)
endif()
if(CURTEST_DEPENDS)
add_dependencies("${CURTEST_EXE_NAME}" ${CURTEST_DEPENDS})
endif()

View File

@ -41,8 +41,10 @@ if(NOT @opm-project_NAME@_FOUND)
if (NOT "@opm-project_TARGET@" STREQUAL "")
# add the library as a target, so that other things in the project including
# this file may depend on it and get rebuild if this library changes.
add_library (@opm-project_TARGET@ UNKNOWN IMPORTED)
set_property (TARGET @opm-project_TARGET@ PROPERTY IMPORTED_LOCATION "${@opm-project_NAME@_LIBRARY}")
if(NOT TARGET @opm-project_TARGET@)
add_library (@opm-project_TARGET@ UNKNOWN IMPORTED)
set_property (TARGET @opm-project_TARGET@ PROPERTY IMPORTED_LOCATION "${@opm-project_NAME@_LIBRARY}")
endif()
endif (NOT "@opm-project_TARGET@" STREQUAL "")
# ensure that we build with support for C++11 to preserve ABI

View File

@ -36,7 +36,7 @@ function parseRevisions {
declare -a BTYPES_ARRAY
for btype in $BTYPES
do
BTYPES_ARRAY=($BTYPES_ARRAY $btype)
BTYPES_ARRAY=(${BTYPES_ARRAY[*]} $btype)
done
TOOLCHAIN_ARRAY=($CMAKE_TOOLCHAIN_FILES)
for index in ${!BTYPES_ARRAY[*]}