From e204b295b7755385918439237d8bb22674242d93 Mon Sep 17 00:00:00 2001 From: mzn Date: Mon, 20 Aug 2018 14:42:24 +0300 Subject: [PATCH] Take care about CMake version < 3.8.0. --- src/BuildAPI/CMakeLists.txt | 6 +++++- src/CollectionAPI/CMakeLists.txt | 6 +++++- src/Config/CMakeLists.txt | 6 +++++- src/ConnectorAPI/CMakeLists.txt | 6 +++++- src/ConstructionAPI/CMakeLists.txt | 6 +++++- src/Events/CMakeLists.txt | 6 +++++- src/ExchangeAPI/CMakeLists.txt | 6 +++++- src/FeaturesAPI/CMakeLists.txt | 6 +++++- src/GDMLAPI/CMakeLists.txt | 6 +++++- src/GeomAPI/CMakeLists.txt | 6 +++++- src/GeomAlgoAPI/CMakeLists.txt | 6 +++++- src/GeomDataAPI/CMakeLists.txt | 6 +++++- src/ModelAPI/CMakeLists.txt | 6 +++++- src/ModelGeomAlgo/CMakeLists.txt | 6 +++++- src/ModelHighAPI/CMakeLists.txt | 6 +++++- src/ParametersAPI/CMakeLists.txt | 6 +++++- src/PartSetAPI/CMakeLists.txt | 6 +++++- src/PrimitivesAPI/CMakeLists.txt | 6 +++++- src/SketchAPI/CMakeLists.txt | 6 +++++- 19 files changed, 95 insertions(+), 19 deletions(-) diff --git a/src/BuildAPI/CMakeLists.txt b/src/BuildAPI/CMakeLists.txt index a88ab8eb6..4f1c32c70 100644 --- a/src/BuildAPI/CMakeLists.txt +++ b/src/BuildAPI/CMakeLists.txt @@ -96,7 +96,11 @@ SET(SWIG_MODULE_BuildAPI_EXTRA_DEPS ${SWIG_MODULE_BuildAPI_EXTRA_DEPS} ${PROJECT_HEADERS} ) -SWIG_ADD_LIBRARY(BuildAPI LANGUAGE python SOURCES BuildAPI.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(BuildAPI LANGUAGE python SOURCES BuildAPI.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(BuildAPI python BuildAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(BuildAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) diff --git a/src/CollectionAPI/CMakeLists.txt b/src/CollectionAPI/CMakeLists.txt index 88990237f..62543034b 100644 --- a/src/CollectionAPI/CMakeLists.txt +++ b/src/CollectionAPI/CMakeLists.txt @@ -74,7 +74,11 @@ SET(SWIG_MODULE_CollectionAPI_EXTRA_DEPS ${SWIG_MODULE_CollectionAPI_EXTRA_DEPS} ${PROJECT_HEADERS} ) -SWIG_ADD_LIBRARY(CollectionAPI LANGUAGE python SOURCES CollectionAPI.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(CollectionAPI LANGUAGE python SOURCES CollectionAPI.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(CollectionAPI python CollectionAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(CollectionAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) diff --git a/src/Config/CMakeLists.txt b/src/Config/CMakeLists.txt index 068609e63..05bafb324 100644 --- a/src/Config/CMakeLists.txt +++ b/src/Config/CMakeLists.txt @@ -76,7 +76,11 @@ SET(SWIG_LINK_LIBRARIES Config ${PYTHON_LIBRARIES} ) -SWIG_ADD_LIBRARY(ConfigAPI LANGUAGE python SOURCES ConfigAPI.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(ConfigAPI LANGUAGE python SOURCES ConfigAPI.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(ConfigAPI python ConfigAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(ConfigAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) SET_TARGET_PROPERTIES(_ConfigAPI PROPERTIES DEBUG_OUTPUT_NAME _ConfigAPI_d) diff --git a/src/ConnectorAPI/CMakeLists.txt b/src/ConnectorAPI/CMakeLists.txt index 291700cef..19d6e2bca 100644 --- a/src/ConnectorAPI/CMakeLists.txt +++ b/src/ConnectorAPI/CMakeLists.txt @@ -75,7 +75,11 @@ SET(SWIG_MODULE_ConnectorAPI_EXTRA_DEPS ${SWIG_MODULE_ConnectorAPI_EXTRA_DEPS} ${PROJECT_HEADERS} ) -SWIG_ADD_LIBRARY(ConnectorAPI LANGUAGE python SOURCES ConnectorAPI.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(ConnectorAPI LANGUAGE python SOURCES ConnectorAPI.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(ConnectorAPI python ConnectorAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(ConnectorAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) diff --git a/src/ConstructionAPI/CMakeLists.txt b/src/ConstructionAPI/CMakeLists.txt index 985455f22..88fd35809 100644 --- a/src/ConstructionAPI/CMakeLists.txt +++ b/src/ConstructionAPI/CMakeLists.txt @@ -79,7 +79,11 @@ SET(SWIG_MODULE_ConstructionAPI_EXTRA_DEPS ${SWIG_MODULE_ConstructionAPI_EXTRA_D ${PROJECT_HEADERS} ) -SWIG_ADD_LIBRARY(ConstructionAPI LANGUAGE python SOURCES ConstructionAPI.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(ConstructionAPI LANGUAGE python SOURCES ConstructionAPI.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(ConstructionAPI python ConstructionAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(ConstructionAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) diff --git a/src/Events/CMakeLists.txt b/src/Events/CMakeLists.txt index f20acfdea..8e74f3ad6 100644 --- a/src/Events/CMakeLists.txt +++ b/src/Events/CMakeLists.txt @@ -64,7 +64,11 @@ SET(SWIG_LINK_LIBRARIES ${PYTHON_LIBRARIES} ) -SWIG_ADD_LIBRARY(EventsAPI LANGUAGE python SOURCES Events.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(EventsAPI LANGUAGE python SOURCES Events.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(EventsAPI python EventsAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(EventsAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) diff --git a/src/ExchangeAPI/CMakeLists.txt b/src/ExchangeAPI/CMakeLists.txt index 08c4e8cb1..e4ec3f065 100644 --- a/src/ExchangeAPI/CMakeLists.txt +++ b/src/ExchangeAPI/CMakeLists.txt @@ -76,7 +76,11 @@ SET(SWIG_MODULE_ExchangeAPI_EXTRA_DEPS ${SWIG_MODULE_ExchangeAPI_EXTRA_DEPS} ${PROJECT_HEADERS} ) -SWIG_ADD_LIBRARY(ExchangeAPI LANGUAGE python SOURCES ExchangeAPI.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(ExchangeAPI LANGUAGE python SOURCES ExchangeAPI.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(ExchangeAPI python ExchangeAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(ExchangeAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) diff --git a/src/FeaturesAPI/CMakeLists.txt b/src/FeaturesAPI/CMakeLists.txt index e44030e64..b4ac9a4bb 100644 --- a/src/FeaturesAPI/CMakeLists.txt +++ b/src/FeaturesAPI/CMakeLists.txt @@ -118,7 +118,11 @@ SET(SWIG_MODULE_FeaturesAPI_EXTRA_DEPS ${SWIG_MODULE_FeaturesAPI_EXTRA_DEPS} ${PROJECT_HEADERS} ) -SWIG_ADD_LIBRARY(FeaturesAPI LANGUAGE python SOURCES FeaturesAPI.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(FeaturesAPI LANGUAGE python SOURCES FeaturesAPI.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(FeaturesAPI python FeaturesAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(FeaturesAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) diff --git a/src/GDMLAPI/CMakeLists.txt b/src/GDMLAPI/CMakeLists.txt index eea7900cb..701d3570d 100644 --- a/src/GDMLAPI/CMakeLists.txt +++ b/src/GDMLAPI/CMakeLists.txt @@ -74,7 +74,11 @@ SET(SWIG_MODULE_GDMLAPI_EXTRA_DEPS ${SWIG_MODULE_GDMLAPI_EXTRA_DEPS} ${PROJECT_HEADERS} ) -SWIG_ADD_LIBRARY(GDMLAPI LANGUAGE python SOURCES GDMLAPI.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(GDMLAPI LANGUAGE python SOURCES GDMLAPI.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(GDMLAPI python GDMLAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(GDMLAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) diff --git a/src/GeomAPI/CMakeLists.txt b/src/GeomAPI/CMakeLists.txt index f74506b6c..b2a2953b5 100644 --- a/src/GeomAPI/CMakeLists.txt +++ b/src/GeomAPI/CMakeLists.txt @@ -132,7 +132,11 @@ SET(SWIG_LINK_LIBRARIES ${PYTHON_LIBRARIES} ) -SWIG_ADD_LIBRARY(GeomAPI LANGUAGE python SOURCES GeomAPI.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(GeomAPI LANGUAGE python SOURCES GeomAPI.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(GeomAPI python GeomAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(GeomAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) diff --git a/src/GeomAlgoAPI/CMakeLists.txt b/src/GeomAlgoAPI/CMakeLists.txt index 97eb347d2..956eb9cd2 100644 --- a/src/GeomAlgoAPI/CMakeLists.txt +++ b/src/GeomAlgoAPI/CMakeLists.txt @@ -189,7 +189,11 @@ SET(SWIG_LINK_LIBRARIES ${PYTHON_LIBRARIES} ) -SWIG_ADD_LIBRARY(GeomAlgoAPI LANGUAGE python SOURCES GeomAlgoAPI.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(GeomAlgoAPI LANGUAGE python SOURCES GeomAlgoAPI.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(GeomAlgoAPI python GeomAlgoAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(GeomAlgoAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) diff --git a/src/GeomDataAPI/CMakeLists.txt b/src/GeomDataAPI/CMakeLists.txt index d975ae0b0..f22839d32 100644 --- a/src/GeomDataAPI/CMakeLists.txt +++ b/src/GeomDataAPI/CMakeLists.txt @@ -64,7 +64,11 @@ SET(SWIG_LINK_LIBRARIES ${PYTHON_LIBRARIES} ) -SWIG_ADD_LIBRARY(GeomDataAPI LANGUAGE python SOURCES GeomDataAPI.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(GeomDataAPI LANGUAGE python SOURCES GeomDataAPI.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(GeomDataAPI python GeomDataAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(GeomDataAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) diff --git a/src/ModelAPI/CMakeLists.txt b/src/ModelAPI/CMakeLists.txt index f10b3bf67..563611b7a 100644 --- a/src/ModelAPI/CMakeLists.txt +++ b/src/ModelAPI/CMakeLists.txt @@ -146,7 +146,11 @@ SET(SWIG_LINK_LIBRARIES ${PYTHON_LIBRARIES} ) -SWIG_ADD_LIBRARY(ModelAPI LANGUAGE python SOURCES ModelAPI.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(ModelAPI LANGUAGE python SOURCES ModelAPI.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(ModelAPI python ModelAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(ModelAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) diff --git a/src/ModelGeomAlgo/CMakeLists.txt b/src/ModelGeomAlgo/CMakeLists.txt index bc994a02e..58e55ff58 100755 --- a/src/ModelGeomAlgo/CMakeLists.txt +++ b/src/ModelGeomAlgo/CMakeLists.txt @@ -74,7 +74,11 @@ SET(SWIG_LINK_LIBRARIES ${PYTHON_LIBRARIES} ) -SWIG_ADD_LIBRARY(ModelGeomAlgo LANGUAGE python SOURCES ModelGeomAlgo.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(ModelGeomAlgo LANGUAGE python SOURCES ModelGeomAlgo.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(ModelGeomAlgo python ModelGeomAlgo.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(ModelGeomAlgo ${SWIG_LINK_LIBRARIES}) IF(WIN32) diff --git a/src/ModelHighAPI/CMakeLists.txt b/src/ModelHighAPI/CMakeLists.txt index 0bc3eb013..db374645c 100644 --- a/src/ModelHighAPI/CMakeLists.txt +++ b/src/ModelHighAPI/CMakeLists.txt @@ -93,7 +93,11 @@ set(SWIG_MODULE_ModelHighAPI_EXTRA_DEPS ${PROJECT_HEADERS} ) -SWIG_ADD_LIBRARY(ModelHighAPI LANGUAGE python SOURCES ModelHighAPI.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(ModelHighAPI LANGUAGE python SOURCES ModelHighAPI.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(ModelHighAPI python ModelHighAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(ModelHighAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) diff --git a/src/ParametersAPI/CMakeLists.txt b/src/ParametersAPI/CMakeLists.txt index 926344bd5..08e513cc5 100644 --- a/src/ParametersAPI/CMakeLists.txt +++ b/src/ParametersAPI/CMakeLists.txt @@ -75,7 +75,11 @@ SET(SWIG_MODULE_ParametersAPI_EXTRA_DEPS ${SWIG_MODULE_ParametersAPI_EXTRA_DEPS} ${PROJECT_HEADERS} ) -SWIG_ADD_LIBRARY(ParametersAPI LANGUAGE python SOURCES ParametersAPI.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(ParametersAPI LANGUAGE python SOURCES ParametersAPI.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(ParametersAPI python ParametersAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(ParametersAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) diff --git a/src/PartSetAPI/CMakeLists.txt b/src/PartSetAPI/CMakeLists.txt index 6747370c7..4b2e45c7c 100644 --- a/src/PartSetAPI/CMakeLists.txt +++ b/src/PartSetAPI/CMakeLists.txt @@ -76,7 +76,11 @@ SET(SWIG_MODULE_PartSetAPI_EXTRA_DEPS ${SWIG_MODULE_PartSetAPI_EXTRA_DEPS} ${PROJECT_HEADERS} ) -SWIG_ADD_LIBRARY(PartSetAPI LANGUAGE python SOURCES PartSetAPI.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(PartSetAPI LANGUAGE python SOURCES PartSetAPI.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(PartSetAPI python PartSetAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(PartSetAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) diff --git a/src/PrimitivesAPI/CMakeLists.txt b/src/PrimitivesAPI/CMakeLists.txt index b49f75384..8cd9c647e 100644 --- a/src/PrimitivesAPI/CMakeLists.txt +++ b/src/PrimitivesAPI/CMakeLists.txt @@ -80,7 +80,11 @@ SET(SWIG_MODULE_PrimitivesAPI_EXTRA_DEPS ${SWIG_MODULE_PrimitivesAPI_EXTRA_DEPS} ${PROJECT_HEADERS} ) -SWIG_ADD_LIBRARY(PrimitivesAPI LANGUAGE python SOURCES PrimitivesAPI.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(PrimitivesAPI LANGUAGE python SOURCES PrimitivesAPI.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(PrimitivesAPI python PrimitivesAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(PrimitivesAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) diff --git a/src/SketchAPI/CMakeLists.txt b/src/SketchAPI/CMakeLists.txt index d7cc664ab..c61a089ee 100644 --- a/src/SketchAPI/CMakeLists.txt +++ b/src/SketchAPI/CMakeLists.txt @@ -105,7 +105,11 @@ SET(SWIG_MODULE_SketchAPI_EXTRA_DEPS ${SWIG_MODULE_SketchAPI_EXTRA_DEPS} ${PROJECT_HEADERS} ) -SWIG_ADD_LIBRARY(SketchAPI LANGUAGE python SOURCES SketchAPI.i ${PROJECT_HEADERS}) +IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0") + SWIG_ADD_LIBRARY(SketchAPI LANGUAGE python SOURCES SketchAPI.i ${PROJECT_HEADERS}) +ELSE() + SWIG_ADD_MODULE(SketchAPI python SketchAPI.i ${PROJECT_HEADERS}) +ENDIF() SWIG_LINK_LIBRARIES(SketchAPI ${SWIG_LINK_LIBRARIES}) IF(WIN32) -- 2.39.2