2008-03-11 15:57:54 +00:00
|
|
|
add_definitions(-DPCBNEW)
|
2007-11-08 07:17:37 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
include_directories(BEFORE ${INC_BEFORE})
|
|
|
|
include_directories(
|
2014-07-30 09:01:25 +00:00
|
|
|
textures
|
2012-01-23 04:33:36 +00:00
|
|
|
../pcbnew
|
|
|
|
../polygon
|
2015-12-08 07:31:57 +00:00
|
|
|
3d_canvas
|
|
|
|
3d_cache
|
|
|
|
3d_rendering
|
|
|
|
3d_viewer
|
|
|
|
${CMAKE_SOURCE_DIR}/include/gal/opengl
|
2014-08-01 21:27:20 +00:00
|
|
|
${GLEW_INCLUDE_DIR}
|
2015-12-08 07:31:57 +00:00
|
|
|
${GLM_INCLUDE_DIR}
|
2015-12-13 21:45:22 +00:00
|
|
|
${CMAKE_SOURCE_DIR}
|
2012-01-23 04:33:36 +00:00
|
|
|
${INC_AFTER}
|
|
|
|
)
|
2007-11-08 07:17:37 +00:00
|
|
|
|
2015-12-08 07:31:57 +00:00
|
|
|
# directories
|
|
|
|
set( DIR_DLG 3d_cache/dialogs )
|
|
|
|
set( DIR_RAY 3d_rendering/3d_render_raytracing )
|
|
|
|
set( DIR_RAY_ACC ${DIR_RAY}/accelerators )
|
|
|
|
set( DIR_RAY_2D ${DIR_RAY}/shapes2D )
|
|
|
|
set( DIR_RAY_3D ${DIR_RAY}/shapes3D )
|
2015-12-13 21:45:22 +00:00
|
|
|
set( DIR_3D_PLUGINS ${CMAKE_SOURCE_DIR}/plugins/ldr )
|
2015-12-08 07:31:57 +00:00
|
|
|
|
2008-03-11 15:57:54 +00:00
|
|
|
set(3D-VIEWER_SRCS
|
2013-05-16 19:04:21 +00:00
|
|
|
dialogs/dialog_3D_view_option_base.cpp
|
|
|
|
dialogs/dialog_3D_view_option.cpp
|
2008-01-30 09:42:19 +00:00
|
|
|
3d_aux.cpp
|
|
|
|
3d_canvas.cpp
|
|
|
|
3d_class.cpp
|
|
|
|
3d_draw.cpp
|
2015-07-04 16:38:08 +00:00
|
|
|
3d_draw_board_body.cpp
|
2012-08-26 13:59:55 +00:00
|
|
|
3d_draw_basic_functions.cpp
|
2014-08-04 11:28:29 +00:00
|
|
|
3d_draw_helper_functions.cpp
|
2008-01-30 09:42:19 +00:00
|
|
|
3d_frame.cpp
|
2014-07-30 09:01:25 +00:00
|
|
|
3d_material.cpp
|
|
|
|
3d_mesh_model.cpp
|
2008-01-30 09:42:19 +00:00
|
|
|
3d_read_mesh.cpp
|
|
|
|
3d_toolbar.cpp
|
2012-08-26 13:59:55 +00:00
|
|
|
info3d_visu.cpp
|
2012-01-23 04:33:36 +00:00
|
|
|
trackball.cpp
|
2013-03-27 18:34:23 +00:00
|
|
|
vrmlmodelparser.cpp
|
2014-07-30 09:01:25 +00:00
|
|
|
vrml_aux.cpp
|
|
|
|
vrml_v1_modelparser.cpp
|
|
|
|
vrml_v2_modelparser.cpp
|
|
|
|
x3dmodelparser.cpp
|
2015-03-15 15:51:56 +00:00
|
|
|
CImage.cpp
|
2015-12-13 21:45:22 +00:00
|
|
|
${DIR_3D_PLUGINS}/pluginldr.cpp
|
|
|
|
${DIR_3D_PLUGINS}/3d/pluginldr3D.cpp
|
2015-12-08 07:31:57 +00:00
|
|
|
3d_cache/3d_cache_wrapper.cpp
|
|
|
|
3d_cache/3d_cache.cpp
|
|
|
|
3d_cache/3d_plugin_manager.cpp
|
|
|
|
3d_cache/3d_filename_resolver.cpp
|
|
|
|
${DIR_DLG}/3d_cache_dialogs.cpp
|
2016-01-18 05:59:06 +00:00
|
|
|
${DIR_DLG}/dlg_3d_pathconfig_base.cpp
|
|
|
|
${DIR_DLG}/dlg_3d_pathconfig.cpp
|
2016-01-25 04:55:36 +00:00
|
|
|
${DIR_DLG}/dlg_select_3dmodel.cpp
|
2015-12-08 07:31:57 +00:00
|
|
|
${DIR_DLG}/panel_prev_model.cpp
|
|
|
|
3d_model_viewer/c3d_model_viewer.cpp
|
|
|
|
3d_rendering/3d_render_ogl_legacy/c_ogl_3dmodel.cpp
|
|
|
|
3d_rendering/3d_render_ogl_legacy/ogl_legacy_utils.cpp
|
|
|
|
3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp
|
|
|
|
3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp
|
|
|
|
3d_rendering/3d_render_ogl_legacy/clayer_triangles.cpp
|
|
|
|
${DIR_RAY}/ray.cpp
|
|
|
|
${DIR_RAY_2D}/cbbox2d.cpp
|
|
|
|
${DIR_RAY_2D}/cobject2d.cpp
|
|
|
|
${DIR_RAY_2D}/croundsegment2d.cpp
|
|
|
|
${DIR_RAY_3D}/cbbox.cpp
|
|
|
|
${DIR_RAY_3D}/cbbox_ray.cpp
|
|
|
|
3d_rendering/ccamera.cpp
|
|
|
|
3d_rendering/cimage.cpp
|
|
|
|
3d_rendering/ctrack_ball.cpp
|
|
|
|
3d_rendering/trackball.cpp
|
|
|
|
common_ogl/cogl_att_list.cpp
|
|
|
|
common_ogl/ogl_utils.cpp
|
2012-01-23 04:33:36 +00:00
|
|
|
)
|
2007-11-08 07:17:37 +00:00
|
|
|
|
2012-02-08 15:06:06 +00:00
|
|
|
add_library(3d-viewer STATIC ${3D-VIEWER_SRCS})
|
2014-10-07 18:10:01 +00:00
|
|
|
add_dependencies( 3d-viewer pcbcommon )
|
2015-12-08 07:31:57 +00:00
|
|
|
|
|
|
|
option( GLM_ENABLE_SIMD_SSE2 "Enable SSE2 optimizations" OFF )
|
|
|
|
option( GLM_ENABLE_SIMD_SSE3 "Enable SSE3 optimizations" OFF )
|
|
|
|
option( GLM_ENABLE_SIMD_AVX "Enable AVX optimizations" OFF )
|
|
|
|
option( GLM_ENABLE_SIMD_AVX2 "Enable AVX2 optimizations" OFF )
|
|
|
|
option( GLM_FORCE_PURE "Force 'pure' instructions" OFF )
|
|
|
|
|
|
|
|
if(GLM_FORCE_PURE)
|
|
|
|
add_definitions(-DGLM_FORCE_PURE)
|
|
|
|
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
add_definitions(-mfpmath=387)
|
|
|
|
endif()
|
|
|
|
elseif(GLM_ENABLE_SIMD_AVX2)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
add_definitions(-mavx2)
|
|
|
|
elseif(GLM_USE_INTEL)
|
|
|
|
add_definitions(/QxAVX2)
|
|
|
|
elseif(MSVC)
|
|
|
|
add_definitions(/arch:AVX2)
|
|
|
|
endif()
|
|
|
|
elseif(GLM_ENABLE_SIMD_AVX)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
add_definitions(-mavx)
|
|
|
|
elseif(GLM_USE_INTEL)
|
|
|
|
add_definitions(/QxAVX)
|
|
|
|
elseif(MSVC)
|
|
|
|
add_definitions(/arch:AVX)
|
|
|
|
endif()
|
|
|
|
elseif(GLM_ENABLE_SIMD_SSE3)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
add_definitions(-msse3)
|
|
|
|
elseif(GLM_USE_INTEL)
|
|
|
|
add_definitions(/QxSSE3)
|
|
|
|
elseif(MSVC)
|
|
|
|
add_definitions(/arch:SSE2) # VC doesn't support /arch:SSE3
|
|
|
|
endif()
|
|
|
|
elseif(GLM_ENABLE_SIMD_SSE2)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
add_definitions(-msse2)
|
|
|
|
elseif(GLM_USE_INTEL)
|
|
|
|
add_definitions(/QxSSE2)
|
|
|
|
elseif(MSVC)
|
|
|
|
if(NOT CMAKE_CL_64)
|
|
|
|
add_definitions(/arch:SSE2)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
option( GLM_ENABLE_FAST_MATH "Enable fast math optimizations" OFF )
|
|
|
|
|
|
|
|
if(GLM_ENABLE_FAST_MATH)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
add_definitions(-ffast-math)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
add_definitions(/fp:fast)
|
|
|
|
endif()
|
|
|
|
elseif(NOT GLM_ENABLE_FAST_MATH)
|
|
|
|
if(MSVC)
|
|
|
|
add_definitions(/fp:precise)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2016-01-11 04:47:08 +00:00
|
|
|
target_link_libraries( 3d-viewer ${Boost_} ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES} kicad_3dsg )
|
2015-12-08 07:31:57 +00:00
|
|
|
|
|
|
|
add_subdirectory( 3d_cache )
|