PageRenderTime 52ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/src/App/CMakeLists.txt

https://bitbucket.org/yorik/freecad
CMake | 200 lines | 171 code | 18 blank | 11 comment | 5 complexity | 67c7f6c07389ba546e72261c777366da MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, BSD-3-Clause, LGPL-3.0, 0BSD
  1. if(WIN32)
  2. add_definitions(-DFCApp)
  3. add_definitions(-DBOOST_DYN_LINK)
  4. endif(WIN32)
  5. # This causes some problems with the resource files to be found, especially with the StartPage
  6. #IF(RESOURCEDIR)
  7. # add_definitions(-DRESOURCEDIR="${RESOURCEDIR}")
  8. #ENDIF(RESOURCEDIR)
  9. #IF(DOCDIR)
  10. # add_definitions(-DDOCDIR="${DOCDIR}")
  11. #ENDIF(DOCDIR)
  12. include_directories(
  13. ${CMAKE_BINARY_DIR}/src
  14. ${CMAKE_SOURCE_DIR}/src
  15. ${CMAKE_CURRENT_BINARY_DIR}
  16. ${Boost_INCLUDE_DIRS}
  17. ${PYTHON_INCLUDE_PATH}
  18. ${XERCESC_INCLUDE_DIR}
  19. ${QT_INCLUDE_DIR}
  20. ${ZLIB_INCLUDE_DIR}
  21. )
  22. if(WIN32)
  23. set(FreeCADApp_LIBS
  24. FreeCADBase
  25. ${Boost_DEBUG_LIBRARIES}
  26. ${Boost_LIBRARIES}
  27. )
  28. else(WIN32)
  29. set(FreeCADApp_LIBS
  30. FreeCADBase
  31. ${Boost_LIBRARIES}
  32. )
  33. endif(WIN32)
  34. generate_from_xml(DocumentPy)
  35. generate_from_xml(DocumentObjectPy)
  36. generate_from_xml(DocumentObjectGroupPy)
  37. generate_from_xml(FeaturePythonPy)
  38. generate_from_xml(ComplexGeoDataPy)
  39. generate_from_xml(PropertyContainerPy)
  40. generate_from_xml(MaterialPy)
  41. generate_from_py(FreeCADInit InitScript.h)
  42. generate_from_py(FreeCADTest TestScript.h)
  43. SET(FreeCADApp_XML_SRCS
  44. DocumentObjectGroupPy.xml
  45. DocumentObjectPy.xml
  46. DocumentPy.xml
  47. FeaturePythonPy.xml
  48. PropertyContainerPy.xml
  49. ComplexGeoDataPy.xml
  50. MaterialPy.xml
  51. )
  52. SOURCE_GROUP("XML" FILES ${FreeCADApp_XML_SRCS})
  53. # The document stuff
  54. SET(Document_CPP_SRCS
  55. Annotation.cpp
  56. Document.cpp
  57. DocumentObject.cpp
  58. DocumentObjectFileIncluded.cpp
  59. DocumentObjectGroup.cpp
  60. DocumentObjectGroupPyImp.cpp
  61. DocumentObjectPyImp.cpp
  62. DocumentObserver.cpp
  63. DocumentObserverPython.cpp
  64. DocumentPyImp.cpp
  65. FeaturePython.cpp
  66. FeaturePythonPyImp.cpp
  67. FeatureTest.cpp
  68. GeoFeature.cpp
  69. InventorObject.cpp
  70. MeasureDistance.cpp
  71. Placement.cpp
  72. Transactions.cpp
  73. VRMLObject.cpp
  74. )
  75. SET(Document_HPP_SRCS
  76. Annotation.h
  77. Document.h
  78. DocumentObject.h
  79. DocumentObjectFileIncluded.h
  80. DocumentObjectGroup.h
  81. DocumentObserver.h
  82. DocumentObserverPython.h
  83. FeaturePython.h
  84. FeatureTest.h
  85. GeoFeature.h
  86. InventorObject.h
  87. MeasureDistance.h
  88. Placement.h
  89. Transactions.h
  90. VRMLObject.h
  91. )
  92. SET(Document_SRCS
  93. ${Document_CPP_SRCS}
  94. ${Document_HPP_SRCS}
  95. )
  96. SOURCE_GROUP("Document" FILES ${Document_SRCS})
  97. # The property stuff
  98. SET(Properties_CPP_SRCS
  99. DynamicProperty.cpp
  100. Property.cpp
  101. PropertyContainer.cpp
  102. PropertyContainerPyImp.cpp
  103. PropertyFile.cpp
  104. PropertyGeo.cpp
  105. PropertyLinks.cpp
  106. PropertyPythonObject.cpp
  107. PropertyStandard.cpp
  108. PropertyUnits.cpp
  109. )
  110. SET(Properties_HPP_SRCS
  111. DynamicProperty.h
  112. Property.h
  113. PropertyContainer.h
  114. PropertyFile.h
  115. PropertyGeo.h
  116. PropertyLinks.h
  117. PropertyPythonObject.h
  118. PropertyStandard.h
  119. PropertyUnits.h
  120. )
  121. SET(Properties_SRCS
  122. ${Properties_CPP_SRCS}
  123. ${Properties_HPP_SRCS}
  124. )
  125. SOURCE_GROUP("Properties" FILES ${Properties_SRCS})
  126. SET(FreeCADApp_CPP_SRCS
  127. ${Document_CPP_SRCS}
  128. ${Properties_CPP_SRCS}
  129. Application.cpp
  130. ApplicationPy.cpp
  131. ColorModel.cpp
  132. ComplexGeoData.cpp
  133. ComplexGeoDataPyImp.cpp
  134. Material.cpp
  135. MaterialPyImp.cpp
  136. )
  137. SET(FreeCADApp_HPP_SRCS
  138. ${Document_HPP_SRCS}
  139. ${Properties_HPP_SRCS}
  140. Application.h
  141. ColorModel.h
  142. ComplexGeoData.h
  143. Material.h
  144. )
  145. SET(FreeCADApp_SRCS
  146. ${FreeCADApp_CPP_SRCS}
  147. ${FreeCADApp_HPP_SRCS}
  148. ${FreeCADApp_XML_SRCS}
  149. FreeCADInit.py
  150. FreeCADTest.py
  151. PreCompiled.cpp
  152. PreCompiled.h
  153. )
  154. if(MSVC)
  155. add_definitions(-D_PreComp_)
  156. ADD_MSVC_PRECOMPILED_HEADER("PreCompiled.h" "PreCompiled.cpp" FreeCADApp_CPP_SRCS)
  157. endif(MSVC)
  158. add_library(FreeCADApp SHARED ${FreeCADApp_SRCS})
  159. target_link_libraries(FreeCADApp ${FreeCADApp_LIBS})
  160. # Note this is IDE specific, not necessarily platform specific
  161. if(MSVC)
  162. set_target_properties(FreeCADApp PROPERTIES DEBUG_OUTPUT_NAME "FreeCADAppD")
  163. set_target_properties(FreeCADApp PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
  164. # dirty hack to avoid Debug/Release subdirectory
  165. set_target_properties(FreeCADApp PROPERTIES PREFIX "../")
  166. elseif(MINGW)
  167. set_target_properties(FreeCADApp PROPERTIES DEBUG_OUTPUT_NAME "FreeCADAppD")
  168. set_target_properties(FreeCADApp PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
  169. else(MSVC)
  170. set_target_properties(FreeCADApp PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
  171. set_target_properties(FreeCADApp PROPERTIES INSTALL_RPATH ${INSTALL_RPATH})
  172. endif(MSVC)
  173. if(WIN32)
  174. INSTALL(TARGETS FreeCADApp
  175. RUNTIME DESTINATION bin
  176. LIBRARY DESTINATION lib
  177. )
  178. else(WIN32)
  179. INSTALL(TARGETS FreeCADApp
  180. LIBRARY DESTINATION lib
  181. )
  182. endif(WIN32)