]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Improve CMakeLists.txt files for ModelHighAPI & ConstructionAPI. Improve Construction...
authorspo <sergey.pokhodenko@opencascade.com>
Thu, 26 May 2016 13:18:18 +0000 (16:18 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Thu, 26 May 2016 13:18:22 +0000 (16:18 +0300)
src/ConstructionAPI/CMakeLists.txt
src/ConstructionAPI/ConstructionAPI.i
src/ModelHighAPI/CMakeLists.txt

index ef8fcb5ea807f4469fad30a46947dd491015d8ca..cf04d02a57831642b101939b5e929906f39f0e94 100644 (file)
@@ -21,6 +21,7 @@ INCLUDE_DIRECTORIES(
     ${PROJECT_SOURCE_DIR}/src/ModelHighAPI
     )
 
+#TODO(spo): is ${CAS_DEFINITIONS} necessary?
 ADD_DEFINITIONS(-DCONSTRUCTIONAPI_EXPORTS ${CAS_DEFINITIONS})
 ADD_LIBRARY(ConstructionAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
 TARGET_LINK_LIBRARIES(ConstructionAPI ${PROJECT_LIBRARIES})
@@ -32,6 +33,7 @@ INCLUDE(PythonAPI)
 SET_SOURCE_FILES_PROPERTIES(ConstructionAPI.i PROPERTIES CPLUSPLUS ON)
 SET_SOURCE_FILES_PROPERTIES(ConstructionAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
 
+#TODO(spo): is ModelAPI necessary or it could be received by INTERFACE_ ?
 SET(SWIG_LINK_LIBRARIES
     ConstructionAPI
     ModelHighAPI
index ed3c2172a428d599943846a1f92d20598d706928..8ac763a3ced43676552637c7291c1c286423891d 100644 (file)
@@ -1,5 +1,7 @@
 /* ConstructionAPI.i */
+
 %module ConstructionAPI
+
 %{
   #include "ConstructionAPI_swig.h"
 %}
index c93441264ffb88aa6918c36b296ac247aa177923..4402e74d9601bda70c1dd2c461ee4409a2163608 100644 (file)
@@ -1,9 +1,6 @@
 ## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 
-FIND_PACKAGE(SWIG REQUIRED)
-INCLUDE(${SWIG_USE_FILE})
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
-INCLUDE(UnitTest)
+INCLUDE(Common)
 
 SET(PROJECT_HEADERS
     ModelHighAPI.h
@@ -20,14 +17,28 @@ SET(PROJECT_LIBRARIES
     Config
     Events
     )
-    
-SET(CMAKE_SWIG_FLAGS -threads -Wall)
-ADD_DEFINITIONS(-DModelHighAPI_EXPORTS)
 
+ADD_DEFINITIONS(-DMODELHIGHAPI_EXPORTS)
 ADD_LIBRARY(ModelHighAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
+#TODO(spo): is it necessary?
 SET_TARGET_PROPERTIES(ModelHighAPI PROPERTIES LINKER_LANGUAGE CXX)
 TARGET_LINK_LIBRARIES(ModelHighAPI ${PROJECT_LIBRARIES})
 
+# SWIG wrapper
+
+INCLUDE(PythonAPI)
+
+#TODO(spo): is it necessary?
+SET(CMAKE_SWIG_FLAGS -threads -Wall)
+
+SET_SOURCE_FILES_PROPERTIES(ModelHighAPI.i PROPERTIES CPLUSPLUS ON)
+SET_SOURCE_FILES_PROPERTIES(ModelHighAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+
+SET(SWIG_LINK_LIBRARIES
+    ModelHighAPI
+    ${PYTHON_LIBRARIES}
+    )
+
 INCLUDE_DIRECTORIES(
     ${PROJECT_SOURCE_DIR}/src/Events
     ${PROJECT_SOURCE_DIR}/src/ModelAPI
@@ -35,18 +46,10 @@ INCLUDE_DIRECTORIES(
 #                    ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
 )
 
-SET_SOURCE_FILES_PROPERTIES(ModelHighAPI.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(ModelHighAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-
 SET(SWIG_SCRIPTS
     ${CMAKE_CURRENT_BINARY_DIR}/ModelHighAPI.py
     )
 
-SET(SWIG_LINK_LIBRARIES
-    ModelHighAPI
-    ${PYTHON_LIBRARIES}
-    )
-
 SWIG_ADD_MODULE(ModelHighAPI python ModelHighAPI.i ${PROJECT_HEADERS})
 SWIG_LINK_LIBRARIES(ModelHighAPI ${SWIG_LINK_LIBRARIES})
 
@@ -58,6 +61,10 @@ INSTALL(TARGETS _ModelHighAPI DESTINATION ${SHAPER_INSTALL_SWIG})
 INSTALL(TARGETS ModelHighAPI DESTINATION ${SHAPER_INSTALL_BIN})
 INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})
 
+# Tests
+
+INCLUDE(UnitTest)
+
 ADD_UNIT_TESTS(
     TestDouble.py
     )