# prescribed in http://www.gentoo.org/proj/en/qa/automagic.xml
set (ENABLE_GUI "AUTO" CACHE STRING "Enable Qt GUI.")
+set (ENABLE_CLI true CACHE BOOL "Enable command Line interface.")
+
set (ENABLE_EGL "AUTO" CACHE STRING "Enable EGL support.")
find_package (PythonInterp REQUIRED)
find_package (OpenGL REQUIRED)
+find_package (Threads)
+
if (ENABLE_GUI)
if (NOT (ENABLE_GUI STREQUAL "AUTO"))
set (REQUIRE_GUI REQUIRED)
add_definitions (${PNG_DEFINITIONS})
link_libraries (${PNG_LIBRARIES})
+if (MSVC)
+ add_subdirectory (thirdparty/getopt EXCLUDE_FROM_ALL)
+ include_directories (${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/getopt)
+ set (GETOPT_LIBRARIES getopt_bundled)
+endif ()
+
# The Qt website provides binaries for Windows and MacOSX, and they are
# automatically found by cmake without any manual intervention. The situation
# for QJSON is substantially different: there are no binaries for QJSON
# On Windows/MacOSX, applications are usually installed on a directory of
# their own
set (DOC_INSTALL_DIR doc)
+ set (LIB_INSTALL_DIR lib)
else ()
set (DOC_INSTALL_DIR share/doc/${CMAKE_PROJECT_NAME})
-endif ()
-
-set (LIB_INSTALL_DIR lib/apitrace)
-
-if (APPLE)
- # MacOSX uses fat binaries, so no need to have per-architecture wrapper
- # directories
- set (LIB_ARCH_INSTALL_DIR ${LIB_INSTALL_DIR})
-else ()
- set (LIB_ARCH_INSTALL_DIR ${LIB_INSTALL_DIR}/${CMAKE_SYSTEM_PROCESSOR})
+ set (LIB_INSTALL_DIR lib/${CMAKE_PROJECT_NAME})
endif ()
set(SCRIPTS_INSTALL_DIR ${LIB_INSTALL_DIR}/scripts)
-set(WRAPPER_INSTALL_DIR ${LIB_ARCH_INSTALL_DIR}/wrappers)
+set(WRAPPER_INSTALL_DIR ${LIB_INSTALL_DIR}/wrappers)
# Expose the binary/install directories to source
#
)
target_link_libraries (cgltrace
- pthread
+ ${CMAKE_THREAD_LIBS_INIT}
dl
)
target_link_libraries (glxtrace
${X11_X11_LIB}
- pthread
+ ${CMAKE_THREAD_LIBS_INIT}
dl
)
)
target_link_libraries (egltrace
- pthread
+ ${CMAKE_THREAD_LIBS_INIT}
dl
)
# gdb doesn't like when pthreads is loaded through dlopen (which happens
# when dlopen'ing libGL), so link pthreads to avoid this issue. See also
# http://stackoverflow.com/questions/2702628/gdb-cannot-find-new-threads-generic-error
- pthread
+ ${CMAKE_THREAD_LIBS_INIT}
dl
)
target_link_libraries (eglretrace
common
${X11_X11_LIB}
- pthread
+ ${CMAKE_THREAD_LIBS_INIT}
dl
)
##############################################################################
# CLI
-add_subdirectory(cli)
+if (ENABLE_CLI)
+ add_subdirectory(cli)
+endif ()
##############################################################################
# Scripts (to support the CLI)
install (
PROGRAMS
- ${CMAKE_CURRENT_SOURCE_DIR}/scripts/tracediff.sh
+ ${CMAKE_CURRENT_SOURCE_DIR}/scripts/tracediff.py
${CMAKE_CURRENT_SOURCE_DIR}/scripts/jsondiff.py
${CMAKE_CURRENT_SOURCE_DIR}/scripts/snapdiff.py
DESTINATION ${SCRIPTS_INSTALL_DIR}
LICENSE
NEWS.markdown
README.markdown
- TODO.markdown
DESTINATION ${DOC_INSTALL_DIR}
)
-set (CPACK_PACKAGE_VERSION_MAJOR "2")
+set (CPACK_PACKAGE_VERSION_MAJOR "3")
set (CPACK_PACKAGE_VERSION_MINOR "0")
# Use current date in YYYYMMDD format as patch number
OUTPUT_VARIABLE CPACK_PACKAGE_VERSION_PATCH
)
+# cpack mistakenly detects Mingw-w64 as win32
+if (MINGW)
+ if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set (CPACK_SYSTEM_NAME win64)
+ endif ()
+endif ()
+
# See http://www.vtk.org/Wiki/CMake:CPackPackageGenerators
if (WIN32)
set (CPACK_GENERATOR "ZIP")