X-Git-Url: https://git.cworth.org/git?p=apitrace-tests;a=blobdiff_plain;f=CMakeLists.txt;h=0c7c3da0b1ad836caf5abe2fe2d304c8c5deaffb;hp=32c3029ebd9252e0a0726668530bfa0fa6834727;hb=5a03bade408b2288bbf905b0165a5d79002a0f6a;hpb=1902daf4c77939649b15ad49cdecd475c33264c0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 32c3029..0c7c3da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,16 +2,30 @@ 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) + pkg_check_modules (VG vg) +endif () if (UNIX) link_libraries(m) @@ -51,5 +65,15 @@ if (MSVC) add_definitions (-wd4244) # conversion' conversion from 'type1' to 'type2', possible loss of data endif () +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)