2012-05-18 02:45:23 -05:00
|
|
|
cmake_minimum_required (VERSION 2.8)
|
|
|
|
|
|
|
|
SET (ProjectName FileInterface_UnitTests)
|
|
|
|
project ( ${ProjectName} )
|
|
|
|
|
2013-01-17 14:26:12 -06:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
# Qt
|
|
|
|
find_package (Qt4 COMPONENTS QtCore QtGui QtMain QtOpenGl REQUIRED)
|
|
|
|
include (${QT_USE_FILE})
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
${ResInsight_SOURCE_DIR}/ApplicationCode
|
|
|
|
${ResInsight_SOURCE_DIR}/ApplicationCode/ReservoirDataModel
|
|
|
|
${ResInsight_SOURCE_DIR}/ApplicationCode/FileInterface
|
|
|
|
${ResInsight_SOURCE_DIR}/ApplicationCode/ProjectDataModel
|
|
|
|
${ResInsight_SOURCE_DIR}/ThirdParty
|
|
|
|
|
|
|
|
${ResInsight_SOURCE_DIR}/cafProjectDataModel
|
|
|
|
|
|
|
|
${ResInsight_SOURCE_DIR}/CommonCode
|
2012-09-09 05:09:50 -05:00
|
|
|
)
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
set( FILEINTERFACE_CPP_SOURCES
|
2012-06-26 09:10:41 -05:00
|
|
|
../RifEclipseInputFileTools.cpp
|
|
|
|
../RifEclipseOutputFileTools.cpp
|
|
|
|
../RifEclipseRestartFilesetAccess.cpp
|
|
|
|
../RifEclipseRestartDataAccess.cpp
|
|
|
|
../RifEclipseUnifiedRestartFileAccess.cpp
|
|
|
|
../RifReaderEclipseOutput.cpp
|
|
|
|
../RifReaderEclipseInput.cpp
|
|
|
|
../RifReaderMockModel.cpp
|
2012-05-18 02:45:23 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
set( RESERVOIRDATAMODEL_CPP_SOURCES
|
|
|
|
${ResInsight_SOURCE_DIR}/ApplicationCode/ReservoirDataModel/RigCell.cpp
|
|
|
|
${ResInsight_SOURCE_DIR}/ApplicationCode/ReservoirDataModel/RigGridBase.cpp
|
|
|
|
${ResInsight_SOURCE_DIR}/ApplicationCode/ReservoirDataModel/RigLocalGrid.cpp
|
|
|
|
${ResInsight_SOURCE_DIR}/ApplicationCode/ReservoirDataModel/RigMainGrid.cpp
|
|
|
|
${ResInsight_SOURCE_DIR}/ApplicationCode/ReservoirDataModel/RigReservoir.cpp
|
|
|
|
${ResInsight_SOURCE_DIR}/ApplicationCode/ReservoirDataModel/RigReservoirBuilderMock.cpp
|
|
|
|
${ResInsight_SOURCE_DIR}/ApplicationCode/ReservoirDataModel/RigReservoirCellResults.cpp
|
|
|
|
${ResInsight_SOURCE_DIR}/ApplicationCode/ReservoirDataModel/RigWellResults.cpp
|
2012-06-26 09:10:41 -05:00
|
|
|
${ResInsight_SOURCE_DIR}/cafUserInterface/cafProgressInfo.cpp
|
2012-05-18 02:45:23 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
set( CPP_SOURCES
|
|
|
|
${FILEINTERFACE_CPP_SOURCES}
|
|
|
|
${RESERVOIRDATAMODEL_CPP_SOURCES}
|
|
|
|
)
|
|
|
|
|
|
|
|
source_group( "FileInterface" FILES ${FILEINTERFACE_CPP_SOURCES} )
|
|
|
|
source_group( "ReservoirDataModel" FILES ${RESERVOIRDATAMODEL_CPP_SOURCES} )
|
|
|
|
|
|
|
|
set( UNIT_TEST_CPP_SOURCES
|
|
|
|
main.cpp
|
2012-06-26 09:10:41 -05:00
|
|
|
RifReaderEclipseOutput-Test.cpp
|
2012-05-18 02:45:23 -05:00
|
|
|
Ert-Test.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
set( LINK_LIBRARIES
|
|
|
|
CommonCode
|
|
|
|
|
|
|
|
LibViewing
|
|
|
|
LibRender
|
|
|
|
LibGeometry
|
|
|
|
LibCore
|
|
|
|
|
2013-01-17 06:33:59 -06:00
|
|
|
ecl
|
|
|
|
util
|
|
|
|
geometry
|
|
|
|
well
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
${QT_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
add_executable( ${ProjectName}
|
|
|
|
${CPP_SOURCES}
|
|
|
|
${UNIT_TEST_CPP_SOURCES}
|
|
|
|
|
|
|
|
${ResInsight_SOURCE_DIR}/ThirdParty/gtest/gtest-all.cc
|
|
|
|
)
|
|
|
|
|
2012-09-09 05:09:50 -05:00
|
|
|
set( EXTERNAL_LINK_LIBRARIES ${ERT_LIBRARY_LIST} )
|
2012-06-26 09:10:41 -05:00
|
|
|
target_link_libraries( ${ProjectName} ${LINK_LIBRARIES} ${EXTERNAL_LINK_LIBRARIES})
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-26 09:10:41 -05:00
|
|
|
# Copy Dlls
|
2012-05-18 02:45:23 -05:00
|
|
|
if (MSVC)
|
2012-06-26 09:10:41 -05:00
|
|
|
|
|
|
|
# Qt DLLs
|
|
|
|
set (QTLIBLIST QtCore QtCored QtGui QtGuid QtOpenGl QtOpenGld QtNetwork QtNetworkd)
|
2012-05-18 02:45:23 -05:00
|
|
|
foreach (qtlib ${QTLIBLIST})
|
2012-06-26 09:10:41 -05:00
|
|
|
add_custom_command(TARGET ${ProjectName} POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
"${QT_BINARY_DIR}/${qtlib}4.dll"
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>)
|
2012-05-18 02:45:23 -05:00
|
|
|
endforeach( qtlib )
|
2012-06-26 09:10:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
# DLLs ERT depends on
|
2012-09-13 04:41:48 -05:00
|
|
|
# add_custom_command(TARGET ${ProjectName} POST_BUILD
|
|
|
|
# COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
|
|
# "${PROJECT_SOURCE_DIR}/../../../ThirdParty/Ert-windows/bin/"
|
|
|
|
# ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>)
|
2012-06-26 09:10:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
# ERT DLLs
|
2012-09-13 04:41:48 -05:00
|
|
|
# set (ERT_MODULES ecl geometry util well)
|
|
|
|
# foreach (ert_module ${ERT_MODULES})
|
|
|
|
# add_custom_command(TARGET ${ProjectName} POST_BUILD
|
|
|
|
# COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
# "${CMAKE_CURRENT_SOURCE_DIR}/../../../ThirdParty/Ert-windows/${ert_module}/lib/lib${ert_module}.dll"
|
|
|
|
# ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>)
|
|
|
|
# endforeach()
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
endif(MSVC)
|