From: ana Date: Wed, 19 Sep 2012 15:12:31 +0000 (+0000) Subject: Compilation SALOME by CMake(windows/linux) X-Git-Tag: V6_main_FINAL~489 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e2e8b6c6fbb8fc7b28bf428c59212c3c4c30fdab;p=tools%2Fmedcoupling.git Compilation SALOME by CMake(windows/linux) --- diff --git a/src/MEDOP/gui/CMakeLists.txt b/src/MEDOP/gui/CMakeLists.txt index 2c51ba0a0..bbc8a9a49 100644 --- a/src/MEDOP/gui/CMakeLists.txt +++ b/src/MEDOP/gui/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2012 CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -33,34 +33,67 @@ SET(MEDOPGUI_SOURCES ) SET(MEDOPGUI_HEADERS MEDOPModule.hxx MEDEventListener_i.hxx WorkspaceController.hxx DatasourceController.hxx) -#SET(MEDGUI_FORMS MEDGUIFileContentDial.ui MEDGUISelectComponents.ui) -#SET(MEDGUI_RESOURCES images.qrc) -QT4_WRAP_CPP(MEDGUI_HEADERS_MOC ${MEDOPGUI_HEADERS}) -#QT4_WRAP_UI(MEDGUI_FORMS_HEADERS ${MEDGUI_FORMS}) -#QT4_ADD_RESOURCES(MEDGUI_RESOURCES_RCC ${MEDGUI_RESOURCES}) +QT4_WRAP_CPP(MEDOPGUI_HEADERS_MOC ${MEDOPGUI_HEADERS}) INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIRS} ${CAS_INCLUDE_DIRS} ${BOOST_INCLUDE_DIRS} + ${PTHREAD_INCLUDE_DIRS} ${KERNEL_ROOT_DIR}/include/salome ${GUI_ROOT_DIR}/include/salome ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/../../../idl - ${CMAKE_CURRENT_SOURCE_DIR}/../cmp ${CMAKE_CURRENT_SOURCE_DIR}/dialogs ${CMAKE_CURRENT_BINARY_DIR}/dialogs - ${CMAKE_CURRENT_BINARY_DIR}/../../.. - ) + ${CMAKE_CURRENT_SOURCE_DIR}/../cmp + ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDGUI + ${CMAKE_BINARY_DIR}/idl + ${CMAKE_BINARY_DIR} +) SET(MEDOPGUITS_SOURCES MEDOP_msg_en.ts MEDOP_msg_fr.ts - ) +) +SET(COMMON_DEFINITIONS "${MED3_DEFINITIONS} ${XDR_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS} ${PLATFORM_DEFINITIONS} ${OMNIORB_DEFINITIONS}") +SET(COMMON_FLAGS + ${CAS_KERNEL} + ${QT_MT_LIBS} + ${OMNIORB_LIBS} + ${PLATFORM_LIBS} + ${BOOST_LIBS} + SalomeIDLMED + MEDOPGUI_dialogs + MEDOPFactoryEngine + ${qtx} + ${suit} + ${SalomeObject} + ${SalomeLifeCycleCORBA} + ${SalomeKernelHelpers} + ${SalomeApp} + ${SalomeGuiHelpers} + ${SalomeTreeData} + ${OpUtil} + ${CAM} + ${LightApp} + ${PyConsole} + ${SalomeGuiHelpers} +) + #-D__WITH_MEDMEMGUI__ libMEDGUI.la -ADD_LIBRARY(MEDOPGUI SHARED ${MEDOPGUI_SOURCES} ${MEDGUI_HEADERS_MOC}) -SET_TARGET_PROPERTIES(MEDOPGUI PROPERTIES COMPILE_FLAGS "${HDF5_DEFINITIONS} ${MED3_DEFINITIONS} ${XDR_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS}") -TARGET_LINK_LIBRARIES(MEDOPGUI MEDOPGUI_dialogs MEDOPFactoryEngine SalomeIDLMED ${QT_MT_LIBS} ${CAS_KERNEL} ${BOOST_LIBS} ${GUI_LDFLAGS} ${SalomeApp} ${CAM} ${LightApp} ${qtx} ${suit} ${SalomeObject} ${SalomeTreeData}) +IF(WITH_MEDMEMGUI) + SET(COMMON_DEFINITIONS "${COMMON_DEFINITIONS} -D__WITH_MEDMEMGUI__") + SET(COMMON_FLAGS ${COMMON_FLAGS} MEDGUI) +ENDIF(WITH_MEDMEMGUI) + +ADD_LIBRARY(MEDOPGUI SHARED ${MEDOPGUI_SOURCES} ${MEDOPGUI_HEADERS_MOC}) +SET_TARGET_PROPERTIES(MEDOPGUI PROPERTIES COMPILE_FLAGS ${COMMON_DEFINITIONS}) +TARGET_LINK_LIBRARIES(MEDOPGUI ${COMMON_FLAGS}) + INSTALL(TARGETS MEDOPGUI DESTINATION ${MED_salomelib_LIBS}) QT4_INSTALL_TS_RESOURCES("${MEDOPGUITS_SOURCES}" "${MED_salomeres_DATA}") + +FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") +INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${MED_salomeinclude_HEADERS}) + diff --git a/src/MEDOP/gui/dialogs/CMakeLists.txt b/src/MEDOP/gui/dialogs/CMakeLists.txt index 30d893b10..0a0ca592b 100644 --- a/src/MEDOP/gui/dialogs/CMakeLists.txt +++ b/src/MEDOP/gui/dialogs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2012 CEA/DEN, EDF R&D +# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -31,41 +31,61 @@ MACRO (QT4_WRAP_UI_XX outfiles ) MAIN_DEPENDENCY ${infile}) SET(${outfiles} ${${outfiles}} ${outfile}) ENDFOREACH (it) - ENDMACRO (QT4_WRAP_UI_XX) -SET(MEDOPGUI_dialogs_SOURCES - GenericDialog.cxx - DlgAlias.cxx - DlgUseInWorkspace.cxx - DlgChangeUnderlyingMesh.cxx - DlgImageToMed.cxx +SET(MEDOPGUI_dialogs_FORMS + GenericDialog.ui + DlgAlias.ui + DlgUseInWorkspace.ui + DlgChangeUnderlyingMesh.ui + DlgImageToMed.ui ) - -SET(MEDOPGUI_dialogs_HEADERS GenericDialog.hxx DlgAlias.hxx DlgUseInWorkspace.hxx DlgChangeUnderlyingMesh.hxx DlgImageToMed.hxx) -SET(MEDOPGUI_dialogs_FORMS DlgAlias.ui DlgChangeUnderlyingMesh.ui DlgImageToMed.ui DlgUseInWorkspace.ui GenericDialog.ui) -#SET(MEDGUI_RESOURCES images.qrc) - -QT4_WRAP_CPP(MEDOPGUI_dialogs_HEADERS_MOC ${MEDOPGUI_dialogs_HEADERS}) QT4_WRAP_UI_XX(MEDOPGUI_dialogs_FORMS_HEADERS ${MEDOPGUI_dialogs_FORMS}) -#QT4_ADD_RESOURCES(MEDGUI_RESOURCES_RCC ${MEDGUI_RESOURCES}) + +SET(MEDOPGUI_dialogs_FILES + GenericDialog.hxx + DlgAlias.hxx + DlgUseInWorkspace.hxx + DlgChangeUnderlyingMesh.hxx + DlgImageToMed.hxx +) +QT4_WRAP_CPP(MEDOPGUI_dialogs_HEADERS_MOC ${MEDOPGUI_dialogs_FILES}) INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIRS} ${CAS_INCLUDE_DIRS} ${BOOST_INCLUDE_DIRS} + ${PTHREAD_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} ${KERNEL_ROOT_DIR}/include/salome ${GUI_ROOT_DIR}/include/salome - ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. - ) +) + +SET(MEDOPGUI_dialogs_SOURCES + GenericDialog.cxx + DlgAlias.cxx + DlgUseInWorkspace.cxx + DlgChangeUnderlyingMesh.cxx + DlgImageToMed.cxx +) ADD_LIBRARY(MEDOPGUI_dialogs SHARED ${MEDOPGUI_dialogs_SOURCES} ${MEDOPGUI_dialogs_HEADERS_MOC} ${MEDOPGUI_dialogs_FORMS_HEADERS}) -SET_TARGET_PROPERTIES(MEDOPGUI_dialogs PROPERTIES COMPILE_FLAGS "${CAS_DEFINITIONS} ${BOOST_DEFINITIONS}") -TARGET_LINK_LIBRARIES(MEDOPGUI_dialogs ${QT_MT_LIBS} ${CAS_KERNEL} ${BOOST_LIBS} ${GUI_LDFLAGS} ${SalomeApp} ${CAM} ${LightApp} ${qtx} ${suit} ${SalomeObject} ${SalomeGuiHelpers}) +SET_TARGET_PROPERTIES(MEDOPGUI_dialogs PROPERTIES COMPILE_FLAGS "${CAS_DEFINITIONS} ${BOOST_DEFINITIONS} ${PLATFORM_DEFINITIONS} ${OMNIORB_DEFINITIONS}") +TARGET_LINK_LIBRARIES(MEDOPGUI_dialogs ${CAS_KERNEL} ${QT_LIBS} ${SalomeIDLKernel} ${SalomeGuiHelpers} ${OMNIORB_LIBS} ${qtx} ${suit} ${PLATFORM_LIBS} ${SalomeLifeCycleCORBA} ${SalomeKernelHelpers} ${SalomeGuiHelpers}) INSTALL(TARGETS MEDOPGUI_dialogs DESTINATION ${MED_salomelib_LIBS}) +# +# --------------------------------------------------------- +# Unit test programs +# --------------------------------------------------------- +# ADD_EXECUTABLE(dlgTester dlgTester.cxx) -SET_TARGET_PROPERTIES(dlgTester PROPERTIES COMPILE_FLAGS "${CAS_DEFINITIONS} ${BOOST_DEFINITIONS}") -TARGET_LINK_LIBRARIES(dlgTester MEDOPGUI_dialogs) -#ADD_TEST(dlgTester dlgTester) \ No newline at end of file +SET_TARGET_PROPERTIES(dlgTester PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS}") +TARGET_LINK_LIBRARIES(dlgTester MEDOPGUI_dialogs ${QT_LIBS} ${PLATFORM_LIBS}) +INSTALL(TARGETS dlgTester DESTINATION ${MED_salomebin_BINS}) +#ADD_TEST(dlgTester dlgTester) + +FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") +INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${MED_salomeinclude_HEADERS}) +