]> git.cworth.org Git - apitrace/blobdiff - CMakeLists.txt
os: Fallback to OS TLS when compiler does not support it (issue #120).
[apitrace] / CMakeLists.txt
index c4c774820cd0f87e760c4f1b93db1ef5da19038c..aa96903533e21fb8f3a142fc4d84401807ce271c 100644 (file)
@@ -34,21 +34,6 @@ set (ENABLE_EGL true CACHE BOOL "Enable EGL support.")
 ##############################################################################
 # Find dependencies
 
-# Ensure __thread is support
-if (NOT MSVC)
-    include (CheckCXXSourceCompiles)
-    check_cxx_source_compiles("__thread int i; int main() { return 0; }" HAVE_COMPILER_TLS)
-    if (NOT HAVE_COMPILER_TLS)
-        if (APPLE)
-            message (FATAL_ERROR "C++ compiler does not support __thread keyword. Please install XCode 4.5 or higher.")
-        else (MINGW32)
-            message (FATAL_ERROR "C++ compiler does not support __thread keyword. Please use MinGW g++ version 4.4 or higher")
-        else ()
-            message (FATAL_ERROR "C++ compiler does not support __thread keyword.")
-        endif ()
-    endif ()
-endif ()
-
 set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
 
 set (CMAKE_USE_PYTHON_VERSION 2.7 2.6)
@@ -191,6 +176,11 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
         ERROR_QUIET
         OUTPUT_STRIP_TRAILING_WHITESPACE
     )
+    CHECK_INCLUDE_FILES(proc/readproc.h READPROC_H_FOUND)
+    if (READPROC_H_FOUND)
+        add_definitions (-DHAVE_READPROC_H)
+        find_library (proc_LIBRARY NAMES proc procps)
+    endif ()
 endif()
 
 if (WIN32 OR APPLE)
@@ -247,6 +237,7 @@ endif ()
 
 if (WIN32)
     add_subdirectory (thirdparty/less)
+    add_subdirectory (thirdparty/directxtex)
 endif ()
 
 # Always use bundled QJSon.
@@ -311,7 +302,6 @@ add_library (common STATIC
 )
 
 set_target_properties (common PROPERTIES
-    COMPILE_DEFINITIONS APITRACE_SOURCE_DIR="${CMAKE_SOURCE_DIR}"
     # Ensure it can be statically linked in shared libraries
     COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}"
 )
@@ -358,6 +348,12 @@ install (
         scripts/unpickle.py
     DESTINATION ${SCRIPTS_INSTALL_DIR}
 )
+if (WIN32)
+    install (
+        PROGRAMS scripts/convert.py
+        DESTINATION ${SCRIPTS_INSTALL_DIR}
+    )
+endif ()
 
 ##############################################################################
 # GUI