X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=CMakeLists.txt;h=e963be186b02c5a682ccbf0f57ec1eb70e4df546;hb=8b6324900a74e5477cf9df0119de2b981a1b9464;hp=f69714af88f1010536d51f36d3cd8a085411c74a;hpb=accd3917f73ef5e77541d7125041cf8361fbe899;p=apitrace-tests diff --git a/CMakeLists.txt b/CMakeLists.txt index f69714a..e963be1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,16 @@ cmake_minimum_required (VERSION 2.8) project (apitrace-tests) +# 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) @@ -51,9 +61,12 @@ 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()