From: sbh Date: Thu, 25 Dec 2014 09:08:08 +0000 (+0300) Subject: Env tweaks for Eclipse IDE: uninstall & salome environment X-Git-Tag: V_0.7.0_rc1~43^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=81d3ff913797ce5224dadcc83db97a060d42c7c1;p=modules%2Fshaper.git Env tweaks for Eclipse IDE: uninstall & salome environment --- diff --git a/CMakeCommon/cmake_uninstall.cmake.in b/CMakeCommon/cmake_uninstall.cmake.in new file mode 100644 index 000000000..2c34c8199 --- /dev/null +++ b/CMakeCommon/cmake_uninstall.cmake.in @@ -0,0 +1,21 @@ +if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") +endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + +file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) +string(REGEX REPLACE "\n" ";" files "${files}") +foreach(file ${files}) + message(STATUS "Uninstalling $ENV{DESTDIR}${file}") + if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + exec_program( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + if(NOT "${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") + endif(NOT "${rm_retval}" STREQUAL 0) + else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + message(STATUS "File $ENV{DESTDIR}${file} does not exist.") + endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") +endforeach(file) \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index ede88ffa0..468e790f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,3 +68,12 @@ IF(${HAVE_SALOME}) ENDIF(${HAVE_SALOME}) ENABLE_TESTING() + +# Add the uninstall target for eclipse IDE +if (CMAKE_GENERATOR MATCHES "NMake Makefiles") +configure_file("${CMAKE_SOURCE_DIR}/CMakeCommon/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) +add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) +endif (CMAKE_GENERATOR MATCHES "NMake Makefiles") diff --git a/build_Salome_eclipse.bat b/build_Salome_eclipse.bat new file mode 100644 index 000000000..10a068c60 --- /dev/null +++ b/build_Salome_eclipse.bat @@ -0,0 +1,30 @@ +@ECHO OFF + +REM Find absolute path to ROOT_DIR +@SET PARENT_DIR=%~dp0.. +@SET ROOT_DIR= +pushd %PARENT_DIR% +@SET ROOT_DIR=%CD% +popd + +@SET SRC_DIR=%ROOT_DIR%\sources +@SET OCC_LIB_PREFIX=d +@SET NewGEOM_ROOT_DIR=%ROOT_DIR%\install +@SET SalomeAppConfig=%ROOT_DIR%\install\share\salome\resources\newgeom;%GUI_ROOT_DIR%\share\salome\resources\gui + +call %SRC_DIR%\env_Salome.bat d +mkdir %ROOT_DIR%\build-eclipse +cd %ROOT_DIR%\build-eclipse + +@SET CMAKE_ARGS=-G ^"Eclipse CDT4 - NMake Makefiles^" +@SET CMAKE_ARGS=%CMAKE_ARGS% -D_ECLIPSE_VERSION=4.3 +@SET CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_BUILD_TYPE=Debug +@SET CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=ON +@SET CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%\install +@SET CMAKE_ARGS=%CMAKE_ARGS% -DPYTHON_EXECUTABLE=%PYTHONHOME%\python_d.exe +@SET CMAKE_ARGS=%CMAKE_ARGS% %SRC_DIR% + +cmake %CMAKE_ARGS% + +@REM Should be defined at ..\local_env.bat +start %ECLIPSE_EXE%