mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
[Fwk] Added new top level cmakefile for both AppFwk and VizFwk
This commit is contained in:
@@ -6,14 +6,16 @@ include (${QT_USE_FILE})
|
||||
project ( cafProjectDataModel_UnitTests )
|
||||
|
||||
include_directories (
|
||||
${CMAKE_SOURCE_DIR}/cafProjectDataModel
|
||||
${CMAKE_SOURCE_DIR}/cafTests
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
)
|
||||
|
||||
include_directories (
|
||||
${cafPdmCore_SOURCE_DIR}
|
||||
${cafPdmUiCore_SOURCE_DIR}
|
||||
${cafPdmXml_SOURCE_DIR}
|
||||
|
||||
${cafProjectDataModel_SOURCE_DIR}
|
||||
)
|
||||
|
||||
set( PROJECT_FILES
|
||||
@@ -28,7 +30,7 @@ set( PROJECT_FILES
|
||||
# add the executable
|
||||
add_executable (${PROJECT_NAME}
|
||||
${PROJECT_FILES}
|
||||
${CMAKE_SOURCE_DIR}/cafTests/gtest/gtest-all.cpp
|
||||
gtest/gtest-all.cpp
|
||||
)
|
||||
message(${PROJECT_NAME}" - Qt includes : " ${QT_LIBRARIES})
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "Child.h"
|
||||
#include "Parent.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(Parent, "Parent");
|
||||
|
||||
|
||||
@@ -24,8 +26,6 @@ Parent::~Parent()
|
||||
}
|
||||
}
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
TEST(IncludeTest, Basic)
|
||||
{
|
||||
Parent* p = new Parent;
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
|
||||
|
||||
namespace cvftest {
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class Utils
|
||||
{
|
||||
public:
|
||||
static cvf::String getTestDataDir(const cvf::String& unitTestFolder)
|
||||
{
|
||||
#ifdef WIN32
|
||||
std::string exe = std::string(testing::internal::GetArgvs()[0]);
|
||||
#else
|
||||
std::string dir = std::string(testing::internal::FilePath::GetCurrentDir().ToString());
|
||||
std::string exe = dir + std::string("/") + std::string(testing::internal::GetArgvs()[0]);
|
||||
#endif
|
||||
std::string testPath = exe.substr(0, exe.find(unitTestFolder.toStdString())) + std::string("TestData/");
|
||||
|
||||
return testPath;
|
||||
}
|
||||
|
||||
static cvf::String getGLSLDir(const cvf::String& unitTestFolder)
|
||||
{
|
||||
#ifdef WIN32
|
||||
std::string exe = std::string(testing::internal::GetArgvs()[0]);
|
||||
#else
|
||||
std::string dir = std::string(testing::internal::FilePath::GetCurrentDir().ToString());
|
||||
std::string exe = dir + std::string("/") + std::string(testing::internal::GetArgvs()[0]);
|
||||
#endif
|
||||
std::string glslPath = exe.substr(0, exe.find(unitTestFolder.toStdString())) + std::string("../LibRender/glsl/");
|
||||
|
||||
return glslPath;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
18007
Fwk/AppFwk/cafTests/cafProjectDataModel_UnitTests/gtest/gtest.h
Normal file
18007
Fwk/AppFwk/cafTests/cafProjectDataModel_UnitTests/gtest/gtest.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,11 @@
|
||||
#include "TapCvfSpecialization.h"
|
||||
|
||||
|
||||
#include "cafPdmCoreVec3d.h"
|
||||
#include "cafPdmXmlVec3d.h"
|
||||
#include "cafPdmUiCoreVec3d.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(TapCvfSpecialization, "TapCvfSpecialization");
|
||||
|
||||
|
||||
@@ -15,17 +20,6 @@ TapCvfSpecialization::TapCvfSpecialization()
|
||||
CAF_PDM_InitField(&m_matrixField, "m_matrixField", cvf::Mat4d::ZERO, "Zero matrix", "", "", "");
|
||||
CAF_PDM_InitField(&m_colorField, "m_colorField", cvf::Color3f(cvf::Color3::GREEN), "Color3f", "", "", "");
|
||||
|
||||
/*
|
||||
CAF_PDM_InitField(&m_toggleField, "Toggle", false, "Toggle Field", "", "Toggle Field tooltip", " Toggle Field whatsthis");
|
||||
CAF_PDM_InitField(&m_doubleField, "BigNumber", 0.0, "Big Number", "", "Enter a big number here", "This is a place you can enter a big real value if you want");
|
||||
CAF_PDM_InitField(&m_intField, "IntNumber", 0, "Small Number", "", "Enter some small number here", "This is a place you can enter a small integer value if you want");
|
||||
CAF_PDM_InitField(&m_textField, "TextField", QString(""), "Text", "", "Text tooltip", "This is a place you can enter a small integer value if you want");
|
||||
CAF_PDM_InitFieldNoDefault(&m_vecArrayField, "Points", "Selected points", "", "", "");
|
||||
|
||||
m_proxyDoubleField.registerSetMethod(this, &SmallDemoPdmObject::setDoubleMember);
|
||||
m_proxyDoubleField.registerGetMethod(this, &SmallDemoPdmObject::doubleMember);
|
||||
CAF_PDM_InitFieldNoDefault(&m_proxyDoubleField, "ProxyDouble", "Proxy Double", "", "", "");
|
||||
|
||||
m_proxyDoubleField = 0;
|
||||
if (!(m_proxyDoubleField == 3)) { std::cout << "Double is not 3 " << std::endl; }
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -6,13 +6,14 @@
|
||||
#include "cvfVector3.h"
|
||||
#include "cvfMatrix4.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
#include "cafPdmFieldCvfVec3d.h"
|
||||
#include "cafPdmFieldCvfMat4d.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
||||
@@ -29,6 +30,6 @@ public:
|
||||
caf::PdmField<cvf::Vec3d> m_vectorField;
|
||||
caf::PdmField<cvf::Mat4d> m_matrixField;
|
||||
|
||||
//caf::PdmField< std::vector< cvf::Vec3d> > m_vecArrayField;
|
||||
caf::PdmField< std::vector< cvf::Vec3d> > m_vecArrayField;
|
||||
};
|
||||
|
||||
|
||||
41
Fwk/CMakeLists.txt
Normal file
41
Fwk/CMakeLists.txt
Normal file
@@ -0,0 +1,41 @@
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
|
||||
project (TestCafAndVizFwk)
|
||||
|
||||
find_package (Qt4 COMPONENTS QtCore QtGui QtMain QtOpenGl REQUIRED)
|
||||
include (${QT_USE_FILE})
|
||||
|
||||
|
||||
# Libraries
|
||||
add_subdirectory(AppFwk/cafProjectDataModel/cafPdmCore)
|
||||
add_subdirectory(AppFwk/cafProjectDataModel/cafPdmUiCore)
|
||||
add_subdirectory(AppFwk/cafProjectDataModel/cafPdmXml)
|
||||
add_subdirectory(AppFwk/cafProjectDataModel)
|
||||
add_subdirectory(AppFwk/cafCommand)
|
||||
add_subdirectory(AppFwk/cafUserInterface)
|
||||
|
||||
# Unit Tests
|
||||
add_subdirectory(AppFwk/cafTests/cafProjectDataModel_UnitTests)
|
||||
add_subdirectory(AppFwk/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests)
|
||||
add_subdirectory(AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXml_UnitTests)
|
||||
|
||||
# Executables
|
||||
add_subdirectory(AppFwk/cafTests/cafTestApplication)
|
||||
|
||||
|
||||
# Organize sub-projects into folders on Visual Studio
|
||||
# Turn on using solution folders
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
set_property(TARGET cafPdmCore cafPdmUiCore cafPdmXml cafProjectDataModel PROPERTY FOLDER "ProjectDataModel")
|
||||
set_property(TARGET cafPdmCore_UnitTests cafPdmXml_UnitTests cafProjectDataModel_UnitTests PROPERTY FOLDER "UnitTests")
|
||||
|
||||
option (USE_CEE_VIZ "Enable visualization projects" ON)
|
||||
if (USE_CEE_VIZ)
|
||||
add_subdirectory(VizFwk/LibCore)
|
||||
add_subdirectory(AppFwk/cafPdmCvf)
|
||||
|
||||
add_subdirectory(AppFwk/cafTests/cafTestCvfApplication)
|
||||
|
||||
set_property(TARGET LibCore cafPdmCvf cafTestCvfApplication PROPERTY FOLDER "CeeViz")
|
||||
endif()
|
||||
Reference in New Issue
Block a user