]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Initial version v0
authoradmin <salome-admin@opencascade.com>
Tue, 16 Jul 2013 06:32:20 +0000 (06:32 +0000)
committeradmin <salome-admin@opencascade.com>
Tue, 16 Jul 2013 06:32:20 +0000 (06:32 +0000)
CMake/CPPUnitTests.cmake [new file with mode: 0644]
CMake/CommonInstall.cmake [new file with mode: 0644]
CMakeLists.txt [new file with mode: 0644]
src/HYDROData/CMakeLists.txt [new file with mode: 0644]

diff --git a/CMake/CPPUnitTests.cmake b/CMake/CPPUnitTests.cmake
new file mode 100644 (file)
index 0000000..312ca8b
--- /dev/null
@@ -0,0 +1,14 @@
+include_directories(
+  ${CPPUNIT_INCLUDE_DIRS}
+)
+add_definitions(${CPPUNIT_DEFINITIONS})
+
+add_executable(${TEST_EXE} ${TEST_HEADERS} ${TEST_SOURCES})
+
+get_target_property(MyUnitTestTarget ${TEST_EXE} LOCATION)
+# replace $(OutDir) in this path by "Debug" or "Release" because it is not recognized by CTest later
+STRING(REGEX REPLACE "\\$\\(OutDir\\)" "${CMAKE_BUILD_TYPE}" MyUnitTestTarget_upd ${MyUnitTestTarget})
+enable_testing()
+
+add_test(${TEST_EXE} ${MyUnitTestTarget_upd})
+                        
\ No newline at end of file
diff --git a/CMake/CommonInstall.cmake b/CMake/CommonInstall.cmake
new file mode 100644 (file)
index 0000000..7394c23
--- /dev/null
@@ -0,0 +1,2 @@
+install(TARGETS ${PROJECT_LIBRARIES} RUNTIME DESTINATION bin LIBRARY DESTINATION lib)
+install(FILES ${PROJECT_HEADERS} DESTINATION include)
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e50f8bb
--- /dev/null
@@ -0,0 +1,26 @@
+cmake_minimum_required (VERSION 2.6)
+
+project (HYDRO)
+
+SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
+IF(EXISTS ${KERNEL_ROOT_DIR})
+  INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindKERNEL.cmake)
+ELSE(EXISTS ${KERNEL_ROOT_DIR})
+  MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR")
+ENDIF(EXISTS ${KERNEL_ROOT_DIR})
+
+SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI")
+IF(EXISTS ${GUI_ROOT_DIR})
+  INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindGUI.cmake)
+ELSE(EXISTS ${GUI_ROOT_DIR})
+  MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR")
+ENDIF(EXISTS ${GUI_ROOT_DIR})
+
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${KERNEL_ROOT_DIR}/salome_adm/cmake_files ${GUI_ROOT_DIR}/adm_local/cmake_files)
+find_package(SalomeQT4)
+find_package(SalomeCAS)
+find_package(SalomeCPPUNIT)
+
+add_subdirectory (src/HYDROData)
+
+enable_testing()
diff --git a/src/HYDROData/CMakeLists.txt b/src/HYDROData/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8fb55d6
--- /dev/null
@@ -0,0 +1,61 @@
+include(../../CMake/Common.cmake)
+
+set(PROJECT_HEADERS 
+    HYDROData.h
+    HYDROData_Application.h
+    HYDROData_Document.h
+    HYDROData_Iterator.h
+    HYDROData_Object.h
+    HYDROData_Image.h
+)
+
+set(PROJECT_SOURCES 
+    HYDROData_Application.cxx
+    HYDROData_Document.cxx
+    HYDROData_Iterator.cxx
+    HYDROData_Object.cxx
+    HYDROData_Image.cxx
+)
+
+add_definitions(
+  -DHYDRODATA_EXPORTS
+  ${CAS_DEFINITIONS}
+  ${QT_DEFINITIONS}
+)
+
+include_directories(
+  ${CAS_INCLUDE_DIRS}
+  ${QT_INCLUDES}
+  ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+add_library(HYDROData SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
+target_link_libraries(HYDROData ${CAS_OCAF})
+
+set(PROJECT_LIBRARIES HYDROData)
+
+# tests
+if(CPPUNIT_IS_OK)
+
+  set(TEST_HEADERS 
+    test_HYDROData_Document.h
+    test_HYDROData_Object.h
+    test_HYDROData_Iterator.h
+    test_HYDROData_Image.h
+  )
+
+  set(TEST_SOURCES 
+    test_HYDROData_Main.cxx
+    test_HYDROData_Document.cxx
+    test_HYDROData_Object.cxx
+    test_HYDROData_Iterator.cxx
+    test_HYDROData_Image.cxx
+  )
+  
+  set(TEST_EXE test_HYDROData)
+  include(../../CMake/CPPUnitTests.cmake)
+  target_link_libraries(test_HYDROData ${CAS_OCAF} ${QT_LIBRARIES} ${CPPUNIT_LIBS} HYDROData)
+  
+endif(CPPUNIT_IS_OK)
+
+include(../../CMake/CommonInstall.cmake)