rem --------------- Configuration --------------
rem --------------- Products path --------------
-if "%PRODUCTSDIR%" == "" (
- set PRODUCTSDIR=%ROOT_DIR%\PRODUCTS
+if "%PDIR%" == "" (
+ set PDIR=%ROOT_DIR%\products
)
rem --------------- cmake 2.8.7 --------------
if "%CMAKEDIR%" == "" (
- set CMAKEDIR=%PRODUCTSDIR%\cmake-2.8.12.1
+ set CMAKEDIR=%PDIR%\cmake-2.8.12.1
)
set PATH=%CMAKEDIR%\bin;%PATH%
@REM -------------------------
@REM CASCADE
-@SET CAS_ROOT_DIR=%PRODUCTSDIR%\OCCT-6.7.0
+@SET CAS_ROOT_DIR=%PDIR%\OCCT-6.7.0
@SET CASROOT=%CAS_ROOT_DIR%
@REM -------------------------
@REM -------------------------
@REM FREEIMAGE (Used by OCCT)
-@SET PATH=%PRODUCTSDIR%\freeimage-3.15.4\bin;%PATH%
+@SET PATH=%PDIR%\freeimage-3.15.4\bin;%PATH%
@REM -------------------------
@REM -------------------------
@REM FTGL (Used by OCCT)
-@SET PATH=%PRODUCTSDIR%\ftgl-2.1.3\bin;%PATH%
+@SET PATH=%PDIR%\ftgl-2.1.3\bin;%PATH%
@REM -------------------------
@REM -------------------------
@REM FREETYPE (Used by OCCT)
-@SET PATH=%PRODUCTSDIR%\freetype-2.4.11\bin;%PATH%
+@SET PATH=%PDIR%\freetype-2.4.11\bin;%PATH%
@REM -------------------------
@REM -------------------------
@REM GL2PS (Used by OCCT AND PARAVIEW)
-@SET PATH=%PRODUCTSDIR%\gl2ps-1.3.8\bin;%PATH%
+@SET PATH=%PDIR%\gl2ps-1.3.8\bin;%PATH%
@REM -------------------------
@REM -------------------------
@REM TBB (Used by OCCT)
-@SET PATH=%PRODUCTSDIR%\tbb\bin;%PATH%
+@SET PATH=%PDIR%\tbb\bin;%PATH%
@REM -------------------------
@REM -------------------------
@REM QT
if "%QTDIR%" == "" (
- @SET QTDIR=%PRODUCTSDIR%\Qt-5.2.0\5.2.0\msvc2010
+ @SET QTDIR=%PDIR%\Qt-5.2.0\5.2.0\msvc2010
)
@SET PATH=%QTDIR%\bin;%PATH%
@REM -------------------------
+@REM -------------------------
+@REM PYTHON
+@SET PYTHONHOME=%PDIR%\python-2.7.3
+@SET PYTHON_LIB_DIR=%PYTHONHOME%\libs
+@SET PYTHON_INC_DIR=%PYTHONHOME%\include
+@SET PATH=%PYTHON_LIB_DIR%;%PATH%
+@SET PATH=%PYTHONHOME%;%PATH%
+@SET PYTHONPATH=%PYTHONHOME%\Lib;%PYTHONPATH%
+@SET PYTHONPATH=%PYTHONHOME%\DLLs;%PYTHONPATH%
+@SET PYTHON_VERSION=2.7
+@REM -------------------------
+
+@REM -------------------------
+@REM LIBXML2
+@SET PATH=%PDIR%\libxml2-2.9.0\lib;%PATH%
+@REM -------------------------
+
+@REM -------------------------
+@REM SWIG
+@SET PATH=%PDIR%\swig-2.0.9\bin;%PATH%
+@REM -------------------------
+
rem -------- Visual Studio --------------------
rem Detect Visual Studio (either commercial or Express edition)
if "%VS100COMNTOOLS%" == "" (
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
INCLUDE(Common)
+FIND_PACKAGE(SWIG REQUIRED)
+INCLUDE(${SWIG_USE_FILE})
+INCLUDE(FindPython)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
SET(PROJECT_HEADERS
ModelAPI.hxx
ADD_LIBRARY(ModelAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
SET_TARGET_PROPERTIES(ModelAPI PROPERTIES LINKER_LANGUAGE CXX)
#TARGET_LINK_LIBRARIES(ModelAPI ${PROJECT_LIBRARIES})
+
+SET(CMAKE_SWIG_FLAGS "")
+
+SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES CPLUSPLUS ON)
+SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES SWIG_FLAGS "-includeall")
+SET_SOURCE_FILES_PROPERTIES(ModelAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+#SET_SOURCE_FILES_PROPERTIES(ModelAPIPYTHON_wrap.cxx PROPERTIES COMPILE_FLAGS "-DHAVE_CONFIG_H")
+
+SET(SWIG_SCRIPTS
+ ${CMAKE_CURRENT_BINARY_DIR}/ModelAPI.py
+)
+
+SET(SWIG_LINK_LIBRARIES
+ ModelAPI
+ ${PYTHON_LIBRARIES}
+)
+
+SWIG_ADD_MODULE(ModelAPI python ModelAPI.i ${PROJECT_HEADERS})
+SWIG_LINK_LIBRARIES(ModelAPI ${SWIG_LINK_LIBRARIES})
+
+IF(WIN32)
+ SET_TARGET_PROPERTIES(_ModelAPI PROPERTIES DEBUG_OUTPUT_NAME _ModelAPI_d)
+ENDIF(WIN32)
+
+INSTALL(TARGETS _ModelAPI DESTINATION swig)
+#INSTALL(TARGETS ${SWIG_SCRIPTS} DESTINATION swig)
+
+