diff --git a/ThirdParty/Ert/CMakeLists.txt b/ThirdParty/Ert/CMakeLists.txt index 332b1696e8..5e2e1e42b4 100644 --- a/ThirdParty/Ert/CMakeLists.txt +++ b/ThirdParty/Ert/CMakeLists.txt @@ -352,6 +352,9 @@ if (ENABLE_PYTHON) endif() endif() -install(EXPORT ecl-config DESTINATION share/cmake/ecl) +if (INSTALL_ERT) + install(EXPORT ecl-config DESTINATION share/cmake/ecl) +endif() + export(TARGETS ecl FILE eclConfig.cmake) export(PACKAGE ecl) diff --git a/ThirdParty/Ert/lib/CMakeLists.txt b/ThirdParty/Ert/lib/CMakeLists.txt index 3a71859bd1..d8799e3b5f 100644 --- a/ThirdParty/Ert/lib/CMakeLists.txt +++ b/ThirdParty/Ert/lib/CMakeLists.txt @@ -205,7 +205,7 @@ endif () set_target_properties(ecl PROPERTIES VERSION ${ECL_VERSION_MAJOR}.${ECL_VERSION_MINOR} SOVERSION ${ECL_VERSION_MAJOR}) - +if (INSTALL_ERT) install(TARGETS ecl EXPORT ecl-config ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -230,6 +230,7 @@ if (ERT_BUILD_CXX) PATTERN *.hpp ) endif () +endif() if (NOT BUILD_TESTS) return ()