1 cmake_minimum_required (VERSION 2.8)
6 ##############################################################################
9 # On Mac OS X build fat binaries with i386 and x86_64 architectures by default.
10 if (APPLE AND NOT CMAKE_OSX_ARCHITECTURES)
11 set (CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for OSX" FORCE)
14 # We use a cached string variable instead of the standard (boolean) OPTION
15 # command so that we can default to auto-detecting optional depencies, while
16 # still providing a mechanism to force/disable these optional dependencies, as
17 # prescribed in http://www.gentoo.org/proj/en/qa/automagic.xml
18 set (ENABLE_GUI "AUTO" CACHE STRING "Enable Qt GUI.")
20 set (ENABLE_CLI true CACHE BOOL "Enable command Line interface.")
22 set (ENABLE_EGL "AUTO" CACHE STRING "Enable EGL support.")
25 ##############################################################################
28 include (FindPkgConfig)
30 set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
32 set (CMAKE_USE_PYTHON_VERSION 2.7 2.6)
34 find_package (PythonInterp REQUIRED)
35 find_package (OpenGL REQUIRED)
37 find_package (Threads)
40 if (NOT (ENABLE_GUI STREQUAL "AUTO"))
41 set (REQUIRE_GUI REQUIRED)
43 find_package (Qt4 4.7 COMPONENTS QtCore QtGui QtWebKit ${REQUIRE_GUI})
44 find_package (QJSON ${REQUIRE_GUI})
47 include_directories (${OPENGL_INCLUDE_DIR})
50 find_package (DirectX)
56 include_directories (${X11_INCLUDE_DIR})
57 add_definitions (-DHAVE_X11)
61 if (NOT ENABLE_EGL STREQUAL "AUTO")
62 set (REQUIRE_EGL REQUIRED)
64 pkg_check_modules (EGL egl glesv1_cm glesv2 ${REQUIRE_EGL})
66 include_directories (${EGL_INCLUDE_DIR})
67 add_definitions (-DHAVE_EGL)
75 ##############################################################################
76 # Set global build options
78 include (CheckCXXCompilerFlag)
81 # MSVC & MinGW only define & use APIENTRY
82 add_definitions (-DGLAPIENTRY=__stdcall)
84 # http://msdn.microsoft.com/en-us/library/aa383745.aspx
85 add_definitions (-D_WIN32_WINNT=0x0500 -DWINVER=0x0500)
87 CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" CXX_COMPILER_FLAG_VISIBILITY)
88 if (CXX_COMPILER_FLAG_VISIBILITY)
89 add_definitions ("-fvisibility=hidden")
90 endif (CXX_COMPILER_FLAG_VISIBILITY)
94 # C99 includes for msvc
95 include_directories (${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/msvc)
97 # Enable math constants defines
98 add_definitions (-D_USE_MATH_DEFINES)
101 add_definitions (-DNOMINMAX)
104 add_definitions (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
105 add_definitions (-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
106 add_definitions (-W4)
107 add_definitions (-wd4063) # not a valid value for switch of enum
108 add_definitions (-wd4127) # conditional expression is constant
109 add_definitions (-wd4244) # conversion from 'type1' to 'type2', possible loss of data
110 add_definitions (-wd4505) # unreferenced local function has been removed
111 add_definitions (-wd4800) # forcing value to bool 'true' or 'false' (performance warning)
112 # XXX: it's safer to use ssize_t everywhere instead of disabling warning
113 add_definitions (-wd4018) # signed/unsigned mismatch
116 # http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F
118 CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
119 CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
121 if (${flag_var} MATCHES "/MD")
122 string (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
123 endif (${flag_var} MATCHES "/MD")
124 endforeach (flag_var)
127 add_definitions (-Wall)
128 # XXX: it's safer to use ssize_t everywhere instead of disabling warning
129 add_definitions (-Wno-sign-compare) # comparison between signed and unsigned integer expressions
133 # Avoid depending on MinGW runtime DLLs
134 check_cxx_compiler_flag (-static-libgcc HAVE_STATIC_LIBGCC_FLAG)
135 if (HAVE_STATIC_LIBGCC_FLAG)
136 set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc")
137 set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc")
138 set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -static-libgcc")
140 check_cxx_compiler_flag (-static-libstdc++ HAVE_STATIC_LIBSTDCXX_FLAG)
141 if (HAVE_STATIC_LIBSTDCXX_FLAG)
142 set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++")
143 set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++")
144 set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -static-libstdc++")
149 # Put all executables into the same top level build directory, regardless of
150 # which subdirectory they are declared
151 set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
154 ##############################################################################
155 # Bundled dependencies
157 # We always use the bundled zlib, libpng, and snappy sources:
158 # - on Windows to make it easy to deploy the wrappers DLLs
159 # - on unices to prevent symbol collisions when tracing applications that link
160 # against other versions of these libraries
162 set (ZLIB_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib)
163 set (ZLIB_LIBRARIES z_bundled)
164 add_subdirectory (thirdparty/zlib EXCLUDE_FROM_ALL)
166 include_directories (${ZLIB_INCLUDE_DIRS})
167 link_libraries (${ZLIB_LIBRARIES})
169 set (SNAPPY_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/snappy)
170 set (SNAPPY_LIBRARIES snappy_bundled)
171 add_subdirectory (thirdparty/snappy EXCLUDE_FROM_ALL)
173 include_directories (${SNAPPY_INCLUDE_DIRS})
174 link_libraries (${SNAPPY_LIBRARIES})
176 set (PNG_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libpng)
177 set (PNG_DEFINITIONS "")
178 set (PNG_LIBRARIES png_bundled)
180 add_subdirectory (thirdparty/libpng EXCLUDE_FROM_ALL)
181 include_directories (${PNG_INCLUDE_DIR})
182 add_definitions (${PNG_DEFINITIONS})
183 link_libraries (${PNG_LIBRARIES})
186 add_subdirectory (thirdparty/getopt EXCLUDE_FROM_ALL)
187 include_directories (${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/getopt)
188 set (GETOPT_LIBRARIES getopt_bundled)
191 # The Qt website provides binaries for Windows and MacOSX, and they are
192 # automatically found by cmake without any manual intervention. The situation
193 # for QJSON is substantially different: there are no binaries for QJSON
194 # available, and there is no standard installation directory that is detected
197 # By bundling the QJSON source, we make it much more easier to build the GUI on
198 # Windows and MacOSX. But we only use the bundled sources when ENABLE_GUI is
200 if (QT4_FOUND AND NOT QJSON_FOUND AND (ENABLE_GUI STREQUAL "AUTO"))
201 add_subdirectory (thirdparty/qjson EXCLUDE_FROM_ALL)
202 set (QJSON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty)
203 set (QJSON_LIBRARY_DIRS)
204 set (QJSON_LIBRARIES qjson_bundled)
205 set (QJSON_FOUND TRUE)
208 # For glext headers. Needs to be before system includes as often system's GL
209 # headers bundle and include glext.h and glxext.h
210 include_directories (BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glext)
213 include_directories (${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/khr)
215 ##############################################################################
216 # Installation directories
219 # On Windows/MacOSX, applications are usually installed on a directory of
221 set (DOC_INSTALL_DIR doc)
222 set (LIB_INSTALL_DIR lib)
224 set (DOC_INSTALL_DIR share/doc/${CMAKE_PROJECT_NAME})
225 set (LIB_INSTALL_DIR lib/${CMAKE_PROJECT_NAME})
228 set(SCRIPTS_INSTALL_DIR ${LIB_INSTALL_DIR}/scripts)
229 set(WRAPPER_INSTALL_DIR ${LIB_INSTALL_DIR}/wrappers)
231 # Expose the binary/install directories to source
233 # TODO: Use the same directory layout, for both build and install directories,
234 # so that binaries can find each other using just relative paths.
237 -DAPITRACE_BINARY_DIR="${CMAKE_BINARY_DIR}"
238 -DAPITRACE_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}"
239 -DAPITRACE_WRAPPER_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${WRAPPER_INSTALL_DIR}"
243 ##############################################################################
244 # Common libraries / utilities
246 include_directories (
247 ${CMAKE_CURRENT_BINARY_DIR}
248 ${CMAKE_CURRENT_SOURCE_DIR}
249 ${CMAKE_CURRENT_SOURCE_DIR}/common
253 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
254 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glproc.py > ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
255 DEPENDS glproc.py dispatch.py specs/wglapi.py specs/glxapi.py specs/cglapi.py specs/eglapi.py specs/glesapi.py specs/glapi.py specs/gltypes.py specs/stdapi.py
258 # Wrap glproc.hpp as a target to prevent the command from being executed
259 # multiple times simulatenously, when the targets that depend on it are built
261 add_custom_target (glproc DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp)
264 set (os os_win32.cpp)
265 set (glws_os glws_wgl.cpp)
267 set (os os_posix.cpp)
269 set (glws_os glws_cocoa.mm)
271 set (glws_os glws_glx.cpp)
275 add_library (common STATIC
276 common/trace_callset.cpp
277 common/trace_dump.cpp
278 common/trace_file.cpp
279 common/trace_file_read.cpp
280 common/trace_file_write.cpp
281 common/trace_file_zlib.cpp
282 common/trace_file_snappy.cpp
283 common/trace_model.cpp
284 common/trace_parser.cpp
285 common/trace_parser_flags.cpp
286 common/trace_writer.cpp
287 common/trace_writer_local.cpp
288 common/trace_writer_model.cpp
289 common/trace_loader.cpp
290 common/trace_resource.cpp
291 common/trace_tools_trace.cpp
299 set_target_properties (common PROPERTIES
300 COMPILE_DEFINITIONS APITRACE_SOURCE_DIR="${CMAKE_SOURCE_DIR}"
301 # Ensure it can be statically linked in shared libraries
302 COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}"
305 link_libraries (common)
308 ##############################################################################
313 # Silence warnings about @nn suffix mismatch
314 set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--enable-stdcall-fixup")
318 if (DirectX_D3D_INCLUDE_DIR)
319 include_directories (SYSTEM ${DirectX_D3D_INCLUDE_DIR})
321 OUTPUT ddrawtrace.cpp
322 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/ddrawtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/ddrawtrace.cpp
323 DEPENDS ddrawtrace.py trace.py specs/d3d.py specs/d3dtypes.py specs/d3dcaps.py specs/ddraw.py specs/winapi.py specs/stdapi.py
325 add_library (ddraw MODULE specs/ddraw.def ddrawtrace.cpp)
326 set_target_properties (ddraw
328 RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
329 LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
331 install (TARGETS ddraw LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
332 endif (DirectX_D3D_INCLUDE_DIR)
335 if (DirectX_D3D8_INCLUDE_DIR AND DirectX_D3DX9_INCLUDE_DIR)
336 include_directories (SYSTEM ${DirectX_D3D8_INCLUDE_DIR} ${DirectX_D3DX9_INCLUDE_DIR})
339 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d8trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d8trace.cpp
340 DEPENDS d3d8trace.py trace.py specs/d3d8.py specs/d3d8types.py specs/d3d8caps.py specs/winapi.py specs/stdapi.py
342 add_library (d3d8 MODULE specs/d3d8.def d3d8trace.cpp d3dshader.cpp)
343 set_target_properties (d3d8
345 RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
346 LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
348 install (TARGETS d3d8 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
349 endif (DirectX_D3D8_INCLUDE_DIR AND DirectX_D3DX9_INCLUDE_DIR)
352 if (DirectX_D3DX9_INCLUDE_DIR)
353 include_directories (SYSTEM ${DirectX_D3DX9_INCLUDE_DIR})
356 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d9trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d9trace.cpp
357 DEPENDS d3d9trace.py trace.py specs/d3d9.py specs/d3d9types.py specs/d3d9caps.py specs/winapi.py specs/stdapi.py
359 add_library (d3d9 MODULE specs/d3d9.def d3d9trace.cpp d3dshader.cpp)
360 set_target_properties (d3d9
362 RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
363 LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
365 install (TARGETS d3d9 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
366 endif (DirectX_D3DX9_INCLUDE_DIR)
369 if (DirectX_D3D10_INCLUDE_DIR)
370 include_directories (SYSTEM ${DirectX_D3D10_INCLUDE_DIR})
372 OUTPUT d3d10trace.cpp
373 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10trace.cpp
374 DEPENDS d3d10trace.py trace.py specs/d3d10misc.py specs/d3d10.py specs/dxgi.py specs/dxgitype.py specs/dxgiformat.py specs/winapi.py specs/stdapi.py
376 add_library (d3d10 MODULE specs/d3d10.def d3d10trace.cpp)
377 set_target_properties (d3d10
379 RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
380 LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
382 install (TARGETS d3d10 LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
383 endif (DirectX_D3D10_INCLUDE_DIR)
388 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/wgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/wgltrace.cpp
389 DEPENDS wgltrace.py gltrace.py trace.py specs/wglapi.py specs/wglenum.py specs/glapi.py specs/glparams.py specs/gltypes.py specs/winapi.py specs/stdapi.py
391 add_library (wgltrace MODULE specs/opengl32.def
396 add_dependencies (wgltrace glproc)
397 set_target_properties (wgltrace PROPERTIES
400 RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
401 LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
403 install (TARGETS wgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
409 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cgltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/cgltrace.cpp
410 DEPENDS cgltrace.py gltrace.py trace.py specs/cglapi.py specs/glapi.py specs/glparams.py specs/gltypes.py specs/stdapi.py
413 add_library (cgltrace SHARED
419 add_dependencies (cgltrace glproc)
421 set_target_properties (cgltrace PROPERTIES
422 # OpenGL framework name
423 PREFIX "" OUTPUT_NAME "OpenGL" SUFFIX ""
424 # Specificy the version and reexport GLU symbols
425 LINK_FLAGS "-compatibility_version 1 -current_version 1.0.0 -Wl,-reexport_library,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib"
426 RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
427 LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
430 target_link_libraries (cgltrace
431 ${CMAKE_THREAD_LIBS_INIT}
435 install (TARGETS cgltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
440 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glxtrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glxtrace.cpp
441 DEPENDS glxtrace.py gltrace.py trace.py specs/glxapi.py specs/glapi.py specs/glparams.py specs/gltypes.py specs/stdapi.py
444 add_library (glxtrace SHARED
450 add_dependencies (glxtrace glproc)
452 set_target_properties (glxtrace PROPERTIES
453 # avoid the default "lib" prefix
455 # Prevent symbol relocations internal to our wrapper library to be
456 # overwritten by the application.
457 LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
458 RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
459 LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
462 target_link_libraries (glxtrace
464 ${CMAKE_THREAD_LIBS_INIT}
468 install (TARGETS glxtrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
476 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/egltrace.py > ${CMAKE_CURRENT_BINARY_DIR}/egltrace.cpp
477 DEPENDS egltrace.py gltrace.py trace.py specs/eglapi.py specs/glesapi.py specs/glapi.py specs/glparams.py specs/gltypes.py specs/stdapi.py
480 add_library (egltrace SHARED
486 add_dependencies (egltrace glproc)
491 PROPERTY COMPILE_DEFINITIONS "TRACE_EGL"
494 set_target_properties (egltrace PROPERTIES
495 # avoid the default "lib" prefix
497 LINK_FLAGS "-Wl,-Bsymbolic -Wl,-Bsymbolic-functions"
498 # Prevent symbol relocations internal to our wrapper library to be
499 # overwritten by the application.
500 RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
501 LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/wrappers
504 target_link_libraries (egltrace
505 ${CMAKE_THREAD_LIBS_INIT}
509 install (TARGETS egltrace LIBRARY DESTINATION ${WRAPPER_INSTALL_DIR})
512 ##############################################################################
516 OUTPUT glretrace_gl.cpp
517 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glretrace_gl.cpp
518 DEPENDS glretrace.py retrace.py specs/glapi.py specs/gltypes.py specs/stdapi.py
522 OUTPUT glstate_params.cpp
523 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glstate.py > ${CMAKE_CURRENT_BINARY_DIR}/glstate_params.cpp
524 DEPENDS glstate.py specs/glparams.py specs/gltypes.py specs/stdapi.py
541 if (WIN32 OR APPLE OR X11_FOUND)
542 add_executable (glretrace
548 add_dependencies (glretrace glproc)
553 PROPERTY COMPILE_DEFINITIONS "RETRACE"
556 target_link_libraries (glretrace
563 target_link_libraries (glretrace
565 "-framework ApplicationServices" # CGS*
566 ${OPENGL_gl_LIBRARY} # CGL*
569 target_link_libraries (glretrace ${X11_X11_LIB})
572 target_link_libraries (glretrace
573 # gdb doesn't like when pthreads is loaded through dlopen (which happens
574 # when dlopen'ing libGL), so link pthreads to avoid this issue. See also
575 # http://stackoverflow.com/questions/2702628/gdb-cannot-find-new-threads-generic-error
576 ${CMAKE_THREAD_LIBS_INIT}
580 if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
581 target_link_libraries (glretrace rt)
586 install (TARGETS glretrace RUNTIME DESTINATION bin)
589 if (EGL_FOUND AND X11_FOUND AND NOT WIN32 AND NOT APPLE)
590 add_executable (eglretrace
596 add_dependencies (eglretrace glproc)
601 PROPERTY COMPILE_DEFINITIONS "RETRACE"
602 PROPERTY COMPILE_DEFINITIONS "TRACE_EGL"
605 target_link_libraries (eglretrace
608 ${CMAKE_THREAD_LIBS_INIT}
612 if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
613 target_link_libraries (eglretrace rt)
616 install (TARGETS eglretrace RUNTIME DESTINATION bin)
619 ##############################################################################
623 add_subdirectory(cli)
626 ##############################################################################
627 # Scripts (to support the CLI)
631 ${CMAKE_CURRENT_SOURCE_DIR}/scripts/tracediff.py
632 ${CMAKE_CURRENT_SOURCE_DIR}/scripts/jsondiff.py
633 ${CMAKE_CURRENT_SOURCE_DIR}/scripts/snapdiff.py
634 DESTINATION ${SCRIPTS_INSTALL_DIR}
637 ##############################################################################
640 if (ENABLE_GUI AND QT4_FOUND AND QJSON_FOUND)
641 add_subdirectory(gui)
645 ##############################################################################
654 DESTINATION ${DOC_INSTALL_DIR}
657 set (CPACK_PACKAGE_VERSION_MAJOR "3")
658 set (CPACK_PACKAGE_VERSION_MINOR "0")
660 # Use current date in YYYYMMDD format as patch number
662 COMMAND ${PYTHON_EXECUTABLE} -c "import time, sys; sys.stdout.write(time.strftime('%Y%m%d'))"
663 OUTPUT_VARIABLE CPACK_PACKAGE_VERSION_PATCH
666 # cpack mistakenly detects Mingw-w64 as win32
668 if (CMAKE_SIZEOF_VOID_P EQUAL 8)
669 set (CPACK_SYSTEM_NAME win64)
673 # See http://www.vtk.org/Wiki/CMake:CPackPackageGenerators
675 set (CPACK_GENERATOR "ZIP")
677 set (CPACK_GENERATOR "DragNDrop")
679 set (CPACK_GENERATOR "TBZ2")