From 385f9794a7f8fb72a236d1aba4d4ec2501070461 Mon Sep 17 00:00:00 2001 From: adam Date: Fri, 6 Mar 2009 15:41:13 +0000 Subject: [PATCH] New version of cmake tools completely re-written --- salome_adm/cmake_files/FindBOOST.cmake | 115 +++++++- salome_adm/cmake_files/FindCPPUNIT.cmake | 120 +++++++- salome_adm/cmake_files/FindHDF5.cmake | 158 +++++++++- salome_adm/cmake_files/FindLIBXML2.cmake | 148 ++++++++-- salome_adm/cmake_files/FindOMNIORB.cmake | 290 +++++++++++++------ salome_adm/cmake_files/FindPLATFORM.cmake | 66 +++-- salome_adm/cmake_files/FindPTHREADS.cmake | 124 +++++++- salome_adm/cmake_files/FindPYTHON.cmake | 204 ++++++++++--- salome_adm/cmake_files/FindSWIG.cmake | 73 ++++- salome_adm/cmake_files/am2cmake.py | 337 +++++++--------------- 10 files changed, 1201 insertions(+), 434 deletions(-) diff --git a/salome_adm/cmake_files/FindBOOST.cmake b/salome_adm/cmake_files/FindBOOST.cmake index 0c4517cf6..f90cfa242 100644 --- a/salome_adm/cmake_files/FindBOOST.cmake +++ b/salome_adm/cmake_files/FindBOOST.cmake @@ -19,13 +19,110 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(BOOST_ROOT $ENV{BOOST_ROOT}) -IF(BOOST_ROOT) - FIND_PATH(BOOST_INCLUDES boost/shared_ptr.hpp ${BOOST_ROOT}) - FIND_LIBRARY(BOOST_LIB_THREAD libboost_thread-vc90-mt-gd-1_35 ${BOOST_ROOT}/lib) - FIND_LIBRARY(BOOST_LIB_DATE_TIME libboost_date_time-vc90-mt-gd-1_35 ${BOOST_ROOT}/lib) +# ------ + +MESSAGE(STATUS "Check for boost ...") + +# ------ + +IF(BOOST_IS_MANDATORY STREQUAL 0) + SET(BOOST_IS_MANDATORY 0) + SET(BOOST_IS_OPTIONAL 1) +ENDIF(BOOST_IS_MANDATORY STREQUAL 0) +IF(BOOST_IS_OPTIONAL STREQUAL 0) + SET(BOOST_IS_MANDATORY 1) + SET(BOOST_IS_OPTIONAL 0) +ENDIF(BOOST_IS_OPTIONAL STREQUAL 0) +IF(NOT BOOST_IS_MANDATORY AND NOT BOOST_IS_OPTIONAL) + SET(BOOST_IS_MANDATORY 1) + SET(BOOST_IS_OPTIONAL 0) +ENDIF(NOT BOOST_IS_MANDATORY AND NOT BOOST_IS_OPTIONAL) + +# ------ + +SET(BOOST_STATUS 1) +IF(WITHOUT_BOOST OR WITH_BOOST STREQUAL 0) + SET(BOOST_STATUS 0) + MESSAGE(STATUS "boost disabled from command line.") +ENDIF(WITHOUT_BOOST OR WITH_BOOST STREQUAL 0) + +# ------ + +IF(BOOST_STATUS) + IF(WITH_BOOST) + SET(BOOST_ROOT_USER ${WITH_BOOST}) + ELSE(WITH_BOOST) + SET(BOOST_ROOT_USER $ENV{BOOST_ROOT}) + ENDIF(WITH_BOOST) +ENDIF(BOOST_STATUS) + +# ----- + +IF(BOOST_STATUS) + IF(BOOST_ROOT_USER) + SET(BOOST_FIND_PATHS_OPTION NO_DEFAULT_PATH) + ELSE(BOOST_ROOT_USER) + SET(BOOST_FIND_PATHS_OPTION) + ENDIF(BOOST_ROOT_USER) +ENDIF(BOOST_STATUS) + +# ----- + +IF(BOOST_STATUS) + IF(BOOST_ROOT_USER) + SET(BOOST_INCLUDE_PATHS ${BOOST_ROOT_USER} ${BOOST_ROOT_USER}/include) + ELSE(BOOST_ROOT_USER) + SET(BOOST_INCLUDE_PATHS) + ENDIF(BOOST_ROOT_USER) + SET(BOOST_INCLUDE_TO_FIND boost/shared_ptr.hpp) + FIND_PATH(BOOST_INCLUDE_DIR ${BOOST_INCLUDE_TO_FIND} PATHS ${BOOST_INCLUDE_PATHS} ${BOOST_FIND_PATHS_OPTION}) + IF(BOOST_INCLUDE_DIR) + IF(BOOST_ROOT_USER) + SET(BOOST_CPPFLAGS -I${BOOST_INCLUDE_DIR}) + ENDIF(BOOST_ROOT_USER) + MESSAGE(STATUS "${BOOST_INCLUDE_TO_FIND} found in ${BOOST_INCLUDE_DIR}") + ELSE(BOOST_INCLUDE_DIR) + SET(BOOST_STATUS 0) + IF(BOOST_ROOT_USER) + MESSAGE(STATUS "${BOOST_INCLUDE_TO_FIND} not found in ${BOOST_INCLUDE_PATHS}, check your BOOST installation.") + ELSE(BOOST_ROOT_USER) + MESSAGE(STATUS "${BOOST_INCLUDE_TO_FIND} not found on system, try to use WITH_BOOST option or BOOST_ROOT environment variable.") + ENDIF(BOOST_ROOT_USER) + ENDIF(BOOST_INCLUDE_DIR) +ENDIF(BOOST_STATUS) + +# ---- + +IF(BOOST_STATUS) + IF(BOOST_ROOT_USER) + SET(BOOST_LIB_PATHS ${BOOST_ROOT_USER}/lib) + ELSE(BOOST_ROOT_USER) + SET(BOOST_LIB_PATHS) + ENDIF(BOOST_ROOT_USER) +ENDIF(BOOST_STATUS) + +IF(BOOST_STATUS) + IF(WINDOWS) + FIND_LIBRARY(BOOST_LIB_THREAD libboost_thread-vc90-mt-gd-1_35 ${BOOST_LIB_PATHS}) + FIND_LIBRARY(BOOST_LIB_DATE_TIME libboost_date_time-vc90-mt-gd-1_35 ${BOOST_LIB_PATHS}) + ELSE(WINDOWS) + FIND_LIBRARY(BOOST_LIB_THREAD boost_thread ${BOOST_LIB_PATHS}) + ENDIF(WINDOWS) SET(BOOST_LIBS ${BOOST_LIB_THREAD} ${BOOST_LIB_DATE_TIME}) - SET(BOOST_CPPFLAGS -I${BOOST_INCLUDES} -DBOOST_DISABLE_ASSERTS) -ELSE(BOOST_ROOT) - SET(boost_thread -lboost_thread) -ENDIF(BOOST_ROOT) +ENDIF(BOOST_STATUS) + +# ------ + +IF(BOOST_STATUS) + IF(WINDOWS) + SET(BOOST_CPPFLAGS ${BOOST_CPPFLAGS} -DBOOST_DISABLE_ASSERTS) + ENDIF(WINDOWS) +ELSE(BOOST_STATUS) + IF(BOOST_IS_MANDATORY) + MESSAGE(FATAL_ERROR "boost not found ... mandatory ... abort") + ELSE(BOOST_IS_MANDATORY) + MESSAGE(STATUS "boost not found ... optional ... disabled") + ENDIF(BOOST_IS_MANDATORY) +ENDIF(BOOST_STATUS) + +# ------ diff --git a/salome_adm/cmake_files/FindCPPUNIT.cmake b/salome_adm/cmake_files/FindCPPUNIT.cmake index 5add4eeb3..7e8263eac 100644 --- a/salome_adm/cmake_files/FindCPPUNIT.cmake +++ b/salome_adm/cmake_files/FindCPPUNIT.cmake @@ -19,7 +19,121 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -FIND_LIBRARY(CPPUNIT_LIBS cppunit /usr/lib) -IF(CPPUNIT_LIBS) +# ------ + +MESSAGE(STATUS "Check for cppunit ...") + +# ------ + +IF(CPPUNIT_IS_MANDATORY STREQUAL 0) + SET(CPPUNIT_IS_MANDATORY 0) + SET(CPPUNIT_IS_OPTIONAL 1) +ENDIF(CPPUNIT_IS_MANDATORY STREQUAL 0) +IF(CPPUNIT_IS_OPTIONAL STREQUAL 0) + SET(CPPUNIT_IS_MANDATORY 1) + SET(CPPUNIT_IS_OPTIONAL 0) +ENDIF(CPPUNIT_IS_OPTIONAL STREQUAL 0) +IF(NOT CPPUNIT_IS_MANDATORY AND NOT CPPUNIT_IS_OPTIONAL) + SET(CPPUNIT_IS_MANDATORY 0) + SET(CPPUNIT_IS_OPTIONAL 1) +ENDIF(NOT CPPUNIT_IS_MANDATORY AND NOT CPPUNIT_IS_OPTIONAL) + +# ------ + +SET(CPPUNIT_STATUS 1) +IF(WITHOUT_CPPUNIT OR WITH_CPPUNIT STREQUAL 0) + SET(CPPUNIT_STATUS 0) + MESSAGE(STATUS "cppunit disabled from command line.") +ENDIF(WITHOUT_CPPUNIT OR WITH_CPPUNIT STREQUAL 0) + +# ------ + +IF(CPPUNIT_STATUS) + IF(WITH_CPPUNIT) + SET(CPPUNIT_ROOT_USER ${WITH_CPPUNIT}) + ELSE(WITH_CPPUNIT) + SET(CPPUNIT_ROOT_USER $ENV{CPPUNIT_ROOT}) + ENDIF(WITH_CPPUNIT) +ENDIF(CPPUNIT_STATUS) + +# ----- + +IF(CPPUNIT_STATUS) + IF(CPPUNIT_ROOT_USER) + SET(CPPUNIT_FIND_PATHS_OPTION NO_DEFAULT_PATH) + ELSE(CPPUNIT_ROOT_USER) + SET(CPPUNIT_FIND_PATHS_OPTION) + ENDIF(CPPUNIT_ROOT_USER) +ENDIF(CPPUNIT_STATUS) + +# ----- + +IF(CPPUNIT_STATUS) + IF(CPPUNIT_ROOT_USER) + SET(CPPUNIT_INCLUDE_PATHS ${CPPUNIT_ROOT_USER} ${CPPUNIT_ROOT_USER}/include) + ELSE(CPPUNIT_ROOT_USER) + SET(CPPUNIT_INCLUDE_PATHS) + ENDIF(CPPUNIT_ROOT_USER) + SET(CPPUNIT_INCLUDE_TO_FIND cppunit/extensions/HelperMacros.h) + FIND_PATH(CPPUNIT_INCLUDE_DIR ${CPPUNIT_INCLUDE_TO_FIND} PATHS ${CPPUNIT_INCLUDE_PATHS} ${CPPUNIT_FIND_PATHS_OPTION}) + IF(CPPUNIT_INCLUDE_DIR) + IF(CPPUNIT_ROOT_USER) + SET(CPPUNIT_INCLUDES -I${CPPUNIT_INCLUDE_DIR}) + ENDIF(CPPUNIT_ROOT_USER) + MESSAGE(STATUS "${CPPUNIT_INCLUDE_TO_FIND} found in ${CPPUNIT_INCLUDE_DIR}") + ELSE(CPPUNIT_INCLUDE_DIR) + SET(CPPUNIT_STATUS 0) + IF(CPPUNIT_ROOT_USER) + MESSAGE(STATUS "${CPPUNIT_INCLUDE_TO_FIND} not found in ${CPPUNIT_INCLUDE_PATHS}, check your CPPUNIT installation.") + ELSE(CPPUNIT_ROOT_USER) + MESSAGE(STATUS "${CPPUNIT_INCLUDE_TO_FIND} not found on system, try to use WITH_CPPUNIT option or CPPUNIT_ROOT environment variable.") + ENDIF(CPPUNIT_ROOT_USER) + ENDIF(CPPUNIT_INCLUDE_DIR) +ENDIF(CPPUNIT_STATUS) + +# ---- + +IF(CPPUNIT_STATUS) + IF(CPPUNIT_ROOT_USER) + SET(CPPUNIT_LIB_PATHS ${CPPUNIT_ROOT_USER}/lib) + ELSE(CPPUNIT_ROOT_USER) + SET(CPPUNIT_LIB_PATHS) + ENDIF(CPPUNIT_ROOT_USER) +ENDIF(CPPUNIT_STATUS) + +IF(CPPUNIT_STATUS) + IF(WINDOWS) + FIND_LIBRARY(CPPUNIT_LIB cppunitd_dll PATHS ${CPPUNIT_LIB_PATHS} ${CPPUNIT_FIND_PATHS_OPTION}) + ELSE(WINDOWS) + FIND_LIBRARY(CPPUNIT_LIB cppunit PATHS ${CPPUNIT_LIB_PATHS} ${CPPUNIT_FIND_PATHS_OPTION}) + ENDIF(WINDOWS) + SET(CPPUNIT_LIBS) + IF(CPPUNIT_LIB) + SET(CPPUNIT_LIBS ${CPPUNIT_LIBS} ${CPPUNIT_LIB}) + MESSAGE(STATUS "cppunit lib found: ${CPPUNIT_LIB}") + ELSE(CPPUNIT_LIB) + SET(CPPUNIT_STATUS 0) + IF(CPPUNIT_ROOT_USER) + MESSAGE(STATUS "cppunit lib not found in ${CPPUNIT_LIB_PATHS}, check your CPPUNIT installation.") + ELSE(CPPUNIT_ROOT_USER) + MESSAGE(STATUS "cppunit lib not found on system, try to use WITH_CPPUNIT option or CPPUNIT_ROOT environment variable.") + ENDIF(CPPUNIT_ROOT_USER) + ENDIF(CPPUNIT_LIB) +ENDIF(CPPUNIT_STATUS) + +# ---- + +IF(CPPUNIT_STATUS) SET(CPPUNIT_IS_OK 1) -ENDIF(CPPUNIT_LIBS) + IF(WINDOWS) + SET(CPPUNIT_INCLUDES ${CPPUNIT_INCLUDES} -DCPPUNIT_DLL) + ENDIF(WINDOWS) +ELSE(CPPUNIT_STATUS) + IF(CPPUNIT_IS_MANDATORY) + MESSAGE(FATAL_ERROR "cppunit not found ... mandatory ... abort") + ELSE(CPPUNIT_IS_MANDATORY) + MESSAGE(STATUS "cppunit not found ... optional ... disabled") + ENDIF(CPPUNIT_IS_MANDATORY) +ENDIF(CPPUNIT_STATUS) + +# ------ diff --git a/salome_adm/cmake_files/FindHDF5.cmake b/salome_adm/cmake_files/FindHDF5.cmake index 27b784a83..fe54d590a 100644 --- a/salome_adm/cmake_files/FindHDF5.cmake +++ b/salome_adm/cmake_files/FindHDF5.cmake @@ -19,24 +19,150 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -FIND_PROGRAM(HDF5_DUMP h5dump) +# ------ -SET(HDF5_ROOT ${HDF5_DUMP}) -GET_FILENAME_COMPONENT(HDF5_ROOT ${HDF5_ROOT} PATH) -GET_FILENAME_COMPONENT(HDF5_ROOT ${HDF5_ROOT} PATH) +MESSAGE(STATUS "Check for hdf5 ...") -FIND_PATH(HDF5_INCLUDES H5public.h ${HDF5_ROOT}/include) -SET(HDF5_INCLUDES -I${HDF5_INCLUDES}) +# ------ -IF(WINDOWS) - IF(CMAKE_BUILD_TYPE STREQUAL Release) - FIND_LIBRARY(HDF5_LIBS hdf5 ${HDF5_ROOT}/lib) - ELSE(CMAKE_BUILD_TYPE STREQUAL Release) - FIND_LIBRARY(HDF5_LIBS hdf5d ${HDF5_ROOT}/lib) - ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) -ELSE(WINDOWS) - FIND_LIBRARY(HDF5_LIBS hdf5 ${HDF5_ROOT}/lib) -ENDIF(WINDOWS) +IF(HDF5_IS_MANDATORY STREQUAL 0) + SET(HDF5_IS_MANDATORY 0) + SET(HDF5_IS_OPTIONAL 1) +ENDIF(HDF5_IS_MANDATORY STREQUAL 0) +IF(HDF5_IS_OPTIONAL STREQUAL 0) + SET(HDF5_IS_MANDATORY 1) + SET(HDF5_IS_OPTIONAL 0) +ENDIF(HDF5_IS_OPTIONAL STREQUAL 0) +IF(NOT HDF5_IS_MANDATORY AND NOT HDF5_IS_OPTIONAL) + SET(HDF5_IS_MANDATORY 1) + SET(HDF5_IS_OPTIONAL 0) +ENDIF(NOT HDF5_IS_MANDATORY AND NOT HDF5_IS_OPTIONAL) + +# ------ + +SET(HDF5_STATUS 1) +IF(WITHOUT_HDF5 OR WITH_HDF5 STREQUAL 0) + SET(HDF5_STATUS 0) + MESSAGE(STATUS "hdf5 disabled from command line.") +ENDIF(WITHOUT_HDF5 OR WITH_HDF5 STREQUAL 0) + +# ------ + +IF(HDF5_STATUS) + IF(WITH_HDF5) + SET(HDF5_ROOT_USER ${WITH_HDF5}) + ENDIF(WITH_HDF5) + IF(NOT HDF5_ROOT_USER) + SET(HDF5_ROOT_USER $ENV{HDF5_ROOT}) + ENDIF(NOT HDF5_ROOT_USER) + IF(NOT HDF5_ROOT_USER) + SET(HDF5_ROOT_USER $ENV{HDF5HOME}) + ENDIF(NOT HDF5_ROOT_USER) +ENDIF(HDF5_STATUS) + +# ------ + +IF(HDF5_STATUS) + IF(NOT HDF5_ROOT_USER) + FIND_PROGRAM(HDF5_DUMP h5dump) + IF(HDF5_DUMP) + MESSAGE(STATUS "h5dump found: ${HDF5_DUMP}") + IF(HDF5_DUMP STREQUAL /usr/bin/h5dump) + ELSE(HDF5_DUMP STREQUAL /usr/bin/h5dump) + SET(HDF5_ROOT_USER ${HDF5_DUMP}) + GET_FILENAME_COMPONENT(HDF5_ROOT_USER ${HDF5_ROOT_USER} PATH) + GET_FILENAME_COMPONENT(HDF5_ROOT_USER ${HDF5_ROOT_USER} PATH) + ENDIF(HDF5_DUMP STREQUAL /usr/bin/h5dump) + ELSE(HDF5_DUMP) + MESSAGE(STATUS "h5dump not found, try to use WITH_HDF5 option or HDF5_ROOT (or HDF5HOME) environment variable") + SET(HDF5_STATUS 0) + ENDIF(HDF5_DUMP) + ENDIF(NOT HDF5_ROOT_USER) +ENDIF(HDF5_STATUS) + +# ------ + +IF(HDF5_STATUS) + IF(HDF5_ROOT_USER) + SET(HDF5_FIND_PATHS_OPTION NO_DEFAULT_PATH) + ELSE(HDF5_ROOT_USER) + SET(HDF5_FIND_PATHS_OPTION) + ENDIF(HDF5_ROOT_USER) +ENDIF(HDF5_STATUS) + +# ------ + +IF(HDF5_STATUS) + IF(HDF5_ROOT_USER) + SET(HDF5_INCLUDE_PATHS ${HDF5_ROOT_USER}/include) + ELSE(HDF5_ROOT_USER) + SET(HDF5_INCLUDE_PATHS) + ENDIF(HDF5_ROOT_USER) + SET(HDF5_INCLUDE_TO_FIND H5public.h) + FIND_PATH(HDF5_INCLUDE_DIR ${HDF5_INCLUDE_TO_FIND} PATHS ${HDF5_INCLUDE_PATHS} ${HDF5_FIND_PATHS_OPTION}) + IF(HDF5_INCLUDE_DIR) + IF(HDF5_ROOT_USER) + SET(HDF5_INCLUDES -I${HDF5_INCLUDE_DIR}) + ENDIF(HDF5_ROOT_USER) + SET(HDF5_INCLUDES -D_HDF5USEDLL_ ${HDF5_INCLUDES}) + MESSAGE(STATUS "${HDF5_INCLUDE_TO_FIND} found in ${HDF5_INCLUDE_DIR}") + ELSE(HDF5_INCLUDE_DIR) + SET(HDF5_STATUS 0) + IF(HDF5_ROOT_USER) + MESSAGE(STATUS "${HDF5_INCLUDE_TO_FIND} not found in ${HDF5_INCLUDE_PATHS}, check your HDF5 installation.") + ELSE(HDF5_ROOT_USER) + MESSAGE(STATUS "${HDF5_INCLUDE_TO_FIND} not found on system, try to use WITH_HDF5 option or HDF5_ROOT (or HDF5HOME) environment variable.") + ENDIF(HDF5_ROOT_USER) + ENDIF(HDF5_INCLUDE_DIR) +ENDIF(HDF5_STATUS) + +# ---- + +IF(HDF5_STATUS) + IF(HDF5_ROOT_USER) + IF(WINDOWS) + SET(HDF5_LIB_PATHS ${HDF5_ROOT_USER}/dll) + ELSE(WINDOWS) + SET(HDF5_LIB_PATHS ${HDF5_ROOT_USER}/lib) + ENDIF(WINDOWS) + ELSE(HDF5_ROOT_USER) + SET(HDF5_LIB_PATHS) + ENDIF(HDF5_ROOT_USER) + IF(WINDOWS) + IF(CMAKE_BUILD_TYPE STREQUAL Release) + FIND_LIBRARY(HDF5_LIB hdf5dll PATHS ${HDF5_LIB_PATHS} ${HDF5_FIND_PATHS_OPTION}) + ELSE(CMAKE_BUILD_TYPE STREQUAL Release) + FIND_LIBRARY(HDF5_LIB hdf5ddll PATHS ${HDF5_LIB_PATHS} ${HDF5_FIND_PATHS_OPTION}) + ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) + ELSE(WINDOWS) + FIND_LIBRARY(HDF5_LIB hdf5 PATHS ${HDF5_LIB_PATHS} ${HDF5_FIND_PATHS_OPTION}) + ENDIF(WINDOWS) + SET(HDF5_LIBS) + IF(HDF5_LIB) + SET(HDF5_LIBS ${HDF5_LIBS} ${HDF5_LIB}) + MESSAGE(STATUS "hdf5 lib found: ${HDF5_LIB}") + ELSE(HDF5_LIB) + SET(HDF5_STATUS 0) + IF(HDF5_ROOT_USER) + MESSAGE(STATUS "hdf5 lib not found in ${HDF5_LIB_PATHS}, check your HDF5 installation.") + ELSE(HDF5_ROOT_USER) + MESSAGE(STATUS "hdf5 lib not found on system, try to use WITH_HDF5 option or HDF5_ROOT (or HDF5HOME) environment variable.") + ENDIF(HDF5_ROOT_USER) + ENDIF(HDF5_LIB) +ENDIF(HDF5_STATUS) + +# ---- + +IF(HDF5_STATUS) +ELSE(HDF5_STATUS) + IF(HDF5_IS_MANDATORY) + MESSAGE(FATAL_ERROR "hdf5 not found ... mandatory ... abort") + ELSE(HDF5_IS_MANDATORY) + MESSAGE(STATUS "hdf5 not found ... optional ... disabled") + ENDIF(HDF5_IS_MANDATORY) +ENDIF(HDF5_STATUS) + +# ------ #SET(ZLIB_ROOT $ENV{ZLIB_ROOT}) #STRING(LENGTH "${ZLIB_ROOT}" NB) @@ -51,3 +177,5 @@ ENDIF(WINDOWS) # FIND_LIBRARY(SZIP_LIBS szlib ${SZIP_ROOT}/lib) # SET(HDF5_LIBS ${HDF5_LIBS} ${SZIP_LIBS}) #ENDIF(${NB} GREATER 0) + +# ------ diff --git a/salome_adm/cmake_files/FindLIBXML2.cmake b/salome_adm/cmake_files/FindLIBXML2.cmake index cd0b45469..7d87abcc4 100644 --- a/salome_adm/cmake_files/FindLIBXML2.cmake +++ b/salome_adm/cmake_files/FindLIBXML2.cmake @@ -19,25 +19,129 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(LIBXML2_ROOT $ENV{LIBXML2_ROOT}) -IF(LIBXML2_ROOT) - FIND_PATH(LIBXML2_INCLUDE_DIR libxml/parser.h ${LIBXML2_ROOT}/include) - FIND_LIBRARY(LIBXML2_LIBS libxml2 ${LIBXML2_ROOT}/lib) -ELSE(LIBXML2_ROOT) - FIND_PATH(LIBXML2_INCLUDE_DIR libxml/parser.h /usr/include/libxml2) - FIND_LIBRARY(LIBXML2_LIBS xml2 /usr/lib) -ENDIF(LIBXML2_ROOT) - -SET(LIBXML2_INCLUDES -I${LIBXML2_INCLUDE_DIR}) - -SET(ICONV_ROOT $ENV{ICONV_ROOT}) -IF(ICONV_ROOT) - FIND_PATH(ICONV_INCLUDE_DIR iconv.h ${ICONV_ROOT}/include) - FIND_LIBRARY(ICONV_LIBS iconv ${ICONV_ROOT}/lib) - SET(LIBXML2_INCLUDES ${LIBXML2_INCLUDES} -I${ICONV_INCLUDE_DIR}) - SET(LIBXML2_LIBS ${LIBXML2_LIBS} ${ICONV_LIBS}) -ENDIF(ICONV_ROOT) - -SET(LIBXML_INCLUDES ${LIBXML2_INCLUDES}) -SET(LIBXML_CPPFLAGS ${LIBXML2_INCLUDES}) -SET(LIBXML_LIBS ${LIBXML2_LIBS}) +# ------ + +MESSAGE(STATUS "Check for libxml2 ...") + +# ------ + +IF(LIBXML2_IS_MANDATORY STREQUAL 0) + SET(LIBXML2_IS_MANDATORY 0) + SET(LIBXML2_IS_OPTIONAL 1) +ENDIF(LIBXML2_IS_MANDATORY STREQUAL 0) +IF(LIBXML2_IS_OPTIONAL STREQUAL 0) + SET(LIBXML2_IS_MANDATORY 1) + SET(LIBXML2_IS_OPTIONAL 0) +ENDIF(LIBXML2_IS_OPTIONAL STREQUAL 0) +IF(NOT LIBXML2_IS_MANDATORY AND NOT LIBXML2_IS_OPTIONAL) + SET(LIBXML2_IS_MANDATORY 1) + SET(LIBXML2_IS_OPTIONAL 0) +ENDIF(NOT LIBXML2_IS_MANDATORY AND NOT LIBXML2_IS_OPTIONAL) + +# ------ + +SET(LIBXML2_STATUS 1) +IF(WITHOUT_LIBXML2 OR WITH_LIBXML2 STREQUAL 0) + SET(LIBXML2_STATUS 0) + MESSAGE(STATUS "libxml2 disabled from command line.") +ENDIF(WITHOUT_LIBXML2 OR WITH_LIBXML2 STREQUAL 0) + +# ------ + +IF(LIBXML2_STATUS) + IF(WITH_LIBXML2) + SET(LIBXML2_ROOT_USER ${WITH_LIBXML2}) + ELSE(WITH_LIBXML2) + SET(LIBXML2_ROOT_USER $ENV{LIBXML2_ROOT}) + ENDIF(WITH_LIBXML2) +ENDIF(LIBXML2_STATUS) + +# ----- + +IF(LIBXML2_STATUS) + IF(LIBXML2_ROOT_USER) + SET(LIBXML2_FIND_PATHS_OPTION NO_DEFAULT_PATH) + ELSE(LIBXML2_ROOT_USER) + SET(LIBXML2_FIND_PATHS_OPTION) + ENDIF(LIBXML2_ROOT_USER) +ENDIF(LIBXML2_STATUS) + +# ----- + +IF(LIBXML2_STATUS) + IF(LIBXML2_ROOT_USER) + SET(LIBXML2_INCLUDE_PATHS ${LIBXML2_ROOT_USER}/include) + ELSE(LIBXML2_ROOT_USER) + SET(LIBXML2_INCLUDE_PATHS /usr/include/libxml2) + ENDIF(LIBXML2_ROOT_USER) + SET(LIBXML2_INCLUDE_TO_FIND libxml/parser.h) + FIND_PATH(LIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_TO_FIND} PATHS ${LIBXML2_INCLUDE_PATHS} ${LIBXML2_FIND_PATHS_OPTION}) + IF(LIBXML2_INCLUDE_DIR) + SET(LIBXML2_INCLUDES -I${LIBXML2_INCLUDE_DIR}) + MESSAGE(STATUS "${LIBXML2_INCLUDE_TO_FIND} found in ${LIBXML2_INCLUDE_DIR}") + ELSE(LIBXML2_INCLUDE_DIR) + SET(LIBXML2_STATUS 0) + IF(LIBXML2_ROOT_USER) + MESSAGE(STATUS "${LIBXML2_INCLUDE_TO_FIND} not found in ${LIBXML2_INCLUDE_PATHS}, check your LIBXML2 installation.") + ELSE(LIBXML2_ROOT_USER) + MESSAGE(STATUS "${LIBXML2_INCLUDE_TO_FIND} not found on system, try to use WITH_LIBXML2 option or LIBXML2_ROOT environment variable.") + ENDIF(LIBXML2_ROOT_USER) + ENDIF(LIBXML2_INCLUDE_DIR) +ENDIF(LIBXML2_STATUS) + +# ---- + +IF(LIBXML2_STATUS) + IF(LIBXML2_ROOT_USER) + SET(LIBXML2_LIB_PATHS ${LIBXML2_ROOT_USER}/lib) + ELSE(LIBXML2_ROOT_USER) + SET(LIBXML2_LIB_PATHS) + ENDIF(LIBXML2_ROOT_USER) +ENDIF(LIBXML2_STATUS) + +IF(LIBXML2_STATUS) + IF(WINDOWS) + FIND_LIBRARY(LIBXML2_LIB libxml2 PATHS ${LIBXML2_LIB_PATHS} ${LIBXML2_FIND_PATHS_OPTION}) + ELSE(WINDOWS) + FIND_LIBRARY(LIBXML2_LIB xml2 PATHS ${LIBXML2_LIB_PATHS} ${LIBXML2_FIND_PATHS_OPTION}) + ENDIF(WINDOWS) + SET(LIBXML2_LIBS) + IF(LIBXML2_LIB) + SET(LIBXML2_LIBS ${LIBXML2_LIBS} ${LIBXML2_LIB}) + MESSAGE(STATUS "libxml2 lib found: ${LIBXML2_LIB}") + ELSE(LIBXML2_LIB) + SET(LIBXML2_STATUS 0) + IF(LIBXML2_ROOT_USER) + MESSAGE(STATUS "libxml2 lib not found in ${LIBXML2_LIB_PATHS}, check your LIBXML2 installation.") + ELSE(LIBXML2_ROOT_USER) + MESSAGE(STATUS "libxml2 lib not found on system, try to use WITH_LIBXML2 option or LIBXML2_ROOT environment variable.") + ENDIF(LIBXML2_ROOT_USER) + ENDIF(LIBXML2_LIB) +ENDIF(LIBXML2_STATUS) + +# ---- + +IF(WINDOWS) + SET(ICONV_ROOT $ENV{ICONV_ROOT}) + IF(ICONV_ROOT) + FIND_PATH(ICONV_INCLUDE_DIR iconv.h ${ICONV_ROOT}/include) + FIND_LIBRARY(ICONV_LIBS iconv ${ICONV_ROOT}/lib) + SET(LIBXML2_INCLUDES ${LIBXML2_INCLUDES} -I${ICONV_INCLUDE_DIR}) + SET(LIBXML2_LIBS ${LIBXML2_LIBS} ${ICONV_LIBS}) + ENDIF(ICONV_ROOT) +ENDIF(WINDOWS) + +# ------ +IF(LIBXML2_STATUS) + SET(LIBXML_INCLUDES ${LIBXML2_INCLUDES}) + SET(LIBXML_CPPFLAGS ${LIBXML2_INCLUDES}) + SET(LIBXML_LIBS ${LIBXML2_LIBS}) +ELSE(LIBXML2_STATUS) + IF(LIBXML2_IS_MANDATORY) + MESSAGE(FATAL_ERROR "libxml2 not found ... mandatory ... abort") + ELSE(LIBXML2_IS_MANDATORY) + MESSAGE(STATUS "libxml2 not found ... optional ... disabled") + ENDIF(LIBXML2_IS_MANDATORY) +ENDIF(LIBXML2_STATUS) + +# ------ diff --git a/salome_adm/cmake_files/FindOMNIORB.cmake b/salome_adm/cmake_files/FindOMNIORB.cmake index f9cd2d618..e8a1c70fc 100644 --- a/salome_adm/cmake_files/FindOMNIORB.cmake +++ b/salome_adm/cmake_files/FindOMNIORB.cmake @@ -19,94 +19,220 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# ----- - -FIND_PROGRAM(OMNIORB_IDL omniidl) - -# ----- - -IF(OMNIORB_IDL) - SET(CORBA_GEN 1) -ELSE(OMNIORB_IDL) - SET(CORBA_GEN 0) -ENDIF(OMNIORB_IDL) - -# ----- - -SET(OMNIORB_ROOT ${OMNIORB_IDL}) -GET_FILENAME_COMPONENT(OMNIORB_ROOT ${OMNIORB_ROOT} PATH) -IF(WINDOWS) - GET_FILENAME_COMPONENT(OMNIORB_ROOT ${OMNIORB_ROOT} PATH) -ENDIF(WINDOWS) -GET_FILENAME_COMPONENT(OMNIORB_ROOT ${OMNIORB_ROOT} PATH) - -# ---- - -FIND_PATH(OMNIORB_INC1 - NAMES omniORB4/CORBA.h - PATHS ${OMNIORB_ROOT}/include - ) -FIND_PATH(OMNIORB_INC2 - NAMES CORBA.h - PATHS ${OMNIORB_ROOT}/include/omniORB4 - ) - -SET(OMNIORB_INCLUDES -I${OMNIORB_INC1} -I${OMNIORB_INC2}) -SET(CORBA_INCLUDES ${OMNIORB_INCLUDES}) +# ------ + +MESSAGE(STATUS "Check for omniorb ...") + +# ------ + +IF(OMNIORB_IS_MANDATORY STREQUAL 0) + SET(OMNIORB_IS_MANDATORY 0) + SET(OMNIORB_IS_OPTIONAL 1) +ENDIF(OMNIORB_IS_MANDATORY STREQUAL 0) +IF(OMNIORB_IS_OPTIONAL STREQUAL 0) + SET(OMNIORB_IS_MANDATORY 1) + SET(OMNIORB_IS_OPTIONAL 0) +ENDIF(OMNIORB_IS_OPTIONAL STREQUAL 0) +IF(NOT OMNIORB_IS_MANDATORY AND NOT OMNIORB_IS_OPTIONAL) + SET(OMNIORB_IS_MANDATORY 1) + SET(OMNIORB_IS_OPTIONAL 0) +ENDIF(NOT OMNIORB_IS_MANDATORY AND NOT OMNIORB_IS_OPTIONAL) + +# ------ + +SET(OMNIORB_STATUS 1) +IF(WITHOUT_OMNIORB OR WITH_OMNIORB STREQUAL 0) + SET(OMNIORB_STATUS 0) + MESSAGE(STATUS "omniorb disabled from command line.") +ENDIF(WITHOUT_OMNIORB OR WITH_OMNIORB STREQUAL 0) + +# ------ + +IF(OMNIORB_STATUS) + IF(WITH_OMNIORB) + SET(OMNIORB_ROOT_USER ${WITH_OMNIORB}) + ENDIF(WITH_OMNIORB) + IF(NOT OMNIORB_ROOT_USER) + SET(OMNIORB_ROOT_USER $ENV{OMNIORB_ROOT}) + ENDIF(NOT OMNIORB_ROOT_USER) + IF(NOT OMNIORB_ROOT_USER) + SET(OMNIORB_ROOT_USER $ENV{OMNIORBHOME}) + ENDIF(NOT OMNIORB_ROOT_USER) +ENDIF(OMNIORB_STATUS) + +# ------ + +IF(OMNIORB_STATUS) + SET(OMNIIDL_EXECUTABLE_TO_FIND omniidl) + IF(OMNIORB_ROOT_USER) + FIND_PROGRAM(OMNIIDL_EXECUTABLE ${OMNIIDL_EXECUTABLE_TO_FIND} PATHS ${OMNIORB_ROOT_USER}/bin) + ELSE(OMNIORB_ROOT_USER) + FIND_PROGRAM(OMNIIDL_EXECUTABLE ${OMNIIDL_EXECUTABLE_TO_FIND}) + ENDIF(OMNIORB_ROOT_USER) + IF(OMNIIDL_EXECUTABLE) + MESSAGE(STATUS "${OMNIIDL_EXECUTABLE_TO_FIND} found: ${OMNIIDL_EXECUTABLE}") + IF(OMNIORB_EXECUTABLE STREQUAL /usr/bin/${OMNIIDL_EXECUTABLE_TO_FIND}) + ELSE(OMNIORB_EXECUTABLE STREQUAL /usr/bin/${OMNIIDL_EXECUTABLE_TO_FIND}) + SET(OMNIORB_ROOT_USER ${OMNIIDL_EXECUTABLE}) + GET_FILENAME_COMPONENT(OMNIORB_ROOT_USER ${OMNIORB_ROOT_USER} PATH) + IF(WINDOWS) + GET_FILENAME_COMPONENT(OMNIORB_ROOT_USER ${OMNIORB_ROOT_USER} PATH) + ENDIF(WINDOWS) + GET_FILENAME_COMPONENT(OMNIORB_ROOT_USER ${OMNIORB_ROOT_USER} PATH) + ENDIF(OMNIORB_EXECUTABLE STREQUAL /usr/bin/${OMNIIDL_EXECUTABLE_TO_FIND}) + ELSE(OMNIIDL_EXECUTABLE) + MESSAGE(STATUS "${OMNIIDL_EXECUTABLE_TO_FIND} not found, try to use WITH_OMNIORB option or OMNIORBHOME environment variable") + SET(OMNIORB_STATUS 0) + ENDIF(OMNIIDL_EXECUTABLE) +ENDIF(OMNIORB_STATUS) + +# ------ + +IF(OMNIORB_STATUS) + IF(OMNIORB_ROOT_USER) + SET(OMNIORB_FIND_PATHS_OPTION NO_DEFAULT_PATH) + ELSE(OMNIORB_ROOT_USER) + SET(OMNIORB_FIND_PATHS_OPTION) + ENDIF(OMNIORB_ROOT_USER) +ENDIF(OMNIORB_STATUS) + +# ------ + +IF(OMNIORB_STATUS) + SET(OMNIORB_INCLUDES) +ENDIF(OMNIORB_STATUS) +IF(OMNIORB_STATUS) + IF(OMNIORB_ROOT_USER) + SET(OMNIORB_INCLUDE_PATHS ${OMNIORB_ROOT_USER}/include) + ELSE(OMNIORB_ROOT_USER) + SET(OMNIORB_INCLUDE_PATHS) + ENDIF(OMNIORB_ROOT_USER) + SET(OMNIORB_INCLUDE_TO_FIND omniORB4/CORBA.h) + FIND_PATH(OMNIORB_INCLUDE_DIR1 ${OMNIORB_INCLUDE_TO_FIND} PATHS ${OMNIORB_INCLUDE_PATHS} ${OMNIORB_FIND_PATHS_OPTION}) + IF(OMNIORB_INCLUDE_DIR1) + SET(OMNIORB_INCLUDES ${OMNIORB_INCLUDES} -I${OMNIORB_INCLUDE_DIR1}) + MESSAGE(STATUS "${OMNIORB_INCLUDE_TO_FIND} found in ${OMNIORB_INCLUDE_DIR1}") + ELSE(OMNIORB_INCLUDE_DIR1) + SET(OMNIORB_STATUS 0) + IF(OMNIORB_ROOT_USER) + MESSAGE(STATUS "${OMNIORB_INCLUDE_TO_FIND} not found in ${OMNIORB_INCLUDE_PATHS}, check your OMNIORB installation.") + ELSE(OMNIORB_ROOT_USER) + MESSAGE(STATUS "${OMNIORB_INCLUDE_TO_FIND} not found on system, try to use WITH_OMNIORB option or OMNIORB_ROOT environment variable.") + ENDIF(OMNIORB_ROOT_USER) + ENDIF(OMNIORB_INCLUDE_DIR1) +ENDIF(OMNIORB_STATUS) +IF(OMNIORB_STATUS) + IF(OMNIORB_ROOT_USER) + SET(OMNIORB_INCLUDE_PATHS ${OMNIORB_ROOT_USER}/include/omniORB4) + ELSE(OMNIORB_ROOT_USER) + SET(OMNIORB_INCLUDE_PATHS /usr/include/omniORB4) + ENDIF(OMNIORB_ROOT_USER) + SET(OMNIORB_INCLUDE_TO_FIND CORBA.h) + FIND_PATH(OMNIORB_INCLUDE_DIR2 ${OMNIORB_INCLUDE_TO_FIND} PATHS ${OMNIORB_INCLUDE_PATHS} ${OMNIORB_FIND_PATHS_OPTION}) + IF(OMNIORB_INCLUDE_DIR2) + SET(OMNIORB_INCLUDES ${OMNIORB_INCLUDES} -I${OMNIORB_INCLUDE_DIR2}) + MESSAGE(STATUS "${OMNIORB_INCLUDE_TO_FIND} found in ${OMNIORB_INCLUDE_DIR2}") + ELSE(OMNIORB_INCLUDE_DIR2) + SET(OMNIORB_STATUS 0) + MESSAGE(STATUS "${OMNIORB_INCLUDE_TO_FIND} not found in ${OMNIORB_INCLUDE_PATHS}, check your OMNIORB installation.") + ENDIF(OMNIORB_INCLUDE_DIR2) +ENDIF(OMNIORB_STATUS) + +# ------ + +IF(OMNIORB_STATUS) + SET(OMNIORB_CXXFLAGS) + # SET(OMNIORB_CXXFLAGS ${OMNIORB_CXXFLAGS} -DOMNIORB_VERSION=4) + SET(OMNIORB_CXXFLAGS ${OMNIORB_CXXFLAGS} -D__x86__) + SET(OMNIORB_CXXFLAGS ${OMNIORB_CXXFLAGS} -DCOMP_CORBA_DOUBLE) + SET(OMNIORB_CXXFLAGS ${OMNIORB_CXXFLAGS} -DCOMP_CORBA_LONG) + IF(WINDOWS) + SET(OMNIORB_CXXFLAGS ${OMNIORB_CXXFLAGS} -D__WIN32__) + # # # # SET(OMNIORB_CXXFLAGS ${OMNIORB_CXXFLAGS} -D_WIN32_WINNT=0x0400) + # SET(OMNIORB_CXXFLAGS ${OMNIORB_CXXFLAGS} -D__NT__) + # SET(OMNIORB_CXXFLAGS ${OMNIORB_CXXFLAGS} -D__OSVERSION__=4) + # ELSE(WINDOWS) + # SET(OMNIORB_CXXFLAGS ${OMNIORB_CXXFLAGS} -D__linux__) + ENDIF(WINDOWS) + # IF(WINDOWS) + # SET(OMNIORB_LIBS ws2_32.lib mswsock.lib advapi32.lib ${OMNIORB_LIBS}) + # ENDIF(WINDOWS) +ENDIF(OMNIORB_STATUS) # ---- -SET(OMNIORB_CXXFLAGS) -SET(OMNIORB_CXXFLAGS ${OMNIORB_CXXFLAGS} -DOMNIORB_VERSION=4) -SET(OMNIORB_CXXFLAGS ${OMNIORB_CXXFLAGS} -D__x86__) - -IF(WINDOWS) - SET(OMNIORB_CXXFLAGS ${OMNIORB_CXXFLAGS} -D__WIN32__) - # # # SET(OMNIORB_CXXFLAGS ${OMNIORB_CXXFLAGS} -D_WIN32_WINNT=0x0400) - SET(OMNIORB_CXXFLAGS ${OMNIORB_CXXFLAGS} -D__NT__) - SET(OMNIORB_CXXFLAGS ${OMNIORB_CXXFLAGS} -D__OSVERSION__=4) -ELSE(WINDOWS) - SET(OMNIORB_CXXFLAGS ${OMNIORB_CXXFLAGS} -D__linux__) -ENDIF(WINDOWS) - -SET(CORBA_CXXFLAGS ${OMNIORB_CXXFLAGS}) - -# ---- - -IF(WINDOWS) - FIND_LIBRARY(lib_omniORB4 omniORB4_rtd ${OMNIORB_ROOT}/lib/x86_win32) - FIND_LIBRARY(lib_omniDynamic4 omniDynamic4_rtd ${OMNIORB_ROOT}/lib/x86_win32) - FIND_LIBRARY(lib_COS4 COS4_rtd ${OMNIORB_ROOT}/lib/x86_win32) - FIND_LIBRARY(lib_COSDynamic4 COSDynamic4_rtd ${OMNIORB_ROOT}/lib/x86_win32) - FIND_LIBRARY(lib_omnithread omnithread_rtd ${OMNIORB_ROOT}/lib/x86_win32) -ELSE(WINDOWS) - FIND_LIBRARY(lib_omniORB4 omniORB4 ${OMNIORB_ROOT}/lib) - FIND_LIBRARY(lib_omniDynamic4 omniDynamic4 ${OMNIORB_ROOT}/lib) - FIND_LIBRARY(lib_COS4 COS4 ${OMNIORB_ROOT}/lib) - FIND_LIBRARY(lib_COSDynamic4 COSDynamic4 ${OMNIORB_ROOT}/lib) - FIND_LIBRARY(lib_omnithread omnithread ${OMNIORB_ROOT}/lib) -ENDIF(WINDOWS) - -SET(OMNIORB_LIBS ${lib_omniORB4} ${lib_omniDynamic4} ${lib_COS4} ${lib_COSDynamic4} ${lib_omnithread}) -IF(WINDOWS) - SET(OMNIORB_LIBS ws2_32.lib mswsock.lib advapi32.lib ${OMNIORB_LIBS}) -ENDIF(WINDOWS) - -SET(CORBA_LIBS ${OMNIORB_LIBS}) +IF(OMNIORB_STATUS) + IF(OMNIORB_ROOT_USER) + IF(WINDOWS) + SET(OMNIORB_LIB_PATHS ${OMNIORB_ROOT_USER}/lib/x86_win32) + ELSE(WINDOWS) + SET(OMNIORB_LIB_PATHS ${OMNIORB_ROOT_USER}/lib) + ENDIF(WINDOWS) + ELSE(OMNIORB_ROOT_USER) + SET(OMNIORB_LIB_PATHS) + ENDIF(OMNIORB_ROOT_USER) +ENDIF(OMNIORB_STATUS) + +IF(OMNIORB_STATUS) + IF(WINDOWS) + IF(CMAKE_BUILD_TYPE STREQUAL Release) + SET(OMNIORB_LIB_SUFFIX _rt) + ELSE(CMAKE_BUILD_TYPE STREQUAL Release) + SET(OMNIORB_LIB_SUFFIX _rtd) + ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) + ELSE(WINDOWS) + SET(OMNIORB_LIB_SUFFIX) + ENDIF(WINDOWS) +ENDIF(OMNIORB_STATUS) + +SET(OMNIORB_LIBS) +FOREACH(lib omniORB4 omniDynamic4 COS4 COSDynamic4 omnithread) + IF(OMNIORB_STATUS) + FIND_LIBRARY(${lib}${OMNIORB_LIB_SUFFIX} ${lib}${OMNIORB_LIB_SUFFIX} PATHS ${OMNIORB_LIB_PATHS} ${OMNIORB_FIND_PATHS_OPTION}) + IF(${lib}${OMNIORB_LIB_SUFFIX}) + SET(OMNIORB_LIBS ${OMNIORB_LIBS} ${${lib}${OMNIORB_LIB_SUFFIX}}) + MESSAGE(STATUS "${lib}${OMNIORB_LIB_SUFFIX} lib found: ${${lib}${OMNIORB_LIB_SUFFIX}}") + ELSE(${lib}${OMNIORB_LIB_SUFFIX}) + SET(OMNIORB_STATUS 0) + IF(OMNIORB_ROOT_USER) + MESSAGE(STATUS "${lib}${OMNIORB_LIB_SUFFIX} lib not found in ${OMNIORB_LIB_PATHS}, check your OMNIORB installation.") + ELSE(OMNIORB_ROOT_USER) + MESSAGE(STATUS "${lib}${OMNIORB_LIB_SUFFIX} lib not found on system, try to use WITH_OMNIORB option or OMNIORB_ROOT environment variable.") + ENDIF(OMNIORB_ROOT_USER) + ENDIF(${lib}${OMNIORB_LIB_SUFFIX}) + ENDIF(OMNIORB_STATUS) +ENDFOREACH(lib omniORB4 omniDynamic4 COS4 COSDynamic4 omnithread) # ---------------- -SET(OMNIORB_IDL_PYTHON $ENV{OMNIIDL_PYTHON}) -IF(NOT OMNIORB_IDL_PYTHON) - SET(OMNIORB_IDL_PYTHON ${OMNIORB_IDL}) -ENDIF(NOT OMNIORB_IDL_PYTHON) +IF(OMNIORB_STATUS) + SET(OMNIORB_IDL_PYTHON $ENV{OMNIIDL_PYTHON}) + IF(NOT OMNIORB_IDL_PYTHON) + SET(OMNIORB_IDL_PYTHON ${OMNIIDL_EXECUTABLE}) + ENDIF(NOT OMNIORB_IDL_PYTHON) +ENDIF(OMNIORB_STATUS) -# ---------------- +# ---- -SET(IDL_CLN_H .hh) -SET(IDL_SRV_H .hh) +IF(OMNIORB_STATUS) + SET(CORBA_GEN 1) + SET(OMNIORB_IDL ${OMNIIDL_EXECUTABLE}) + SET(CORBA_INCLUDES ${OMNIORB_INCLUDES}) + SET(CORBA_CXXFLAGS ${OMNIORB_CXXFLAGS}) + SET(CORBA_LIBS ${OMNIORB_LIBS}) + SET(OMNIORB_IDLCXXFLAGS -Wba -nf) + SET(OMNIORB_IDLPYFLAGS -bpython) + SET(IDLCXXFLAGS ${OMNIORB_IDLCXXFLAGS}) + SET(IDLPYFLAGS ${OMNIORB_IDLPYFLAGS}) + SET(IDL_CLN_H .hh) + SET(IDL_SRV_H .hh) +ELSE(OMNIORB_STATUS) + SET(CORBA_GEN 0) + IF(OMNIORB_IS_MANDATORY) + MESSAGE(FATAL_ERROR "omniorb not found ... mandatory ... abort") + ELSE(OMNIORB_IS_MANDATORY) + MESSAGE(STATUS "omniorb not found ... optional ... disabled") + ENDIF(OMNIORB_IS_MANDATORY) +ENDIF(OMNIORB_STATUS) -# SET(OMNIORB_IDLCXXFLAGS -Wba -nf) -# SET(OMNIORB_IDLPYFLAGS -bpython) -SET(IDLCXXFLAGS -Wba -nf) -SET(IDLPYFLAGS -bpython) +# ---- diff --git a/salome_adm/cmake_files/FindPLATFORM.cmake b/salome_adm/cmake_files/FindPLATFORM.cmake index 28fd28803..7002c2a1e 100644 --- a/salome_adm/cmake_files/FindPLATFORM.cmake +++ b/salome_adm/cmake_files/FindPLATFORM.cmake @@ -19,6 +19,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # + MARK_AS_ADVANCED(ISSUE) FIND_FILE(ISSUE issue /etc) IF(ISSUE) @@ -29,36 +30,57 @@ ENDIF(ISSUE) IF(WINDOWS) SET(MACHINE WINDOWS) - SET(PLATFORM_CPPFLAGS) - SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DWNT) - SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DPPRO_NT) - SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} /W0) - # # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DWNT -D_CRT_SECURE_NO_WARNINGS) - # # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_WIN32_WINNT=0x0500) - # SET(RM del) ELSE(WINDOWS) SET(MACHINE PCLINUX) - SET(PLATFORM_CPPFLAGS) - # SET(RM /bin/rm) ENDIF(WINDOWS) -IF(WINDOWS) +SET(CMAKE_INSTALL_PREFIX_ENV $ENV{CMAKE_INSTALL_PREFIX}) +IF(CMAKE_INSTALL_PREFIX_ENV) + SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX_ENV} CACHE PATH "installation prefix" FORCE) +ENDIF(CMAKE_INSTALL_PREFIX_ENV) + +IF(NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE $ENV{CMAKE_BUILD_TYPE}) - IF(CMAKE_BUILD_TYPE STREQUAL Release) +ENDIF(NOT CMAKE_BUILD_TYPE) + +IF(CMAKE_BUILD_TYPE) + IF(WINDOWS) MARK_AS_ADVANCED(CLEAR CMAKE_CONFIGURATION_TYPES) - SET(CMAKE_CONFIGURATION_TYPES Release CACHE STRING "compilation types" FORCE) - ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) -ENDIF(WINDOWS) + SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE} CACHE STRING "compilation types" FORCE) + ELSE(WINDOWS) + IF(CMAKE_BUILD_TYPE STREQUAL Release) + SET(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG") + SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") + ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) + ENDIF(WINDOWS) +ENDIF(CMAKE_BUILD_TYPE) +SET(PLATFORM_CPPFLAGS) +SET(PLATFORM_LDFLAGS) +SET(PLATFORM_LIBADD) IF(WINDOWS) - SET(CMAKE_INSTALL_PREFIX_ENV $ENV{CMAKE_INSTALL_PREFIX}) - IF(CMAKE_INSTALL_PREFIX_ENV) - SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX_ENV} CACHE PATH "installation prefix" FORCE) - ENDIF(CMAKE_INSTALL_PREFIX_ENV) + SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} /W0) + SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DWNT) + SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DPPRO_NT) # For medfile + SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_USE_MATH_DEFINES) # At least for MEDMEM + SET(PLATFORM_LIBADD Ws2_32.lib) + SET(PLATFORM_LIBADD Userenv.lib) # At least for GEOM suit +ELSE(WINDOWS) + SET(PLATFORM_LIBADD -ldl) ENDIF(WINDOWS) -## SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_DEBUG_) +# SET(PLATFORM_CPPFLAGS) +# # # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DWNT -D_CRT_SECURE_NO_WARNINGS) +# # # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_WIN32_WINNT=0x0500) +# # SET(RM del) +#ELSE(WINDOWS) +# # SET(RM /bin/rm) +#ENDIF(WINDOWS) + +### SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_DEBUG_) + +##SET(RCP rcp) +##SET(RSH rsh) +##SET(RCP rcp) -#SET(RCP rcp) -#SET(RSH rsh) -#SET(RCP rcp) +## MESSAGE(FATAL_ERROR "ZZZZZZZ") diff --git a/salome_adm/cmake_files/FindPTHREADS.cmake b/salome_adm/cmake_files/FindPTHREADS.cmake index 514f2ed52..1f4808cd3 100644 --- a/salome_adm/cmake_files/FindPTHREADS.cmake +++ b/salome_adm/cmake_files/FindPTHREADS.cmake @@ -19,15 +19,119 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(PTHREADS_ROOT $ENV{PTHREADS_ROOT}) -IF(PTHREADS_ROOT) - FIND_PATH(PTHREADS_INCLUDE_DIR pthread.h ${PTHREADS_ROOT}/include) +# ------ + +MESSAGE(STATUS "Check for pthreads ...") + +# ------ + +IF(PTHREADS_IS_MANDATORY STREQUAL 0) + SET(PTHREADS_IS_MANDATORY 0) + SET(PTHREADS_IS_OPTIONAL 1) +ENDIF(PTHREADS_IS_MANDATORY STREQUAL 0) +IF(PTHREADS_IS_OPTIONAL STREQUAL 0) + SET(PTHREADS_IS_MANDATORY 1) + SET(PTHREADS_IS_OPTIONAL 0) +ENDIF(PTHREADS_IS_OPTIONAL STREQUAL 0) +IF(NOT PTHREADS_IS_MANDATORY AND NOT PTHREADS_IS_OPTIONAL) + SET(PTHREADS_IS_MANDATORY 1) + SET(PTHREADS_IS_OPTIONAL 0) +ENDIF(NOT PTHREADS_IS_MANDATORY AND NOT PTHREADS_IS_OPTIONAL) + +# ------ + +SET(PTHREADS_STATUS 1) +IF(WITHOUT_PTHREADS OR WITH_PTHREADS STREQUAL 0) + SET(PTHREADS_STATUS 0) + MESSAGE(STATUS "pthreads disabled from command line.") +ENDIF(WITHOUT_PTHREADS OR WITH_PTHREADS STREQUAL 0) + +# ------ + +IF(PTHREADS_STATUS) + IF(WITH_PTHREADS) + SET(PTHREADS_ROOT_USER ${WITH_PTHREADS}) + ELSE(WITH_PTHREADS) + SET(PTHREADS_ROOT_USER $ENV{PTHREADS_ROOT}) + ENDIF(WITH_PTHREADS) +ENDIF(PTHREADS_STATUS) + +# ----- + +IF(PTHREADS_STATUS) + IF(PTHREADS_ROOT_USER) + SET(PTHREADS_FIND_PATHS_OPTION NO_DEFAULT_PATH) + ELSE(PTHREADS_ROOT_USER) + SET(PTHREADS_FIND_PATHS_OPTION) + ENDIF(PTHREADS_ROOT_USER) +ENDIF(PTHREADS_STATUS) + +# ----- + +IF(PTHREADS_STATUS) + IF(PTHREADS_ROOT_USER) + SET(PTHREADS_INCLUDE_PATHS ${PTHREADS_ROOT_USER}/include) + ELSE(PTHREADS_ROOT_USER) + SET(PTHREADS_INCLUDE_PATHS) + ENDIF(PTHREADS_ROOT_USER) + SET(PTHREADS_INCLUDE_TO_FIND pthread.h) + FIND_PATH(PTHREADS_INCLUDE_DIR ${PTHREADS_INCLUDE_TO_FIND} PATHS ${PTHREADS_INCLUDE_PATHS} ${PTHREADS_FIND_PATHS_OPTION}) IF(PTHREADS_INCLUDE_DIR) - SET(PTHREADS_INCLUDES -I${PTHREADS_INCLUDE_DIR}) + IF(PTHREADS_ROOT_USER) + SET(PTHREAD_CFLAGS -I${PTHREADS_INCLUDE_DIR}) + ENDIF(PTHREADS_ROOT_USER) + MESSAGE(STATUS "${PTHREADS_INCLUDE_TO_FIND} found in ${PTHREADS_INCLUDE_DIR}") + ELSE(PTHREADS_INCLUDE_DIR) + SET(PTHREADS_STATUS 0) + IF(PTHREADS_ROOT_USER) + MESSAGE(STATUS "${PTHREADS_INCLUDE_TO_FIND} not found in ${PTHREADS_INCLUDE_PATHS}, check your PTHREADS installation.") + ELSE(PTHREADS_ROOT_USER) + MESSAGE(STATUS "${PTHREADS_INCLUDE_TO_FIND} not found on system, try to use WITH_PTHREADS option or PTHREADS_ROOT environment variable.") + ENDIF(PTHREADS_ROOT_USER) ENDIF(PTHREADS_INCLUDE_DIR) - IF(CMAKE_BUILD_TYPE STREQUAL Release) - FIND_LIBRARY(PTHREADS_LIBRARY pthreadVSE2 ${PTHREADS_ROOT}/lib) - ELSE(CMAKE_BUILD_TYPE STREQUAL Release) - FIND_LIBRARY(PTHREADS_LIBRARY pthreadVSE2d ${PTHREADS_ROOT}/lib) - ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) -ENDIF(PTHREADS_ROOT) +ENDIF(PTHREADS_STATUS) + +# ---- + +IF(PTHREADS_STATUS) + IF(PTHREADS_ROOT_USER) + SET(PTHREADS_LIB_PATHS ${PTHREADS_ROOT_USER}/lib) + ELSE(PTHREADS_ROOT_USER) + SET(PTHREADS_LIB_PATHS) + ENDIF(PTHREADS_ROOT_USER) +ENDIF(PTHREADS_STATUS) + +IF(PTHREADS_STATUS) + IF(WINDOWS) + IF(CMAKE_BUILD_TYPE STREQUAL Release) + FIND_LIBRARY(PTHREAD_LIB pthreadVSE2 PATHS ${PTHREADS_LIB_PATHS} ${PTHREADS_FIND_PATHS_OPTION}) + ELSE(CMAKE_BUILD_TYPE STREQUAL Release) + FIND_LIBRARY(PTHREAD_LIB pthreadVSE2d PATHS ${PTHREADS_LIB_PATHS} ${PTHREADS_FIND_PATHS_OPTION}) + ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) + ELSE(WINDOWS) + FIND_LIBRARY(PTHREAD_LIB pthread PATHS ${PTHREADS_LIB_PATHS} ${PTHREADS_FIND_PATHS_OPTION}) + ENDIF(WINDOWS) + SET(PTHREAD_LIBS) + IF(PTHREAD_LIB) + SET(PTHREAD_LIBS ${PTHREAD_LIBS} ${PTHREAD_LIB}) + MESSAGE(STATUS "pthread lib found: ${PTHREAD_LIB}") + ELSE(PTHREAD_LIB) + SET(PTHREADS_STATUS 0) + IF(PTHREADS_ROOT_USER) + MESSAGE(STATUS "pthread lib not found in ${PTHREADS_LIB_PATHS}, check your PTHREADS installation.") + ELSE(PTHREADS_ROOT_USER) + MESSAGE(STATUS "pthread lib not found on system, try to use WITH_PTHREADS option or PTHREADS_ROOT environment variable.") + ENDIF(PTHREADS_ROOT_USER) + ENDIF(PTHREAD_LIB) +ENDIF(PTHREADS_STATUS) + +# ---- + +IF(PTHREADS_STATUS) +ELSE(PTHREADS_STATUS) + IF(PTHREADS_IS_MANDATORY) + MESSAGE(FATAL_ERROR "pthreads not found ... mandatory ... abort") + ELSE(PTHREADS_IS_MANDATORY) + MESSAGE(STATUS "pthreads not found ... optional ... disabled") + ENDIF(PTHREADS_IS_MANDATORY) +ENDIF(PTHREADS_STATUS) diff --git a/salome_adm/cmake_files/FindPYTHON.cmake b/salome_adm/cmake_files/FindPYTHON.cmake index d97820a0a..f1215749d 100644 --- a/salome_adm/cmake_files/FindPYTHON.cmake +++ b/salome_adm/cmake_files/FindPYTHON.cmake @@ -19,44 +19,166 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -IF(WINDOWS) - IF(CMAKE_BUILD_TYPE STREQUAL Release) - FIND_PROGRAM(PYTHON_EXECUTABLE python) - ELSE(CMAKE_BUILD_TYPE STREQUAL Release) - FIND_PROGRAM(PYTHON_EXECUTABLE python_d) - ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) -ELSE(WINDOWS) - FIND_PROGRAM(PYTHON_EXECUTABLE python) -ENDIF(WINDOWS) - -EXECUTE_PROCESS( - COMMAND ${PYTHON_EXECUTABLE} -c "import sys; sys.stdout.write(sys.version[:3])" - OUTPUT_VARIABLE PYTHON_VERSION - ) - -SET(PYTHON_ROOT ${PYTHON_EXECUTABLE}) -GET_FILENAME_COMPONENT(PYTHON_ROOT ${PYTHON_ROOT} PATH) -GET_FILENAME_COMPONENT(PYTHON_ROOT ${PYTHON_ROOT} PATH) - -FIND_PATH(PYTHON_INCLUDE_PATH Python.h PATHS ${PYTHON_ROOT}/include ${PYTHON_ROOT}/include/python${PYTHON_VERSION}) - -IF(WINDOWS) - STRING(REPLACE "." "" PYTHON_VERSION_WITHOUT_DOT ${PYTHON_VERSION}) - IF(CMAKE_BUILD_TYPE STREQUAL Release) - FIND_LIBRARY(PYTHON_LIBRARIES python${PYTHON_VERSION_WITHOUT_DOT} ${PYTHON_ROOT}/libs) - ELSE(CMAKE_BUILD_TYPE STREQUAL Release) - FIND_LIBRARY(PYTHON_LIBRARIES python${PYTHON_VERSION_WITHOUT_DOT}_d ${PYTHON_ROOT}/libs) - ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) -ELSE(WINDOWS) - FIND_LIBRARY(PYTHON_LIBRARIES python${PYTHON_VERSION} ${PYTHON_ROOT}/lib) -ENDIF(WINDOWS) - -SET(PYTHON_INCLUDES -I${PYTHON_INCLUDE_PATH}) -SET(PYTHON_LIBS ${PYTHON_LIBRARIES}) - -IF(WINDOWS) - IF(CMAKE_BUILD_TYPE STREQUAL Release) - ELSE(CMAKE_BUILD_TYPE STREQUAL Release) - SET(PYTHON_INCLUDES ${PYTHON_INCLUDES} -DHAVE_DEBUG_PYTHON) - ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) -ENDIF(WINDOWS) +# ------ + +MESSAGE(STATUS "Check for python ...") + +# ------ + +IF(PYTHON_IS_MANDATORY STREQUAL 0) + SET(PYTHON_IS_MANDATORY 0) + SET(PYTHON_IS_OPTIONAL 1) +ENDIF(PYTHON_IS_MANDATORY STREQUAL 0) +IF(PYTHON_IS_OPTIONAL STREQUAL 0) + SET(PYTHON_IS_MANDATORY 1) + SET(PYTHON_IS_OPTIONAL 0) +ENDIF(PYTHON_IS_OPTIONAL STREQUAL 0) +IF(NOT PYTHON_IS_MANDATORY AND NOT PYTHON_IS_OPTIONAL) + SET(PYTHON_IS_MANDATORY 1) + SET(PYTHON_IS_OPTIONAL 0) +ENDIF(NOT PYTHON_IS_MANDATORY AND NOT PYTHON_IS_OPTIONAL) + +# ------ + +SET(PYTHON_STATUS 1) +IF(WITHOUT_PYTHON OR WITH_PYTHON STREQUAL 0) + SET(PYTHON_STATUS 0) + MESSAGE(STATUS "python disabled from command line.") +ENDIF(WITHOUT_PYTHON OR WITH_PYTHON STREQUAL 0) + +# ------ + +IF(PYTHON_STATUS) + IF(WITH_PYTHON) + SET(PYTHON_ROOT_USER ${WITH_PYTHON}) + ENDIF(WITH_PYTHON) + IF(NOT PYTHON_ROOT_USER) + SET(PYTHON_ROOT_USER $ENV{PYTHON_ROOT}) + ENDIF(NOT PYTHON_ROOT_USER) + IF(NOT PYTHON_ROOT_USER) + SET(PYTHON_ROOT_USER $ENV{PYTHONHOME}) + ENDIF(NOT PYTHON_ROOT_USER) +ENDIF(PYTHON_STATUS) + +# ------ + +IF(PYTHON_STATUS) + IF(NOT PYTHON_ROOT_USER) + IF(WINDOWS) + IF(CMAKE_BUILD_TYPE STREQUAL Release) + FIND_PROGRAM(PYTHON_EXECUTABLE python) + ELSE(CMAKE_BUILD_TYPE STREQUAL Release) + FIND_PROGRAM(PYTHON_EXECUTABLE python_d) + ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) + ELSE(WINDOWS) + FIND_PROGRAM(PYTHON_EXECUTABLE python) + ENDIF(WINDOWS) + IF(PYTHON_EXECUTABLE) + MESSAGE(STATUS "python found: ${PYTHON_EXECUTABLE}") + IF(PYTHON_EXECUTABLE STREQUAL /usr/bin/python) + ELSE(PYTHON_EXECUTABLE STREQUAL /usr/bin/python) + SET(PYTHON_ROOT_USER ${PYTHON_EXECUTABLE}) + GET_FILENAME_COMPONENT(PYTHON_ROOT_USER ${PYTHON_ROOT_USER} PATH) + GET_FILENAME_COMPONENT(PYTHON_ROOT_USER ${PYTHON_ROOT_USER} PATH) + ENDIF(PYTHON_EXECUTABLE STREQUAL /usr/bin/python) + ELSE(PYTHON_EXECUTABLE) + MESSAGE(STATUS "python not found, try to use WITH_PYTHON option or PYTHONHOME environment variable") + SET(PYTHON_STATUS 0) + ENDIF(PYTHON_EXECUTABLE) + ENDIF(NOT PYTHON_ROOT_USER) +ENDIF(PYTHON_STATUS) + +# ------ + +IF(PYTHON_STATUS) + EXECUTE_PROCESS( + COMMAND ${PYTHON_EXECUTABLE} -c "import sys; sys.stdout.write(sys.version[:3])" + OUTPUT_VARIABLE PYTHON_VERSION + ) +ENDIF(PYTHON_STATUS) + +# ------ + +IF(PYTHON_STATUS) + IF(PYTHON_ROOT_USER) + SET(PYTHON_FIND_PATHS_OPTION NO_DEFAULT_PATH) + ELSE(PYTHON_ROOT_USER) + SET(PYTHON_FIND_PATHS_OPTION) + ENDIF(PYTHON_ROOT_USER) +ENDIF(PYTHON_STATUS) + +# ------ + +IF(PYTHON_STATUS) + IF(PYTHON_ROOT_USER) + SET(PYTHON_INCLUDE_PATHS ${PYTHON_ROOT_USER}/include ${PYTHON_ROOT_USER}/include/python${PYTHON_VERSION}) + ELSE(PYTHON_ROOT_USER) + SET(PYTHON_INCLUDE_PATHS /usr/include/python${PYTHON_VERSION}) + ENDIF(PYTHON_ROOT_USER) + SET(PYTHON_INCLUDE_TO_FIND Python.h) + FIND_PATH(PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_TO_FIND} PATHS ${PYTHON_INCLUDE_PATHS} ${PYTHON_FIND_PATHS_OPTION}) + IF(PYTHON_INCLUDE_DIR) + SET(PYTHON_INCLUDES -I${PYTHON_INCLUDE_DIR}) + IF(WINDOWS) + IF(CMAKE_BUILD_TYPE STREQUAL Release) + ELSE(CMAKE_BUILD_TYPE STREQUAL Release) + SET(PYTHON_INCLUDES ${PYTHON_INCLUDES} -DHAVE_DEBUG_PYTHON) + ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) + ENDIF(WINDOWS) + MESSAGE(STATUS "${PYTHON_INCLUDE_TO_FIND} found in ${PYTHON_INCLUDE_DIR}") + ELSE(PYTHON_INCLUDE_DIR) + SET(PYTHON_STATUS 0) + IF(PYTHON_ROOT_USER) + MESSAGE(STATUS "${PYTHON_INCLUDE_TO_FIND} not found in ${PYTHON_INCLUDE_PATHS}, check your PYTHON installation.") + ELSE(PYTHON_ROOT_USER) + MESSAGE(STATUS "${PYTHON_INCLUDE_TO_FIND} not found on system, try to use WITH_PYTHON option or PYTHON_ROOT environment variable.") + ENDIF(PYTHON_ROOT_USER) + ENDIF(PYTHON_INCLUDE_DIR) +ENDIF(PYTHON_STATUS) + +# ---- + +IF(PYTHON_STATUS) + IF(PYTHON_ROOT_USER) + IF(WINDOWS) + SET(PYTHON_LIB_PATHS ${PYTHON_ROOT_USER}/libs) + ELSE(WINDOWS) + SET(PYTHON_LIB_PATHS ${PYTHON_ROOT_USER}/lib) + ENDIF(WINDOWS) + ELSE(PYTHON_ROOT_USER) + SET(PYTHON_LIB_PATHS) + ENDIF(PYTHON_ROOT_USER) + IF(WINDOWS) + STRING(REPLACE "." "" PYTHON_VERSION_WITHOUT_DOT ${PYTHON_VERSION}) + IF(CMAKE_BUILD_TYPE STREQUAL Release) + FIND_LIBRARY(PYTHON_LIB python${PYTHON_VERSION_WITHOUT_DOT} PATHS ${PYTHON_LIB_PATHS} ${PYTHON_FIND_PATHS_OPTION}) + ELSE(CMAKE_BUILD_TYPE STREQUAL Release) + FIND_LIBRARY(PYTHON_LIB python${PYTHON_VERSION_WITHOUT_DOT}_d PATHS ${PYTHON_LIB_PATHS} ${PYTHON_FIND_PATHS_OPTION}) + ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) + ELSE(WINDOWS) + FIND_LIBRARY(PYTHON_LIB python${PYTHON_VERSION} PATHS ${PYTHON_LIB_PATHS} ${PYTHON_FIND_PATHS_OPTION}) + ENDIF(WINDOWS) + SET(PYTHON_LIBS) + IF(PYTHON_LIB) + SET(PYTHON_LIBS ${PYTHON_LIBS} ${PYTHON_LIB}) + MESSAGE(STATUS "python lib found: ${PYTHON_LIB}") + ELSE(PYTHON_LIB) + SET(PYTHON_STATUS 0) + IF(PYTHON_ROOT_USER) + MESSAGE(STATUS "python lib not found in ${PYTHON_LIB_PATHS}, check your PYTHON installation.") + ELSE(PYTHON_ROOT_USER) + MESSAGE(STATUS "python lib not found on system, try to use WITH_PYTHON option or PYTHON_ROOT environment variable.") + ENDIF(PYTHON_ROOT_USER) + ENDIF(PYTHON_LIB) +ENDIF(PYTHON_STATUS) + +# ---- + +IF(PYTHON_STATUS) +ELSE(PYTHON_STATUS) + IF(PYTHON_IS_MANDATORY) + MESSAGE(FATAL_ERROR "python not found ... mandatory ... abort") + ELSE(PYTHON_IS_MANDATORY) + MESSAGE(STATUS "python not found ... optional ... disabled") + ENDIF(PYTHON_IS_MANDATORY) +ENDIF(PYTHON_STATUS) diff --git a/salome_adm/cmake_files/FindSWIG.cmake b/salome_adm/cmake_files/FindSWIG.cmake index c6a9a4356..0545cfaa6 100644 --- a/salome_adm/cmake_files/FindSWIG.cmake +++ b/salome_adm/cmake_files/FindSWIG.cmake @@ -19,5 +19,74 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -FIND_PROGRAM(SWIG_EXECUTABLE swig) -SET(SWIG_FLAGS -c++ -python -shadow) +# ------ + +MESSAGE(STATUS "Check for swig ...") + +# ------ + +IF(SWIG_IS_MANDATORY STREQUAL 0) + SET(SWIG_IS_MANDATORY 0) + SET(SWIG_IS_OPTIONAL 1) +ENDIF(SWIG_IS_MANDATORY STREQUAL 0) +IF(SWIG_IS_OPTIONAL STREQUAL 0) + SET(SWIG_IS_MANDATORY 1) + SET(SWIG_IS_OPTIONAL 0) +ENDIF(SWIG_IS_OPTIONAL STREQUAL 0) +IF(NOT SWIG_IS_MANDATORY AND NOT SWIG_IS_OPTIONAL) + SET(SWIG_IS_MANDATORY 1) + SET(SWIG_IS_OPTIONAL 0) +ENDIF(NOT SWIG_IS_MANDATORY AND NOT SWIG_IS_OPTIONAL) + +# ------ + +SET(SWIG_STATUS 1) +IF(WITHOUT_SWIG OR WITH_SWIG STREQUAL 0) + SET(SWIG_STATUS 0) + MESSAGE(STATUS "swig disabled from command line.") +ENDIF(WITHOUT_SWIG OR WITH_SWIG STREQUAL 0) + +# ------ + +IF(SWIG_STATUS) + IF(WITH_SWIG) + SET(SWIG_ROOT_USER ${WITH_SWIG}) + ENDIF(WITH_SWIG) + IF(NOT SWIG_ROOT_USER) + SET(SWIG_ROOT_USER $ENV{SWIG_ROOT}) + ENDIF(NOT SWIG_ROOT_USER) + IF(NOT SWIG_ROOT_USER) + SET(SWIG_ROOT_USER $ENV{SWIGHOME}) + ENDIF(NOT SWIG_ROOT_USER) +ENDIF(SWIG_STATUS) + +# ------ + +IF(SWIG_STATUS) + SET(SWIG_EXECUTABLE_TO_FIND swig) + IF(SWIG_ROOT_USER) + FIND_PROGRAM(SWIG_EXECUTABLE ${SWIG_EXECUTABLE_TO_FIND} PATHS ${SWIG_ROOT_USER}/bin NO_DEFAULT_PATH) + ELSE(SWIG_ROOT_USER) + FIND_PROGRAM(SWIG_EXECUTABLE ${SWIG_EXECUTABLE_TO_FIND}) + ENDIF(SWIG_ROOT_USER) + IF(SWIG_EXECUTABLE) + MESSAGE(STATUS "${SWIG_EXECUTABLE_TO_FIND} found: ${SWIG_EXECUTABLE}") + ELSE(SWIG_EXECUTABLE) + MESSAGE(STATUS "${SWIG_EXECUTABLE_TO_FIND} not found, try to use WITH_SWIG option or SWIG_ROOT (or SWIGHOME) environment variable") + SET(SWIG_STATUS 0) + ENDIF(SWIG_EXECUTABLE) +ENDIF(SWIG_STATUS) + +# ---- + +IF(SWIG_STATUS) + SET(SWIG_FLAGS -c++ -python -shadow) +ELSE(SWIG_STATUS) + IF(SWIG_IS_MANDATORY) + MESSAGE(FATAL_ERROR "swig not found ... mandatory ... abort") + ELSE(SWIG_IS_MANDATORY) + MESSAGE(STATUS "swig not found ... optional ... disabled") + ENDIF(SWIG_IS_MANDATORY) +ENDIF(SWIG_STATUS) + +# ---- diff --git a/salome_adm/cmake_files/am2cmake.py b/salome_adm/cmake_files/am2cmake.py index 31a7fd163..8f6ef65a0 100644 --- a/salome_adm/cmake_files/am2cmake.py +++ b/salome_adm/cmake_files/am2cmake.py @@ -124,16 +124,6 @@ class CMakeFile(object): # -- content = p_multiline.sub(r' ', content) - # -- - content = content.replace("-no-undefined -version-info=0:0:0", "") - content = content.replace("-include SALOMEconfig.h", "") - - # -- - # Compatibility medfile - # -- - content = content.replace("-no-undefined -version-info 0:0:0", "") - content = content.replace("-no-undefined -version-info 2:5:1", "") - # -- # Compatibility netgen plugin # -- @@ -352,10 +342,6 @@ class CMakeFile(object): full_list = cas_list + kernel_list + gui_list full_list += geom_list + med_list + smesh_list # -- - full_list += [ - "boost_thread", - ] - # -- # E.A. : sort by len before substitution ... # Why ? Thing to "-lMEDWrapper" then "-lMEDWrapper_V2_1" substition # And you understand ... @@ -405,15 +391,20 @@ class CMakeFile(object): self.finalize(newlines) # -- - # Add a last CR at the end of the file + # Concatenate newlines into content # -- - newlines.append('\n') + content = '\n'.join(newlines) # -- - # Concatenate newlines into content + # Add a CR at end if necessary # -- - content = '\n'.join(newlines) - + lines = content.split('\n') + # lines = [ l.strip() for l in lines ] + if len(lines[-1]) != 0: + lines.append('') + pass + content = '\n'.join(lines) + # -- self.content = content @@ -424,7 +415,7 @@ class CMakeFile(object): if self.root == self.the_root: # -- newlines.append(""" - CMAKE_MINIMUM_REQUIRED(VERSION 2.4) + CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR) IF(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) ENDIF(COMMAND cmake_policy) @@ -526,8 +517,8 @@ class CMakeFile(object): newlines.append(""" SET(WITH_LOCAL 1) SET(WITH_BATCH 1) - set(VERSION 4.1.3) - set(XVERSION 0x040103) + set(VERSION 5.1.1) + set(XVERSION 0x050101) """) elif self.module == "gui": newlines.append(""" @@ -583,6 +574,8 @@ class CMakeFile(object): pass # -- newlines.append(""" + SET(VERSION_INFO 0.0.0) + SET(SOVERSION_INFO 0) SET(SUBDIRS) SET(AM_CPPFLAGS) SET(AM_CXXFLAGS) @@ -627,7 +620,7 @@ class CMakeFile(object): return # -- - # A particuliar case + # A particuliar case where there are two ":" on the same line # -- if line.find('install-exec-local:') == 0: newlines.append("# " + line) @@ -640,6 +633,25 @@ class CMakeFile(object): newlines.append("# " + line) return + # -- + # -- + key = "-version-info" + if line.find(key) >= 0: + # -- + before = line.split(key)[0] + after = line[len(before)+len(key):] + sep = after[0] + after = after[1:] + version_info = after.split()[0] + line = line.replace(key+sep+version_info, "") + # -- + version_info = version_info.replace(':', '.') + soversion_info = version_info.split('.')[0] + newlines.append("SET(VERSION_INFO " + version_info + ")") + newlines.append("SET(SOVERSION_INFO " + soversion_info + ")") + # -- + pass + # -- # Replace the $(TOTO) by ${TOTO} # Replace the @TOTO@ by ${TOTO} @@ -1030,14 +1042,6 @@ class CMakeFile(object): # -- newlines.append(r''' IF(WINDOWS) - SET(libadd ${libadd} Userenv.lib Ws2_32.lib) - ELSE(WINDOWS) - SET(libadd ${libadd} -ldl -lpthread) - ENDIF(WINDOWS) - ''') - # -- - newlines.append(r''' - IF(WINDOWS) SET(targets) SET(targets ${targets} MEFISTO2D) FOREACH(target ${targets}) @@ -1052,7 +1056,7 @@ class CMakeFile(object): ''') # -- newlines.append(r''' - SET(libs ${${amname}_LIBADD} ${${amname}_LDADD} ${${amname}_LDFLAGS}) + SET(libs ${PLATFORM_LIBADD} ${PLATFORM_LDFLAGS} ${${amname}_LIBADD} ${${amname}_LDADD} ${${amname}_LDFLAGS}) ''') if key == "bin_PROGRAMS": newlines.append(r''' @@ -1067,54 +1071,30 @@ class CMakeFile(object): GET_FILENAME_COMPONENT(lib ${lib} NAME_WE) STRING(REPLACE "lib" "" lib ${lib}) ENDIF(ext STREQUAL .la) + SET(vars) + SET(vars ${vars} -no-undefined) + SET(vars ${vars} -lboost_thread) IF(WINDOWS) - SET(vars -Xlinker -export-dynamic -module -Wl,-E) - SET(vars ${vars} -lutil -lm) + SET(vars ${vars} -module) + SET(vars ${vars} -Wl,-E) + SET(vars ${vars} -Xlinker) + SET(vars ${vars} -export-dynamic) + SET(vars ${vars} -lm) + ENDIF(WINDOWS) FOREACH(v ${vars}) IF(lib STREQUAL v) SET(lib) ENDIF(lib STREQUAL v) ENDFOREACH(v ${vars}) - ENDIF(WINDOWS) SET(libadd ${libadd} ${lib}) ENDFOREACH(lib ${libs}) - TARGET_LINK_LIBRARIES(${name} ${PTHREADS_LIBRARY} ${libadd}) + IF(name STREQUAL SALOMEBasics) + TARGET_LINK_LIBRARIES(${name} ${PTHREAD_LIBS} ${libadd}) + ELSE(name STREQUAL SALOMEBasics) + TARGET_LINK_LIBRARIES(${name} ${libadd}) + ENDIF(name STREQUAL SALOMEBasics) ''') # -- - newlines.append(r''' - IF(WINDOWS) - SET(targets) - SET(targets ${targets} SalomeHDFPersist) - SET(targets ${targets} medC) - SET(targets ${targets} medimport) - SET(targets ${targets} medimportcxx) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - IF(CMAKE_BUILD_TYPE STREQUAL Release) - SET_TARGET_PROPERTIES(${name} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT") - ELSE(CMAKE_BUILD_TYPE STREQUAL Release) - SET_TARGET_PROPERTIES(${name} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMTD") - ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - SET(targets) - SET(targets ${targets} MEFISTO2D) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - SET_TARGET_PROPERTIES(${name} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:MSVCRT") - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - ''') - # -- - if self.module == "med": - newlines.append(r''' - IF(WINDOWS) - SET_TARGET_PROPERTIES(${name} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMTD") - ENDIF(WINDOWS) - ''') - pass - # -- return def setCompilationFlags(self, key, newlines): @@ -1124,6 +1104,7 @@ class CMakeFile(object): SET(targets) SET(targets ${targets} SalomeIDLKernel) SET(targets ${targets} SalomeDS) + SET(targets ${targets} SALOMEDSTest) SET(targets ${targets} SALOMEDS_Client_exe) SET(targets ${targets} SalomeIDLGEOM) SET(targets ${targets} GEOMEngine) @@ -1152,12 +1133,6 @@ class CMakeFile(object): ENDIF(WINDOWS) ''') # -- - newlines.append(r''' - IF(WINDOWS) - SET(var ${var} -D_USE_MATH_DEFINES) - ENDIF(WINDOWS) - ''') - # -- if self.module in ["geom", "med"]: newlines.append(r''' SET(var ${var} -I${CMAKE_CURRENT_SOURCE_DIR}) @@ -1172,12 +1147,21 @@ class CMakeFile(object): pass newlines.append(r''' SET(var ${var} ${PLATFORM_CPPFLAGS}) - SET(var ${var} ${PTHREADS_INCLUDES}) + SET(var ${var} ${PTHREAD_CFLAGS}) SET(var ${var} ${${amname}_CPPFLAGS}) SET(var ${var} ${${amname}_CXXFLAGS}) SET(var ${var} ${${amname}_CFLAGS}) + SET(vars) + IF(WINDOWS) + SET(vars ${vars} -include SALOMEconfig.h) + ENDIF(WINDOWS) SET(flags) FOREACH(f ${var}) + FOREACH(v ${vars}) + IF(f STREQUAL v) + SET(f) + ENDIF(f STREQUAL v) + ENDFOREACH(v ${vars}) SET(flags "${flags} ${f}") ENDFOREACH(f ${var}) SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS "${flags}") @@ -1293,150 +1277,7 @@ class CMakeFile(object): self.setCompilationFlags(key, newlines) # -- newlines.append(r''' - SET_TARGET_PROPERTIES(${name} PROPERTIES VERSION 0.0.0 SOVERSION 0) - FOREACH(lib medC med) - IF(lib STREQUAL ${name}) - SET_TARGET_PROPERTIES(${name} PROPERTIES VERSION 1.1.5 SOVERSION 1) - ENDIF(lib STREQUAL ${name}) - ENDFOREACH(lib medC med) - ''') - # -- - from os.path import basename - upper_name = basename(self.root).upper() - # -- - if upper_name in ["2.1.X", "2.3.1"]: - upper_name = "D_" + upper_name - pass - # -- - newlines.append(r''' - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL %s_EXPORTS) - '''%(upper_name)) - # -- - newlines.append(r''' - IF(name STREQUAL SalomeLauncher) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL SALOME%s_EXPORTS) - ENDIF(name STREQUAL SalomeLauncher) - '''%(upper_name)) - newlines.append(r''' - IF(name STREQUAL SalomeResourcesManager) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL SALOME%s_EXPORTS) - ENDIF(name STREQUAL SalomeResourcesManager) - '''%(upper_name)) - newlines.append(r''' - IF(name STREQUAL GEOMObject) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL GEOM_%s_EXPORTS) - ENDIF(name STREQUAL GEOMObject) - '''%(upper_name)) - newlines.append(r''' - IF(name STREQUAL medC) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MEDC_DLL_EXPORTS) - ENDIF(name STREQUAL medC) - ''') - newlines.append(r''' - IF(name STREQUAL med) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MED_DLL_EXPORTS) - ENDIF(name STREQUAL med) - ''') - newlines.append(r''' - IF(name STREQUAL medimport) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MEDIMPORT_DLL_EXPORTS) - ENDIF(name STREQUAL medimport) - ''') - newlines.append(r''' - IF(name STREQUAL medimportcxx) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MEDIMPORTCXX_DLL_EXPORTS) - ENDIF(name STREQUAL medimportcxx) - ''') - # -- - newlines.append(r''' - IF(name STREQUAL MEDWrapperBase) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MEDWRAPPER_BASE_EXPORTS) - ENDIF(name STREQUAL MEDWrapperBase) - ''') - newlines.append(r''' - IF(name STREQUAL MEDWrapper_V2_1) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MEDWRAPPER_V2_1_EXPORTS) - ENDIF(name STREQUAL MEDWrapper_V2_1) - ''') - newlines.append(r''' - IF(name STREQUAL med_V2_1) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MEDWRAPPER_V2_1_CORE_EXPORTS) - ENDIF(name STREQUAL med_V2_1) - ''') - newlines.append(r''' - IF(name STREQUAL MEDWrapper_V2_2) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MEDWRAPPER_V2_2_EXPORTS) - ENDIF(name STREQUAL MEDWrapper_V2_2) - ''') - newlines.append(r''' - IF(name STREQUAL MEDWrapper) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MEDWRAPPER_FACTORY_EXPORTS) - ENDIF(name STREQUAL MEDWrapper) - ''') - newlines.append(r''' - IF(name STREQUAL interpkernelbases) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL INTERPKERNELBASES_EXPORTS) - ENDIF(name STREQUAL interpkernelbases) - IF(name STREQUAL InterpGeometric2DAlg) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL INTERPKERNELGEOMETRIC2D_EXPORTS) - ENDIF(name STREQUAL InterpGeometric2DAlg) - IF(name STREQUAL interpkernel) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL INTERPKERNEL_EXPORTS) - ENDIF(name STREQUAL interpkernel) - IF(name STREQUAL MEDClientcmodule) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MEDCLIENT_EXPORTS) - ENDIF(name STREQUAL MEDClientcmodule) - ''') - # -- - newlines.append(r''' - IF(name STREQUAL SMESHControls) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL SMESHCONTROLS_EXPORTS) - ENDIF(name STREQUAL SMESHControls) - ''') - newlines.append(r''' - IF(name STREQUAL MeshDriver) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MESHDRIVER_EXPORTS) - ENDIF(name STREQUAL MeshDriver) - ''') - newlines.append(r''' - IF(name STREQUAL MeshDriverMED) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MESHDRIVERMED_EXPORTS) - ENDIF(name STREQUAL MeshDriverMED) - ''') - newlines.append(r''' - IF(name STREQUAL MeshDriverDAT) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MESHDRIVERDAT_EXPORTS) - ENDIF(name STREQUAL MeshDriverDAT) - ''') - newlines.append(r''' - IF(name STREQUAL MeshDriverUNV) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MESHDRIVERUNV_EXPORTS) - ENDIF(name STREQUAL MeshDriverUNV) - ''') - newlines.append(r''' - IF(name STREQUAL MeshDriverSTL) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MESHDRIVERSTL_EXPORTS) - ENDIF(name STREQUAL MeshDriverSTL) - ''') - newlines.append(r''' - IF(name STREQUAL MEFISTO2D) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MEFISTO2D_EXPORTS) - ENDIF(name STREQUAL MEFISTO2D) - ''') - newlines.append(r''' - IF(name STREQUAL SMESHObject) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL SMESHOBJECT_EXPORTS) - ENDIF(name STREQUAL SMESHObject) - ''') - newlines.append(r''' - IF(name STREQUAL _libSMESH_Swig) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL SMESH_SWIG_EXPORTS) - ENDIF(name STREQUAL _libSMESH_Swig) - ''') - newlines.append(r''' - IF(name STREQUAL NETGENPluginGUI) - SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL NETGENPLUGIN_GUI_EXPORTS) - ENDIF(name STREQUAL NETGENPluginGUI) + SET_TARGET_PROPERTIES(${name} PROPERTIES VERSION ${VERSION_INFO} SOVERSION ${SOVERSION_INFO}) ''') # -- self.setLibAdd(key, newlines) @@ -1470,10 +1311,14 @@ class CMakeFile(object): ''') pass newlines.append(r''' - IF(name STREQUAL SalomePyQt) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${name}.so DESTINATION ${DEST} RENAME ${name}.so) - ENDIF(name STREQUAL SalomePyQt) + # IF(name STREQUAL SalomePyQt) + # INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${name}.so DESTINATION ${DEST} RENAME ${name}.so) + # ENDIF(name STREQUAL SalomePyQt) + ''') + newlines.append(r''' ELSE(BEGIN_WITH_lib) + ''') + newlines.append(r''' IF(WINDOWS) INSTALL(TARGETS ${name} DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome) IF(CMAKE_BUILD_TYPE STREQUAL Release) @@ -1488,6 +1333,8 @@ class CMakeFile(object): INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${name}.so.${version} DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}.so.${soversion}) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${name}.so.${version} DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}.so) ENDIF(WINDOWS) + ''') + newlines.append(r''' ENDIF(BEGIN_WITH_lib) ''') pass @@ -1607,6 +1454,33 @@ class CMakeFile(object): ENDIF(dummy) ENDIF(test_SALOMEconfig.h.in) ''') + newlines.append(r''' + GET_FILENAME_COMPONENT(ext ${f} EXT) + IF(ext STREQUAL .py) + INSTALL(CODE "SET(PYTHON_FILE ${f})") + INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})") + INSTALL(CODE "SET(DEST ${DEST})") + INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})") + ''') + if self.module == "kernel": + newlines.append(''' + IF(f STREQUAL SALOME_ContainerPy.py) + ELSE(f STREQUAL SALOME_ContainerPy.py) + IF(f STREQUAL am2cmake.py) + ELSE(f STREQUAL am2cmake.py) + INSTALL(SCRIPT ${CMAKE_SOURCE_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake) + ENDIF(f STREQUAL am2cmake.py) + ENDIF(f STREQUAL SALOME_ContainerPy.py) + ''') + else: + newlines.append(''' + STRING(REPLACE "\\\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR}) + INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake) + ''') + pass + newlines.append(r''' + ENDIF(ext STREQUAL .py) + ''') newlines.append(r"ENDFOREACH(f ${%s})"%(key)) return @@ -1651,11 +1525,18 @@ if __name__ == "__main__": # from os import walk for root, dirs, files in walk(the_root): - from os.path import basename - if basename(root) == "CVS": continue + # -- + # E.A. : Remove 'CVS' in dirs + # E.A. : It allows to not recurse in CVS dirs + # E.A. : See os module python documentation + # -- + try: + dirs.remove('CVS') + except ValueError: + pass + # -- for f in files: - from os.path import basename - if basename(f) == "Makefile.am": + if f == "Makefile.am": convertAmFile(the_root, root, dirs, files, f, module) pass pass -- 2.39.2