From b0c60f0e4a2d305a91df35d6cb303e2fb2ec5f54 Mon Sep 17 00:00:00 2001 From: Ivar Ursin Nikolaisen Date: Mon, 27 Aug 2012 13:34:00 +0200 Subject: [PATCH 1/6] Fix libQtCore link failure because of missing libz libQtCore often, but not always includes the required functionality from libz. This is needed for example on openSUSE 12.1 and 12.2. --- ApplicationCode/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/ApplicationCode/CMakeLists.txt b/ApplicationCode/CMakeLists.txt index 59432827a5..349e1940b2 100644 --- a/ApplicationCode/CMakeLists.txt +++ b/ApplicationCode/CMakeLists.txt @@ -234,6 +234,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") ${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/Ert/geometry/lib/libgeometry.a ${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/Ert/well/lib/libwell.a lapack + z # In case libz is not included in libQtCore ) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows") set ( EXTERNAL_LINK_LIBRARIES From 543dce2ff0ef12be140fbd4be689490a09bb8f8b Mon Sep 17 00:00:00 2001 From: Ivar Ursin Nikolaisen Date: Mon, 27 Aug 2012 14:03:59 +0200 Subject: [PATCH 2/6] Add link to librt in VisualizationModules/LibCore This is needed at least on openSUSE 12.1 and 12.2. --- VisualizationModules/LibCore/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/VisualizationModules/LibCore/CMakeLists.txt b/VisualizationModules/LibCore/CMakeLists.txt index 080f4c674d..22dc5fee1f 100644 --- a/VisualizationModules/LibCore/CMakeLists.txt +++ b/VisualizationModules/LibCore/CMakeLists.txt @@ -76,3 +76,13 @@ cvfVector4.cpp add_library(${PROJECT_NAME} ${CEE_HEADER_FILES} ${CEE_SOURCE_FILES}) + +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + set ( EXTERNAL_LINK_LIBRARIES + rt + ) +endif() + + +target_link_libraries(LibCore ${EXTERNAL_LINK_LIBRARIES}) + From 85c96b556702f6d537ed4528c9c9d817689d6c82 Mon Sep 17 00:00:00 2001 From: Ivar Ursin Nikolaisen Date: Mon, 27 Aug 2012 15:22:03 +0200 Subject: [PATCH 3/6] Add libpthread link to unit tests that require it. --- .../FileInterface/FileInterface_UnitTests/CMakeLists.txt | 1 + .../ModelVisualization_UnitTests/CMakeLists.txt | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt b/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt index c7d3d373d0..5723a2d2a4 100644 --- a/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt +++ b/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt @@ -103,6 +103,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") ${CMAKE_CURRENT_SOURCE_DIR}/../../../ThirdParty/Ert/geometry/lib/libgeometry.a ${CMAKE_CURRENT_SOURCE_DIR}/../../../ThirdParty/Ert/well/lib/libwell.a lapack + pthread ) elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") set ( EXTERNAL_LINK_LIBRARIES diff --git a/ApplicationCode/ModelVisualization/ModelVisualization_UnitTests/CMakeLists.txt b/ApplicationCode/ModelVisualization/ModelVisualization_UnitTests/CMakeLists.txt index dcc61ebd1c..fa35ac9b5a 100644 --- a/ApplicationCode/ModelVisualization/ModelVisualization_UnitTests/CMakeLists.txt +++ b/ApplicationCode/ModelVisualization/ModelVisualization_UnitTests/CMakeLists.txt @@ -52,6 +52,11 @@ add_executable( ${ProjectName} ) -target_link_libraries( ${ProjectName} ${LINK_LIBRARIES}) +set( EXTERNAL_LINK_LIBRARIES + pthread +) + + +target_link_libraries( ${ProjectName} ${LINK_LIBRARIES} ${EXTERNAL_LINK_LIBRARIES}) From bfb2a75a5662f5b0af3bbbff3c982ddede4acd76 Mon Sep 17 00:00:00 2001 From: Ivar Ursin Nikolaisen Date: Mon, 27 Aug 2012 15:25:03 +0200 Subject: [PATCH 4/6] Add libz to unit test that requires it. --- .../FileInterface/FileInterface_UnitTests/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt b/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt index 5723a2d2a4..336fe0fae3 100644 --- a/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt +++ b/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt @@ -104,6 +104,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") ${CMAKE_CURRENT_SOURCE_DIR}/../../../ThirdParty/Ert/well/lib/libwell.a lapack pthread + z # In case libz is not included in libQtCore ) elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") set ( EXTERNAL_LINK_LIBRARIES From 047ca6d380b7db4d8e5b8e7a7ad9cfe78d45a0df Mon Sep 17 00:00:00 2001 From: Ivar Ursin Nikolaisen Date: Mon, 27 Aug 2012 15:28:35 +0200 Subject: [PATCH 5/6] Add libpthread link to ReservoirDataModel_UnitTests --- .../ReservoirDataModel_UnitTests/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/ApplicationCode/ReservoirDataModel/ReservoirDataModel_UnitTests/CMakeLists.txt b/ApplicationCode/ReservoirDataModel/ReservoirDataModel_UnitTests/CMakeLists.txt index 840a1142ab..88f7be71c3 100644 --- a/ApplicationCode/ReservoirDataModel/ReservoirDataModel_UnitTests/CMakeLists.txt +++ b/ApplicationCode/ReservoirDataModel/ReservoirDataModel_UnitTests/CMakeLists.txt @@ -60,6 +60,7 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") ${CMAKE_CURRENT_SOURCE_DIR}/../../../ThirdParty/Ert/util/lib/libutil.a ${CMAKE_CURRENT_SOURCE_DIR}/../../../ThirdParty/Ert/well/lib/libwell.a lapack + pthread ) # Linux specific code From 94d00b4870415b9326557815c1e62370c5e82bb7 Mon Sep 17 00:00:00 2001 From: Ivar Ursin Nikolaisen Date: Fri, 31 Aug 2012 13:16:47 +0200 Subject: [PATCH 6/6] Replace tabs with spaces in conformance with style --- ApplicationCode/CMakeLists.txt | 2 +- .../FileInterface/FileInterface_UnitTests/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/CMakeLists.txt b/ApplicationCode/CMakeLists.txt index 349e1940b2..c987439cd3 100644 --- a/ApplicationCode/CMakeLists.txt +++ b/ApplicationCode/CMakeLists.txt @@ -234,7 +234,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") ${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/Ert/geometry/lib/libgeometry.a ${CMAKE_CURRENT_SOURCE_DIR}/../ThirdParty/Ert/well/lib/libwell.a lapack - z # In case libz is not included in libQtCore + z # In case libz is not included in libQtCore ) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows") set ( EXTERNAL_LINK_LIBRARIES diff --git a/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt b/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt index 336fe0fae3..609fcfd50f 100644 --- a/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt +++ b/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt @@ -104,7 +104,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") ${CMAKE_CURRENT_SOURCE_DIR}/../../../ThirdParty/Ert/well/lib/libwell.a lapack pthread - z # In case libz is not included in libQtCore + z # In case libz is not included in libQtCore ) elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") set ( EXTERNAL_LINK_LIBRARIES