ENABLE_TESTING()
-MACRO(ADD_UNIT_TESTS)
- if (WIN32) # different separators and path to libraries variable name
- SET(_JUSTPATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_BIN};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES};${SUIT_LIB_DIR};${SALOME_KERNEL_LIBDIR};$ENV{PATH}")
- STRING(REPLACE "\\" "/" _JUSTPATH "${_JUSTPATH}")
- STRING(REPLACE ";" "\\;" _JUSTPATH "${_JUSTPATH}")
- SET(_PYTHONPATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_ADDONS};$ENV{PYTHONPATH}")
- STRING(REPLACE "\\" "/" _PYTHONPATH "${_PYTHONPATH}")
- STRING(REPLACE ";" "\\;" _PYTHONPATH "${_PYTHONPATH}")
- else()
- SET(_LD_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_BIN}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES}:${SUIT_LIB_DIR}:${SALOME_KERNEL_LIBDIR}:$ENV{LD_LIBRARY_PATH}")
- SET(_PYTHONPATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_ADDONS}:$ENV{PYTHONPATH}")
- endif()
+function(GENERATE_TESTS PATH testdir TESTS)
+ SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
foreach(eachFileName ${ARGN})
# Strip the ".py" suffix
SET(aTestName "${aSubprojectName}_${aTestName}")
# Full path to the python test file beeing executed
- SET(aTestFileName "${CMAKE_CURRENT_SOURCE_DIR}/Test/${eachFileName}")
+ SET(aTestFileName "${testdir}/${eachFileName}")
IF(EXISTS ${aTestFileName})
ADD_TEST(NAME ${aTestName}
COMMAND ${PYTHON_EXECUTABLE} ${aTestFileName})
- if (WIN32) # different path to libraries variable name
- SET_TESTS_PROPERTIES(${aTestName} PROPERTIES
- ENVIRONMENT "PATH=${_JUSTPATH};PYTHONPATH=${_PYTHONPATH};SHAPER_UNIT_TEST_IN_PROGRESS=1"
+ SET_TESTS_PROPERTIES(${aTestName} PROPERTIES
+ ENVIRONMENT "${tests_env};SHAPER_UNIT_TEST_IN_PROGRESS=1"
LABELS "${aSubprojectName}")
- else()
- SET_TESTS_PROPERTIES(${aTestName} PROPERTIES
- ENVIRONMENT "LD_LIBRARY_PATH=${_LD_LIBRARY_PATH};PYTHONPATH=${_PYTHONPATH};SHAPER_UNIT_TEST_IN_PROGRESS=1"
- LABELS "${aSubprojectName}")
- endif()
# Debug output...
#MESSAGE(STATUS "Test added: ${aTestName} file: ${aTestFileName}")
ELSE(EXISTS ${aTestFileName})
MESSAGE(WARNING "Can not find the test file: ${aTestFileName}")
ENDIF(EXISTS ${aTestFileName})
endforeach(eachFileName ${ARGN})
-ENDMACRO(ADD_UNIT_TESTS)
+endfunction(GENERATE_TESTS)
-MACRO(ADD_UNIT_TESTS_API)
- if (WIN32) # different separators and path to libraries variable name
- SET(_JUSTPATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_BIN};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES};${SUIT_LIB_DIR};${SALOME_KERNEL_LIBDIR};$ENV{PATH}")
- STRING(REPLACE "\\" "/" _JUSTPATH "${_JUSTPATH}")
- STRING(REPLACE ";" "\\;" _JUSTPATH "${_JUSTPATH}")
- SET(_PYTHONPATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_ADDONS};$ENV{PYTHONPATH}")
- STRING(REPLACE "\\" "/" _PYTHONPATH "${_PYTHONPATH}")
- STRING(REPLACE ";" "\\;" _PYTHONPATH "${_PYTHONPATH}")
- else()
- SET(_LD_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_BIN}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES}:${SUIT_LIB_DIR}:${SALOME_KERNEL_LIBDIR}:$ENV{LD_LIBRARY_PATH}")
- SET(_PYTHONPATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_ADDONS}:$ENV{PYTHONPATH}")
- endif()
-
- foreach(eachFileName ${ARGN})
- # Strip the ".py" suffix
- GET_FILENAME_COMPONENT(aTestName ${eachFileName} NAME_WE)
-
- # Add "SubprojectName_" prefix
- GET_FILENAME_COMPONENT(aSubprojectName ${CMAKE_CURRENT_SOURCE_DIR} NAME)
- SET(aTestName "${aSubprojectName}_${aTestName}")
+function(ADD_UNIT_TESTS)
+ GENERATE_TESTS(PATH "${CMAKE_CURRENT_SOURCE_DIR}/Test" TESTS ${ARGN})
+endfunction(ADD_UNIT_TESTS)
- # Full path to the python test file beeing executed
- SET(aTestFileName "${CMAKE_CURRENT_SOURCE_DIR}/${eachFileName}")
- IF(EXISTS ${aTestFileName})
- ADD_TEST(NAME ${aTestName}
- COMMAND ${PYTHON_EXECUTABLE} ${aTestFileName})
- if (WIN32) # different path to libraries variable name
- SET_TESTS_PROPERTIES(${aTestName} PROPERTIES
- ENVIRONMENT "PATH=${_JUSTPATH};PYTHONPATH=${_PYTHONPATH};SHAPER_UNIT_TEST_IN_PROGRESS=1"
- LABELS "${aSubprojectName}")
- else()
- SET_TESTS_PROPERTIES(${aTestName} PROPERTIES
- ENVIRONMENT "LD_LIBRARY_PATH=${_LD_LIBRARY_PATH};PYTHONPATH=${_PYTHONPATH};SHAPER_UNIT_TEST_IN_PROGRESS=1"
- LABELS "${aSubprojectName}")
- endif()
- # Debug output...
- #MESSAGE(STATUS "Test added: ${aTestName} file: ${aTestFileName}")
- ELSE(EXISTS ${aTestFileName})
- MESSAGE(WARNING "Can not find the test file: ${aTestFileName}")
- ENDIF(EXISTS ${aTestFileName})
- endforeach(eachFileName ${ARGN})
-ENDMACRO(ADD_UNIT_TESTS_API)
+function(ADD_UNIT_TESTS_API)
+ GENERATE_TESTS(PATH "${CMAKE_CURRENT_SOURCE_DIR}" TESTS ${ARGN})
+endfunction(ADD_UNIT_TESTS_API)
function(ADD_RESTRICTED_TESTS)
SET(RESTRICTED_ROOT_DIR $ENV{RESTRICTED_ROOT_DIR} CACHE PATH "Path to the restricted repository")
- if (NOT EXISTS ${RESTRICTED_ROOT_DIR})
- message(WARNING "RESTRICTED_ROOT_DIR is not specified to run restricted tests")
- return()
- endif()
-
- if (WIN32) # different separators and path to libraries variable name
- SET(_JUSTPATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_BIN};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES};${SUIT_LIB_DIR};${SALOME_KERNEL_LIBDIR};$ENV{PATH}")
- STRING(REPLACE "\\" "/" _JUSTPATH "${_JUSTPATH}")
- STRING(REPLACE ";" "\\;" _JUSTPATH "${_JUSTPATH}")
- SET(_PYTHONPATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES};${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_ADDONS};$ENV{PYTHONPATH}")
- STRING(REPLACE "\\" "/" _PYTHONPATH "${_PYTHONPATH}")
- STRING(REPLACE ";" "\\;" _PYTHONPATH "${_PYTHONPATH}")
+ if (EXISTS ${RESTRICTED_ROOT_DIR})
+ GENERATE_TESTS(PATH "${RESTRICTED_ROOT_DIR}/SHAPER/bugs" TESTS ${ARGN})
else()
- SET(_LD_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_BIN}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES}:${SUIT_LIB_DIR}:${SALOME_KERNEL_LIBDIR}:$ENV{LD_LIBRARY_PATH}")
- SET(_PYTHONPATH "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES}:${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_ADDONS}:$ENV{PYTHONPATH}")
+ message(WARNING "RESTRICTED_ROOT_DIR is not specified to run restricted tests")
endif()
-
- foreach(eachFileName ${ARGN})
- # Strip the ".py" suffix
- GET_FILENAME_COMPONENT(aTestName ${eachFileName} NAME_WE)
-
- # Add "SubprojectName_" prefix
- GET_FILENAME_COMPONENT(aSubprojectName ${CMAKE_CURRENT_SOURCE_DIR} NAME)
- SET(aTestName "${aSubprojectName}_${aTestName}")
-
- # Full path to the python test file beeing executed
- SET(aTestFileName "${RESTRICTED_ROOT_DIR}/SHAPER/bugs/${eachFileName}")
- IF(EXISTS ${aTestFileName})
- ADD_TEST(NAME ${aTestName}
- COMMAND ${PYTHON_EXECUTABLE} ${aTestFileName})
- if (WIN32) # different path to libraries variable name
- SET_TESTS_PROPERTIES(${aTestName} PROPERTIES
- ENVIRONMENT "PATH=${_JUSTPATH};PYTHONPATH=${_PYTHONPATH};SHAPER_UNIT_TEST_IN_PROGRESS=1"
- LABELS "${aSubprojectName}")
- else()
- SET_TESTS_PROPERTIES(${aTestName} PROPERTIES
- ENVIRONMENT "LD_LIBRARY_PATH=${_LD_LIBRARY_PATH};PYTHONPATH=${_PYTHONPATH};SHAPER_UNIT_TEST_IN_PROGRESS=1"
- LABELS "${aSubprojectName}")
- endif()
- # Debug output...
- #MESSAGE(STATUS "Test added: ${aTestName} file: ${aTestFileName}")
- ELSE(EXISTS ${aTestFileName})
- MESSAGE(WARNING "Can not find the test file: ${aTestFileName}")
- ENDIF(EXISTS ${aTestFileName})
- endforeach(eachFileName ${ARGN})
endfunction(ADD_RESTRICTED_TESTS)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.10)
PROJECT (SHAPER)
+SET(${PROJECT_NAME}_MAJOR_VERSION 9)
+SET(${PROJECT_NAME}_MINOR_VERSION 6)
+SET(${PROJECT_NAME}_PATCH_VERSION 0)
+SET(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_VERSION})
+
# Ensure a proper linker behavior:
CMAKE_POLICY(SET CMP0003 NEW)
IF(WIN32)
CMAKE_POLICY(SET CMP0020 OLD) # disable automatic linking to qtmain.lib
ENDIF(WIN32)
-SET (SHAPER_Version 9.6.0)
-
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeCommon" ${CMAKE_MODULE_PATH})
IF (NOT CADBUILDER_BUILD_DOC)
OPTION(SHAPER_BUILD_DOC "Generate SHAPER documentation" ON)
ENDIF(NOT CADBUILDER_BUILD_DOC)
-INCLUDE(SalomeMacros)
-
INCLUDE(FindEclipse)
INCLUDE(Common)
-INCLUDE(FindSalomeQt5)
INCLUDE(FindSalome)
INCLUDE(FindSUIT)
INCLUDE(FindTInspector)
IF(EXISTS ${CONFIGURATION_ROOT_DIR})
LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
INCLUDE(SalomeMacros)
+ INCLUDE(FindSalomeQt5)
ELSE()
MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
ENDIF()
FIND_PACKAGE(SalomeOpenCASCADE REQUIRED)
ELSE(${HAVE_SALOME})
+ INCLUDE(SalomeMacros)
+ INCLUDE(FindSalomeQt5)
INCLUDE(FindPython)
INCLUDE(FindSalomeOpenCASCADE)
ENDIF(${HAVE_SALOME})
IF(WIN32)
FILE(TO_CMAKE_PATH $ENV{LIBXML2_ROOT_DIR}/lib/libxml2.lib LIBXML2_LIBRARIES)
FILE(TO_CMAKE_PATH $ENV{LIBXML2_ROOT_DIR}/include LIBXML2_INCLUDE_DIR)
- ELSE()
- IF(NOT "$ENV{LIBXML2_ROOT_DIR}" STREQUAL "/usr")
- FILE(TO_CMAKE_PATH $ENV{LIBXML2_ROOT_DIR}/lib/libxml2.so LIBXML2_LIBRARIES)
- FILE(TO_CMAKE_PATH $ENV{LIBXML2_ROOT_DIR}/include/libxml2 LIBXML2_INCLUDE_DIR)
- ENDIF()
+ ELSEIF(NOT "$ENV{LIBXML2_ROOT_DIR}" STREQUAL "/usr")
+ FILE(TO_CMAKE_PATH $ENV{LIBXML2_ROOT_DIR}/lib/libxml2.so LIBXML2_LIBRARIES)
+ FILE(TO_CMAKE_PATH $ENV{LIBXML2_ROOT_DIR}/include/libxml2 LIBXML2_INCLUDE_DIR)
ENDIF()
ENDIF()
# It could be called only once
SET(SHAPER_INSTALL_TUI_DOC doc CACHE INTERNAL "" FORCE)
ENDIF(${HAVE_SALOME})
+# Test environment
+# ===================
+
+IF(WIN32)
+ SALOME_ACCUMULATE_ENVIRONMENT(PATH NOCHECK "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_BIN}")
+ SALOME_ACCUMULATE_ENVIRONMENT(PATH NOCHECK "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG}")
+ SALOME_ACCUMULATE_ENVIRONMENT(PATH NOCHECK "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES}")
+ SALOME_ACCUMULATE_ENVIRONMENT(PATH NOCHECK "${SUIT_LIB_DIR}")
+ SALOME_ACCUMULATE_ENVIRONMENT(PATH NOCHECK "${SALOME_KERNEL_LIBDIR}")
+ELSE(WIN32)
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_BIN}")
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG}")
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES}")
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK "${SUIT_LIB_DIR}")
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK "${SALOME_KERNEL_LIBDIR}")
+ENDIF(WIN32)
+
+SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_SWIG}")
+SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_PLUGIN_FILES}")
+SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK "${CMAKE_INSTALL_PREFIX}/${SHAPER_INSTALL_ADDONS}")
+
# Sketcher: Change radius of circular edges while dragging a point on the edge
SET(SKETCHER_CHANGE_RADIUS_WHEN_MOVE TRUE)
SET(MAKE_TRANSLATION YES)
+ADD_DEFINITIONS( -DMAKE_TRANSLATION )
- ADD_DEFINITIONS( -DMAKE_TRANSLATION )
ADD_SUBDIRECTORY (src/Config)
ADD_SUBDIRECTORY (src/Locale)
ADD_SUBDIRECTORY (src/Events)