]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchSolver/CMakeLists.txt
Salome HOME
Merge branch 'Dev_GroupsRevision'
[modules/shaper.git] / src / SketchSolver / CMakeLists.txt
1 ## Copyright (C) 2014-2017  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
18 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 ##
20
21 # Avoid using SolveSpace
22 SET(NO_SolveSpace TRUE)
23
24 # Convert files in list to full name
25 FUNCTION(TO_FULL_PATH theFILES)
26   SET(locFiles "")
27   FOREACH(locFile ${${theFILES}})
28     SET(locFiles ${locFiles} ${CMAKE_CURRENT_SOURCE_DIR}/${locFile})
29   ENDFOREACH()
30   SET(${theFILES} ${locFiles} PARENT_SCOPE)
31 ENDFUNCTION(TO_FULL_PATH)
32
33
34 INCLUDE(Common)
35
36 SET(SKETCHSOLVER_HEADERS
37     SketchSolver_Error.h
38     SketchSolver_Group.h
39     SketchSolver_Manager.h
40     SketchSolver_Storage.h
41 )
42
43 SET(SKETCHSOLVER_CONSTRAINT_HEADERS
44     SketchSolver_Constraint.h
45     SketchSolver_ConstraintAngle.h
46     SketchSolver_ConstraintCoincidence.h
47     SketchSolver_ConstraintCollinear.h
48     SketchSolver_ConstraintDistance.h
49     SketchSolver_ConstraintEqual.h
50     SketchSolver_ConstraintLength.h
51     SketchSolver_ConstraintMiddle.h
52     SketchSolver_ConstraintMirror.h
53     SketchSolver_ConstraintFixed.h
54     SketchSolver_ConstraintTangent.h
55     SketchSolver_ConstraintMulti.h
56     SketchSolver_ConstraintMultiRotation.h
57     SketchSolver_ConstraintMultiTranslation.h
58     SketchSolver_ConstraintMovement.h
59 )
60
61 SET(SKETCHSOLVER_SOURCES
62     SketchSolver_Group.cpp
63     SketchSolver_Manager.cpp
64     SketchSolver_Storage.cpp
65 )
66
67 SET(SKETCHSOLVER_CONSTRAINT_SOURCES
68     SketchSolver_Constraint.cpp
69     SketchSolver_ConstraintAngle.cpp
70     SketchSolver_ConstraintCoincidence.cpp
71     SketchSolver_ConstraintCollinear.cpp
72     SketchSolver_ConstraintDistance.cpp
73     SketchSolver_ConstraintEqual.cpp
74     SketchSolver_ConstraintLength.cpp
75     SketchSolver_ConstraintMiddle.cpp
76     SketchSolver_ConstraintMirror.cpp
77     SketchSolver_ConstraintFixed.cpp
78     SketchSolver_ConstraintTangent.cpp
79     SketchSolver_ConstraintMulti.cpp
80     SketchSolver_ConstraintMultiRotation.cpp
81     SketchSolver_ConstraintMultiTranslation.cpp
82     SketchSolver_ConstraintMovement.cpp
83 )
84
85 SET(SKETCHSOLVER_LIBRARIES
86     Config
87     Events
88     ModelAPI
89     GeomAPI
90     GeomDataAPI
91 )
92
93 SET(SKETCHSOLVER_TEXT_RESOURCES
94     SketchSolver_msg_en.ts
95 )
96
97 INCLUDE_DIRECTORIES(
98     ${PROJECT_SOURCE_DIR}/src/Config
99     ${PROJECT_SOURCE_DIR}/src/SketchPlugin
100     ${PROJECT_SOURCE_DIR}/src/ModelAPI
101     ${PROJECT_SOURCE_DIR}/src/GeomAPI
102     ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
103     ${PROJECT_SOURCE_DIR}/src/Events
104 )
105
106 #SOURCE_GROUP ("Resource Files" FILES ${SKETCHSOLVER_TEXT_RESOURCES})
107 #
108 #ADD_DEFINITIONS(-DSKETCHSOLVER_EXPORTS)
109 #
110 #ADD_LIBRARY(SketchSolver SHARED ${SKETCHSOLVER_SOURCES} ${SKETCHSOLVER_CONSTRAINT_SOURCES} ${SKETCHSOLVER_HEADERS} ${SKETCHSOLVER_CONSTRAINT_HEADERS} ${SKETCHSOLVER_TEXT_RESOURCES}
111 #)
112 #
113 #TARGET_LINK_LIBRARIES(SketchSolver ${SKETCHSOLVER_LIBRARIES}
114 #)
115 #
116 #INSTALL(TARGETS SketchSolver DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES})
117 #INSTALL(FILES ${SKETCHSOLVER_TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
118
119 # Set full path to source files
120 TO_FULL_PATH(SKETCHSOLVER_SOURCES)
121 TO_FULL_PATH(SKETCHSOLVER_CONSTRAINT_SOURCES)
122 TO_FULL_PATH(SKETCHSOLVER_HEADERS)
123 TO_FULL_PATH(SKETCHSOLVER_CONSTRAINT_HEADERS)
124 TO_FULL_PATH(SKETCHSOLVER_TEXT_RESOURCES)
125
126
127 # Include specific solvers
128 IF(NO_SolveSpace)
129   SET(SSPath_FOUND FALSE)
130 ELSE()
131   FIND_FILE(SSPath "SolveSpaceSolver/CMakeLists.txt" PATHS "${CMAKE_CURRENT_SOURCE_DIR}")
132   STRING(COMPARE NOTEQUAL ${SSPath} "SSPath-NOTFOUND" SSPath_FOUND)
133 ENDIF()
134
135 IF(NO_PlaneGCS)
136   SET(GCSPath_FOUND FALSE)
137 ELSE()
138   FIND_FILE(GCSPath "PlaneGCSSolver/CMakeLists.txt" PATHS "${CMAKE_CURRENT_SOURCE_DIR}")
139   STRING(COMPARE NOTEQUAL ${GCSPath} "GCSPath-NOTFOUND" GCSPath_FOUND)
140 ENDIF()
141
142 IF(${SSPath_FOUND} OR ${GCSPath_FOUND})
143   IF(${SSPath_FOUND})
144     MESSAGE(STATUS "SolveSpaceSolver plugin found in ${SSPath}")
145     ADD_SUBDIRECTORY(SolveSpaceSolver)
146   ENDIF()
147   IF(${GCSPath_FOUND})
148     MESSAGE(STATUS "PlaneGCSSolver plugin found in ${GCSPath}")
149     ADD_SUBDIRECTORY(PlaneGCSSolver)
150   ENDIF()
151 ELSE()
152   MESSAGE(WARNING "No sketch solver plugin is found")
153 ENDIF()