]> git.cworth.org Git - apitrace-tests/blobdiff - CMakeLists.txt
Remove variable default state.
[apitrace-tests] / CMakeLists.txt
index f69714af88f1010536d51f36d3cd8a085411c74a..1cd54f0da69cd31295ad939b29fb32a0e56dabe6 100644 (file)
@@ -2,16 +2,29 @@ cmake_minimum_required (VERSION 2.8)
 
 project (apitrace-tests)
 
+include (FindPkgConfig)
+
+# Set default built type
+if (NOT CMAKE_BUILD_TYPE)
+   set (CMAKE_BUILD_TYPE Debug
+       CACHE
+       STRING "Choose the build type, options are: None, Debug, Release, RelWithDebInfo, or MinSizeRel."
+       FORCE)
+endif (NOT CMAKE_BUILD_TYPE)
+
+include (CMakeParseArguments)
+
 find_package (OpenGL REQUIRED)
 find_package (GLUT)
 
-find_library (GLEW_glew_LIBRARY GLEW
-       /usr/lib
-)
+find_path (GLEW_INCLUDE_DIR GL/glew.h /usr/include/GL)
+find_library (GLEW_glew_LIBRARY GLEW /usr/lib)
 
-find_path (GLEW_INCLUDE_DIR GL/glew.h
-      /usr/include/GL
-)
+if (NOT WIN32)
+       pkg_check_modules (EGL egl)
+       pkg_check_modules (GLESV1 glesv1_cm)
+       pkg_check_modules (GLESV2 glesv2)
+endif ()
 
 if (UNIX)
        link_libraries(m)
@@ -51,11 +64,15 @@ if (MSVC)
        add_definitions (-wd4244) # conversion' conversion from 'type1' to 'type2', possible loss of data
 endif ()
 
-
-set (APITRACE_BINARY_DIR "${CMAKE_BINARY_DIR}/.." CACHE PATH "apitrace build directory")
-
+if (NOT APITRACE_BINARY_DIR) 
+    set (APITRACE_BINARY_DIR "${CMAKE_BINARY_DIR}/.." CACHE PATH "apitrace build directory")
+endif ()
+if (NOT EXISTS ${APITRACE_BINARY_DIR})
+    message (SEND_ERROR "Invalid APITRACE_BINARY_DIR")
+endif ()
 
 enable_testing()
 
 add_subdirectory (apps)
+add_subdirectory (traces)