]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchSolver/CMakeLists.txt
Salome HOME
c66b7eac5f2b8e5023af2c6ba7389781a63b5362
[modules/shaper.git] / src / SketchSolver / CMakeLists.txt
1 # Copyright (C) 2014-2021  CEA/DEN, EDF R&D
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 # Avoid using SolveSpace
21 SET(NO_SolveSpace TRUE)
22
23 # Convert files in list to full name
24 FUNCTION(TO_FULL_PATH theFILES)
25   SET(locFiles "")
26   FOREACH(locFile ${${theFILES}})
27     SET(locFiles ${locFiles} ${CMAKE_CURRENT_SOURCE_DIR}/${locFile})
28   ENDFOREACH()
29   SET(${theFILES} ${locFiles} PARENT_SCOPE)
30 ENDFUNCTION(TO_FULL_PATH)
31
32
33 INCLUDE(Common)
34
35 SET(SKETCHSOLVER_HEADERS
36     SketchSolver_Error.h
37     SketchSolver_Group.h
38     SketchSolver_Manager.h
39     SketchSolver_Storage.h
40 )
41
42 SET(SKETCHSOLVER_CONSTRAINT_HEADERS
43     SketchSolver_Constraint.h
44     SketchSolver_ConstraintAngle.h
45     SketchSolver_ConstraintCoincidence.h
46     SketchSolver_ConstraintCollinear.h
47     SketchSolver_ConstraintDistance.h
48     SketchSolver_ConstraintEqual.h
49     SketchSolver_ConstraintLength.h
50     SketchSolver_ConstraintMiddle.h
51     SketchSolver_ConstraintMirror.h
52     SketchSolver_ConstraintFixed.h
53     SketchSolver_ConstraintPerpendicular.h
54     SketchSolver_ConstraintTangent.h
55     SketchSolver_ConstraintMulti.h
56     SketchSolver_ConstraintMultiRotation.h
57     SketchSolver_ConstraintMultiTranslation.h
58     SketchSolver_ConstraintMovement.h
59     SketchSolver_ConstraintOffset.h
60 )
61
62 SET(SKETCHSOLVER_SOURCES
63     SketchSolver_Group.cpp
64     SketchSolver_Manager.cpp
65     SketchSolver_Storage.cpp
66 )
67
68 SET(SKETCHSOLVER_CONSTRAINT_SOURCES
69     SketchSolver_Constraint.cpp
70     SketchSolver_ConstraintAngle.cpp
71     SketchSolver_ConstraintCoincidence.cpp
72     SketchSolver_ConstraintCollinear.cpp
73     SketchSolver_ConstraintDistance.cpp
74     SketchSolver_ConstraintEqual.cpp
75     SketchSolver_ConstraintLength.cpp
76     SketchSolver_ConstraintMiddle.cpp
77     SketchSolver_ConstraintMirror.cpp
78     SketchSolver_ConstraintFixed.cpp
79     SketchSolver_ConstraintPerpendicular.cpp
80     SketchSolver_ConstraintTangent.cpp
81     SketchSolver_ConstraintMulti.cpp
82     SketchSolver_ConstraintMultiRotation.cpp
83     SketchSolver_ConstraintMultiTranslation.cpp
84     SketchSolver_ConstraintMovement.cpp
85     SketchSolver_ConstraintOffset.cpp
86 )
87
88 SET(SKETCHSOLVER_LIBRARIES
89     Config
90     Events
91     ModelAPI
92     GeomAPI
93     GeomDataAPI
94 )
95
96 SET(SKETCHSOLVER_TEXT_RESOURCES
97     SketchSolver_msg_en.ts
98     SketchSolver_msg_fr.ts
99 )
100
101 INCLUDE_DIRECTORIES(
102     ${PROJECT_SOURCE_DIR}/src/Config
103     ${PROJECT_SOURCE_DIR}/src/SketchPlugin
104     ${PROJECT_SOURCE_DIR}/src/ModelAPI
105     ${PROJECT_SOURCE_DIR}/src/GeomAPI
106     ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
107     ${PROJECT_SOURCE_DIR}/src/Events
108 )
109
110 #SOURCE_GROUP ("Resource Files" FILES ${SKETCHSOLVER_TEXT_RESOURCES})
111 #
112 #ADD_DEFINITIONS(-DSKETCHSOLVER_EXPORTS)
113 #
114 #ADD_LIBRARY(SketchSolver SHARED ${SKETCHSOLVER_SOURCES} ${SKETCHSOLVER_CONSTRAINT_SOURCES} ${SKETCHSOLVER_HEADERS} ${SKETCHSOLVER_CONSTRAINT_HEADERS} ${SKETCHSOLVER_TEXT_RESOURCES}
115 #)
116 #
117 #TARGET_LINK_LIBRARIES(SketchSolver ${SKETCHSOLVER_LIBRARIES}
118 #)
119 #
120 #INSTALL(TARGETS SketchSolver DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES})
121 #INSTALL(FILES ${SKETCHSOLVER_TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
122
123 # Set full path to source files
124 TO_FULL_PATH(SKETCHSOLVER_SOURCES)
125 TO_FULL_PATH(SKETCHSOLVER_CONSTRAINT_SOURCES)
126 TO_FULL_PATH(SKETCHSOLVER_HEADERS)
127 TO_FULL_PATH(SKETCHSOLVER_CONSTRAINT_HEADERS)
128 TO_FULL_PATH(SKETCHSOLVER_TEXT_RESOURCES)
129
130
131 # Include specific solvers
132 IF(NO_SolveSpace)
133   SET(SSPath_FOUND FALSE)
134 ELSE()
135   FIND_FILE(SSPath "SolveSpaceSolver/CMakeLists.txt" PATHS "${CMAKE_CURRENT_SOURCE_DIR}")
136   STRING(COMPARE NOTEQUAL ${SSPath} "SSPath-NOTFOUND" SSPath_FOUND)
137 ENDIF()
138
139 IF(NO_PlaneGCS)
140   SET(GCSPath_FOUND FALSE)
141 ELSE()
142   FIND_FILE(GCSPath "PlaneGCSSolver/CMakeLists.txt" PATHS "${CMAKE_CURRENT_SOURCE_DIR}")
143   STRING(COMPARE NOTEQUAL ${GCSPath} "GCSPath-NOTFOUND" GCSPath_FOUND)
144 ENDIF()
145
146 IF(${SSPath_FOUND} OR ${GCSPath_FOUND})
147   IF(${SSPath_FOUND})
148     MESSAGE(STATUS "SolveSpaceSolver plugin found in ${SSPath}")
149     ADD_SUBDIRECTORY(SolveSpaceSolver)
150   ENDIF()
151   IF(${GCSPath_FOUND})
152     MESSAGE(STATUS "PlaneGCSSolver plugin found in ${GCSPath}")
153     ADD_SUBDIRECTORY(PlaneGCSSolver)
154   ENDIF()
155 ELSE()
156   MESSAGE(WARNING "No sketch solver plugin is found")
157 ENDIF()