#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+PROJECT(SALOME_KERNEL)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
# Python
+set(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR} CACHE PATH "Path to Python directory")
+if(EXISTS ${PYTHON_ROOT_DIR})
+ set(CMAKE_INCLUDE_PATH ${PYTHON_ROOT_DIR}/include)
+ set(CMAKE_LIBRARY_PATH ${PYTHON_ROOT_DIR}/lib)
+ set(CMAKE_PROGRAM_PATH ${PYTHON_ROOT_DIR}/bin)
+endif(EXISTS ${PYTHON_ROOT_DIR})
find_package(PythonInterp REQUIRED)
# Set PythonLibs_FIND_VERSION To avoid problems when several versions are in the system
SET(PythonLibs_FIND_VERSION ${PYTHON_VERSION_STRING})
set(PYLOGLEVEL WARNING)
# Swig
+set(SWIG_ROOT_DIR $ENV{SWIG_ROOT_DIR} CACHE PATH "Path to Swig directory")
+if(EXISTS ${SWIG_ROOT_DIR})
+ set(CMAKE_INCLUDE_PATH ${SWIG_ROOT_DIR}/include)
+ set(CMAKE_LIBRARY_PATH ${SWIG_ROOT_DIR}/lib)
+ set(CMAKE_PROGRAM_PATH ${SWIG_ROOT_DIR}/bin)
+endif(EXISTS ${SWIG_ROOT_DIR})
find_package(SWIG REQUIRED)
# LIBXML2
-set(LIBXML2_DIR $ENV{LIBXML2_DIR} CACHE PATH "Path to LibXml2 directory")
-if(EXISTS ${LIBXML2_DIR})
- set(CMAKE_INCLUDE_PATH ${LIBXML2_DIR}/include)
- set(CMAKE_LIBRARY_PATH ${LIBXML2_DIR}/lib)
-endif(EXISTS ${LIBXML2_DIR})
+set(LIBXML2_ROOT_DIR $ENV{LIBXML2_ROOT_DIR} CACHE PATH "Path to LibXml2 directory")
+if(EXISTS ${LIBXML2_ROOT_DIR})
+ set(CMAKE_INCLUDE_PATH ${LIBXML2_ROOT_DIR}/include)
+ set(CMAKE_LIBRARY_PATH ${LIBXML2_ROOT_DIR}/lib)
+ set(CMAKE_PROGRAM_PATH ${LIBXML2_ROOT_DIR}/bin)
+endif(EXISTS ${LIBXML2_ROOT_DIR})
find_package(LibXml2 REQUIRED)
if(${LIBXML2_VERSION_STRING} VERSION_LESS "2.7.8")
- message(FATAL_ERROR "LIbXml2 required version is 2.7.8, version is ${LIBXML2_VERSION_STRING} , please defined LIBXML2_DIR as environment or cmake variable")
+ message(FATAL_ERROR "LIbXml2 required version is 2.7.8, version is ${LIBXML2_VERSION_STRING} , please defined LIBXML2_ROOT_DIR as environment or cmake variable")
endif(${LIBXML2_VERSION_STRING} VERSION_LESS "2.7.8")
# HDF5
+set(HDF5_ROOT_DIR $ENV{HDF5_ROOT_DIR} CACHE PATH "Path to Hdf5 directory")
+if(EXISTS ${HDF5_ROOT_DIR})
+ set(CMAKE_INCLUDE_PATH ${HDF5_ROOT_DIR}/include)
+ set(CMAKE_LIBRARY_PATH ${HDF5_ROOT_DIR}/lib)
+ set(CMAKE_PROGRAM_PATH ${HDF5_ROOT_DIR}/bin)
+endif(EXISTS ${HDF5_ROOT_DIR})
find_package(HDF5 COMPONENTS C REQUIRED)
if (HDF5_FOUND)
- set(HDF5_DEFINITIONS "-DH5_USE_16_API -D_HDF5USEDLL_ ${HDF5_DEFINITIONS}" )
+ set(HDF5_DEFINITIONS "-DH5_USE_16_API ${HDF5_DEFINITIONS}" )
+ if(WINDOWS)
+ set(HDF5_DEFINITIONS "-D_HDF5USEDLL_ ${HDF5_DEFINITIONS}" )
+ endif(WINDOWS)
endif(HDF5_FOUND)
# MPI
if(SALOME_USE_MPI OR HDF5_IS_PARALLEL)
+ set(MPI_ROOT_DIR $ENV{MPI_ROOT_DIR} CACHE PATH "Path to Mpi directory")
+ if(EXISTS ${MPI_ROOT_DIR})
+ set(CMAKE_INCLUDE_PATH ${MPI_ROOT_DIR}/include)
+ set(CMAKE_LIBRARY_PATH ${MPI_ROOT_DIR}/lib)
+ set(CMAKE_PROGRAM_PATH ${MPI_ROOT_DIR}/bin)
+ endif(EXISTS ${MPI_ROOT_DIR})
find_package(MPI REQUIRED)
if(HDF5_IS_PARALLEL)
set(HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS} ${MPI_C_INCLUDE_PATH} ${MPI_CXX_INCLUDE_PATH} )
endif(SALOME_USE_CORBA)
# Boost
+set(Boost_ROOT_DIR $ENV{Boost_ROOT_DIR} CACHE PATH "Path to Boost directory")
+if(EXISTS ${Boost_ROOT_DIR})
+ set(CMAKE_INCLUDE_PATH ${Boost_ROOT_DIR}/include)
+ set(CMAKE_LIBRARY_PATH ${Boost_ROOT_DIR}/lib)
+endif(EXISTS ${Boost_ROOT_DIR})
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
# CPPUNIT
if(SALOME_USE_TEST)
+ set(CPPUNIT_ROOT_DIR $ENV{CPPUNIT_ROOT_DIR} CACHE PATH "Path to Cppunit directory")
+ if(EXISTS ${CPPUNIT_ROOT_DIR})
+ set(CMAKE_INCLUDE_PATH ${CPPUNIT_ROOT_DIR}/include)
+ set(CMAKE_LIBRARY_PATH ${CPPUNIT_ROOT_DIR}/lib)
+ set(CMAKE_PROGRAM_PATH ${CPPUNIT_ROOT_DIR}/bin)
+ endif(EXISTS ${CPPUNIT_ROOT_DIR})
INCLUDE(${CMAKE_SOURCE_DIR}/salome_adm/cmake_files/FindCPPUNIT.cmake)
endif(SALOME_USE_TEST)
-# Doxygen
+# Doxygen and graphviz
if(SALOME_USE_DOC)
+ set(DOXYGEN_ROOT_DIR $ENV{DOXYGEN_ROOT_DIR} CACHE PATH "Path to Doxygen directory")
+ set(GRAPHVIZ_ROOT_DIR $ENV{GRAPHVIZ_ROOT_DIR} CACHE PATH "Path to Graphviz directory")
+ if(EXISTS ${DOXYGEN_ROOT_DIR})
+ set(CMAKE_PROGRAM_PATH ${DOXYGEN_ROOT_DIR}/bin)
+ endif(EXISTS ${DOXYGEN_ROOT_DIR})
+ if(EXISTS ${GRAPHVIZ_ROOT_DIR})
+ set(CMAKE_PROGRAM_PATH ${GRAPHVIZ_ROOT_DIR}/bin)
+ if(EXISTS ${DOXYGEN_ROOT_DIR})
+ set(CMAKE_PROGRAM_PATH ${GRAPHVIZ_ROOT_DIR}/bin ${DOXYGEN_ROOT_DIR}/bin)
+ endif(EXISTS ${DOXYGEN_ROOT_DIR})
+ endif(EXISTS ${GRAPHVIZ_ROOT_DIR})
find_package(Doxygen)
endif(SALOME_USE_DOC)
# Sphinx
if(SALOME_USE_DOC)
+ set(SPHINX_ROOT_DIR $ENV{SPHINX_ROOT_DIR} CACHE PATH "Path to Sphinx directory")
+ if(EXISTS ${SPHINX_ROOT_DIR})
+ set(CMAKE_PROGRAM_PATH ${SPHINX_ROOT_DIR}/bin)
+ endif(EXISTS ${SPHINX_ROOT_DIR})
INCLUDE(${CMAKE_SOURCE_DIR}/salome_adm/cmake_files/FindSPHINX.cmake)
endif(SALOME_USE_DOC)
ADD_SUBDIRECTORY(salome_adm)
ENDIF(NOT WITHONLYLAUNCHER)
-IF(SALOME_USE_DOC)
- ADD_SUBDIRECTORY(doc)
-ENDIF(SALOME_USE_DOC)
-
SET(input ${CMAKE_CURRENT_SOURCE_DIR}/KERNEL_version.h.in)
SET(output ${CMAKE_CURRENT_BINARY_DIR}/KERNEL_version.h)
MESSAGE(STATUS "Creation of ${output}")
CONFIGURE_FILE(${input} ${output} @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/KERNEL_version.h DESTINATION ${KERNEL_salomeinclude_HEADERS})
+
+IF(SALOME_USE_DOC)
+ ADD_SUBDIRECTORY(doc)
+ENDIF(SALOME_USE_DOC)
SALOME_CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" "${CMAKE_CURRENT_BINARY_DIR}/conf.py")
IF(WINDOWS)
- STRING(REPLACE "/" "\\" SCR "@SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\lib\\python2.6\\site-packages\\salome\;%PYTHONPATH%
+ STRING(REPLACE "/" "\\" SCR "@SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\lib\\python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}\\site-packages\\salome\;%PYTHONPATH%
@SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\bin\\salome\;%PYTHONPATH%
@SET PATH=${CMAKE_INSTALL_PREFIX}\\lib\\salome\;%PATH%
- @SET PYTHONPATH=${OMNIORB_ROOT_USER}\\lib\\x86_win32\;%PYTHONPATH%
- @SET PYTHONPATH=${OMNIORB_ROOT_USER}\\lib\\python\;%PYTHONPATH%
- @SET PATH=${OMNIORB_ROOT_USER}\\lib\\x86_win32\;%PATH%
+ @SET PYTHONPATH=${OMNIORB_ROOT_DIR}\\lib\\x86_win32\;%PYTHONPATH%
+ @SET PYTHONPATH=${OMNIORB_ROOT_DIR}\\lib\\python\;%PYTHONPATH%
+ @SET PATH=${OMNIORB_ROOT_DIR}\\lib\\x86_win32\;%PATH%
")
SET(EXT "bat")
SET(CALL_STR "call")
ELSE(WINDOWS)
- SET(SCR "export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/python2.6/site-packages/salome:\${PYTHONPATH}
+ SET(SCR " export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/salome:\${PYTHONPATH}
export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/bin/salome:\${PYTHONPATH}
export LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib/salome:\${LD_LIBRARY_PATH}
- export PYTHONPATH=${OMNIORB_ROOT_USER}/lib:\${PYTHONPATH}
- export PYTHONPATH=${OMNIORB_ROOT_USER}/lib/python2.6/site-packages:\${PYTHONPATH}
- export LD_LIBRARY_PATH=${OMNIORB_ROOT_USER}/lib:\${LD_LIBRARY_PATH}
+ export PYTHONPATH=${OMNIORB_ROOT_DIR}/lib:\${PYTHONPATH}
+ export PYTHONPATH=${OMNIORB_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages:\${PYTHONPATH}
+ export PYTHONPATH=${OMNIORBPY_ROOT_DIR}/lib:\${PYTHONPATH}
+ export PYTHONPATH=${OMNIORBPY_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages:\${PYTHONPATH}
+ export LD_LIBRARY_PATH=${OMNIORB_ROOT_DIR}/lib:\${LD_LIBRARY_PATH}
")
SET(EXT "sh")
SET(CALL_STR ".")
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} "${SCR}")
-ADD_CUSTOM_TARGET(html_docs ${CALL_STR} ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} && ${SPHINX_EXECUTABLE} -c ${CMAKE_BINARY_DIR}/doc/docutils -b html ${ALLSPHINXOPTS} html
- COMMAND ${PYTHON_EXECUTABLE} -c \"import shutil\;shutil.rmtree('''${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/KERNEL/docutils''', True)\;shutil.copytree('''${CMAKE_CURRENT_BINARY_DIR}/html''', '''${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/KERNEL/docutils''')\"
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ADD_CUSTOM_TARGET(html_docs ${CALL_STR} ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} && ${SPHINX_EXECUTABLE} -c ${CMAKE_BINARY_DIR}/doc/docutils -b html ${ALLSPHINXOPTS} docutils
)
+
+INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${CMAKE_CACHEFILE_DIR} --target html_docs)")
+INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docutils DESTINATION share/doc/salome/tui/KERNEL)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/doc/salome/tui/images/head.png DESTINATION share/doc/salome/tui/KERNEL)