File size: 2,177 Bytes
985c397
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# SPDX-License-Identifier: LGPL-2.1-or-later

set(CAMSimulator_LIBS
    Path
    Part
    Mesh
    FreeCADApp
    FreeCADGui
    ${QtOpenGL_LIBRARIES}
    ${OPENGL_gl_LIBRARY}
)

SET(CAMSimulator_SRCS_Python
    CAMSim.pyi
    CAMSimPyImp.cpp
)


SET(CAMSimulator_SRCS_Module
    AppCAMSimulator.cpp
    CAMSim.cpp
    CAMSim.h
    CAMSimPyImp.cpp
    DlgCAMSimulator.cpp
    DlgCAMSimulator.h
    PreCompiled.h
)

SET(CAMSimulator_SRCS_Core
    EndMill.cpp
    EndMill.h
    GCodeParser.cpp
    GCodeParser.h
    GlUtils.cpp
    GlUtils.h
    GuiDisplay.cpp
    GuiDisplay.h
    linmath.h
    MillMotion.h
    MillPathLine.cpp
	MillPathLine.h
    MillPathSegment.cpp
    MillPathSegment.h
    MillSimulation.cpp
    MillSimulation.h
    OpenGlWrapper.h
    Shader.cpp
    Shader.h
    SimDisplay.cpp
    SimDisplay.h
    SimShapes.cpp
    SimShapes.h
    StockObject.cpp
    StockObject.h
    SolidObject.cpp
    SolidObject.h
    Texture.cpp
    Texture.h
    TextureLoader.cpp
    TextureLoader.h
)

generate_from_py(CAMSim)

SOURCE_GROUP("Module" FILES ${CAMSimulator_SRCS_Module})
SOURCE_GROUP("Python" FILES ${CAMSimulator_SRCS_Python})
SOURCE_GROUP("Core" FILES ${CAMSimulator_SRCS_Core})

SET(CAMSimulator_SRCS_precomp
    ${CAMSimulator_SRCS_Module}
    ${CAMSimulator_SRCS_Python}
)

SET(CAMSimulator_SRCS
    ${CAMSimulator_SRCS_precomp}
    ${CAMSimulator_SRCS_Core}
)

add_library(CAMSimulator SHARED ${CAMSimulator_SRCS})
target_include_directories(
    CAMSimulator
    PRIVATE
    ${CMAKE_BINARY_DIR}
    ${CMAKE_SOURCE_DIR}/src
    ${CMAKE_BINARY_DIR}/src
    ${CMAKE_CURRENT_BINARY_DIR}
)
target_link_libraries(CAMSimulator ${CAMSimulator_LIBS})

if(FREECAD_USE_PCH)
    target_precompile_headers(CAMSimulator PRIVATE
            $<$<COMPILE_LANGUAGE:CXX>:"${CMAKE_CURRENT_LIST_DIR}/PreCompiled.h">
    )
    set_source_files_properties(${CAMSimulator_SRCS_Core} PROPERTIES SKIP_PRECOMPILE_HEADERS TRUE)
endif(FREECAD_USE_PCH)

if (FREECAD_WARN_ERROR)
    target_compile_warn_error(CAMSimulator)
endif()

SET_BIN_DIR(CAMSimulator CAMSimulator /Mod/CAM)
SET_PYTHON_PREFIX_SUFFIX(CAMSimulator)

INSTALL(TARGETS CAMSimulator DESTINATION ${CMAKE_INSTALL_LIBDIR})