-# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2014 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
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/UseQT4EXT.cmake)
+INCLUDE(UseQt4Ext)
+# --- options ---
+
+# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDE_DIRS}
+ ${QT_INCLUDES}
${PYTHON_INCLUDE_DIRS}
- ${KERNEL_ROOT_DIR}/include/salome
- ${CMAKE_CURRENT_SOURCE_DIR}/../Event
+ ${PROJECT_SOURCE_DIR}/src/Event
)
-SET(COMMON_FLAGS "${QT_DEFINITIONS} ${PYTHON_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
-SET(COMMON_LIBS ${PYTHON_LIBS} ${QT_LIBS} Event)
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(${QT_DEFINITIONS} ${PYTHON_DEFINITIONS})
-SET(GUI_HEADERS PyInterp_Watcher.h)
-QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
+# libraries to link to
+SET(_link_LIBRARIES ${QT_LIBRARIES} ${PYTHON_LIBRARIES} Event)
-SET(PyInterp_SOURCES
- PyInterp_Interp.cxx
- PyInterp_Dispatcher.cxx
-)
+# --- headers ---
-ADD_LIBRARY(PyInterp SHARED ${PyInterp_SOURCES} ${GUI_HEADERS_MOC})
-SET_TARGET_PROPERTIES(PyInterp PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
-TARGET_LINK_LIBRARIES(PyInterp ${COMMON_LIBS})
-INSTALL(TARGETS PyInterp DESTINATION ${GUI_salomelib_LIBS})
+# header files / to be processed by moc / internal
+# TODO: check for MSVS project
+SET(_moc_internal_HEADERS PyInterp_Watcher.h)
-SET(COMMON_HEADERS_H
+# header files / no moc processing
+SET(_other_HEADERS
PyInterp.h
- PyInterp_Interp.h
PyInterp_Dispatcher.h
+ PyInterp_Event.h
+ PyInterp_Interp.h
+ PyInterp_Request.h
)
-INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${GUI_salomeinclude_HEADERS})
+
+# header files / to install
+SET(PyInterp_HEADERS ${_other_HEADERS})
+
+# --- sources ---
+
+# sources / moc wrappings
+QT4_WRAP_CPP(_moc_SOURCES ${_moc_internal_HEADERS})
+
+# sources / static
+SET(_other_SOURCES
+ PyInterp_Dispatcher.cxx
+ PyInterp_Event.cxx
+ PyInterp_Interp.cxx
+ PyInterp_Request.cxx
+)
+
+# sources / to compile
+SET(PyInterp_SOURCES ${_other_SOURCES} ${_moc_SOURCES})
+
+# --- rules ---
+
+ADD_LIBRARY(PyInterp ${PyInterp_SOURCES})
+TARGET_LINK_LIBRARIES(PyInterp ${_link_LIBRARIES})
+INSTALL(TARGETS PyInterp EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+INSTALL(FILES ${PyInterp_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})