Merge pull request #312 from rolk/312_nolib

Allow several options to be used even if we don't have a library
This commit is contained in:
Bård Skaflestad
2013-08-08 01:22:16 -07:00
3 changed files with 13 additions and 3 deletions

View File

@@ -38,7 +38,13 @@ macro (opm_compile opm)
# pre-compile common headers; this is setup *after* the library to pick # pre-compile common headers; this is setup *after* the library to pick
# up extra options set there # up extra options set there
if (PRECOMPILE_HEADERS) if (PRECOMPILE_HEADERS)
# if we have no library, then use the static setting as this will
# build the same way as any test programs (no -fPIC option)
if (${opm}_TARGET)
get_target_property (_type ${${opm}_TARGET} TYPE) get_target_property (_type ${${opm}_TARGET} TYPE)
else ()
set (_type "STATIC")
endif ()
precompile_header (CXX ${_type} precompile_header (CXX ${_type}
HEADER "${${opm}_PRECOMP_CXX_HEADER}" HEADER "${${opm}_PRECOMP_CXX_HEADER}"
TARGET ${opm}_CXX_pch TARGET ${opm}_CXX_pch

View File

@@ -225,7 +225,9 @@ opm_doc (${project} ${doxy_dir})
# provide compatibility with using this build in dunecontrol # provide compatibility with using this build in dunecontrol
include (DuneCompat) include (DuneCompat)
include (LibtoolArchives) include (LibtoolArchives)
configure_la (${project} ${${project}_TARGET} ${project}_LIBTOOL_ARCHIVE) if (${project}_TARGET)
configure_la (${project} ${${project}_TARGET} ${project}_LIBTOOL_ARCHIVE)
endif ()
### clean in-source builds ### ### clean in-source builds ###
include (OpmDistClean) include (OpmDistClean)

View File

@@ -46,8 +46,10 @@ else ()
# the target above gets built every time thanks to the "ALL" modifier, # the target above gets built every time thanks to the "ALL" modifier,
# but it must also be done before the main library so it can pick up # but it must also be done before the main library so it can pick up
# any changes it does. # any changes it does.
if (${project}_TARGET)
add_dependencies (${${project}_TARGET} update-version) add_dependencies (${${project}_TARGET} update-version)
endif () endif ()
endif ()
endif () endif ()
# safety precaution: check that we don't have version number mismatch. # safety precaution: check that we don't have version number mismatch.