From 2f5b1f2477b269eaf4a09464f3c86c65b78603b4 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Tue, 18 Oct 2011 18:00:00 -0700 Subject: Add a cmake-generated config.h file to hold the private bin directory This directory is named APITRACE_PRIVATE_BIN_DIR and will have a value that depends on the install prefix as follows: /lib/apitrace This is the directory to which private programs will be installed, (that the user needn't execute directly but that the upcoming apitrace wrapper program will execute for the user). --- .gitignore | 1 + CMakeLists.txt | 7 +++++++ config.h.in | 6 ++++++ 3 files changed, 14 insertions(+) create mode 100644 config.h.in diff --git a/.gitignore b/.gitignore index 95b78fe..4d3307b 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ CMakeFiles Makefile build cgltrace.cpp +config.h d3d10trace.cpp d3d8trace.cpp d3d9trace.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index b8e37d6..36fa656 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,9 @@ endif () # prescribed in http://www.gentoo.org/proj/en/qa/automagic.xml set (ENABLE_GUI "AUTO" CACHE STRING "Enable Qt GUI.") +# Directory in which apitrace will install its private binaries +# We don't cache this since the user should just set the install prefix +set (APITRACE_PRIVATE_BIN_DIR ${CMAKE_INSTALL_PREFIX}/lib/apitrace) ############################################################################## # Find dependencies @@ -486,3 +489,7 @@ else () endif () include(CPack) + +# Generate a config.h file so that the source can get at options +configure_file ("${PROJECT_SOURCE_DIR}/config.h.in" + "${PROJECT_BINARY_DIR}/config.h") diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..5fb08a1 --- /dev/null +++ b/config.h.in @@ -0,0 +1,6 @@ +#ifndef APITRACE_CONFIG_H +#define APITRACE_CONFIG_H + +#define APITRACE_PRIVATE_BIN_DIR "@APITRACE_PRIVATE_BIN_DIR@" + +#endif -- cgit v1.2.3