Add config.h generation and wrapper header, currently only for OBS_VERSION

This commit is contained in:
BtbN
2014-04-01 22:11:44 +02:00
parent 04dfcb2dea
commit 044680f0b8
5 changed files with 47 additions and 4 deletions

View File

@@ -17,7 +17,6 @@ include_directories(${Libavformat_INCLUDE_DIR})
add_definitions(${Libavformat_DEFINITIONS})
add_definitions(-DLIBOBS_EXPORTS)
add_definitions(-DPTW32_STATIC_LIB)
if(WIN32)
set(libobs_PLATFORM_SOURCES
@@ -27,6 +26,8 @@ if(WIN32)
set(libobs_PLATFORM_DEPS
w32-pthreads
winmm.lib)
add_definitions(-DPTW32_STATIC_LIB)
elseif(APPLE)
set(libobs_PLATFORM_SOURCES
obs-cocoa.c
@@ -57,6 +58,14 @@ if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHc-")
endif()
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/config.h.in"
"${CMAKE_BINARY_DIR}/config/config.h")
set(libobs_config_HEADERS
config.h
obs-config.h)
set(libobs_callback_SOURCES
callback/calldata.c
callback/decl.c

5
libobs/config.h.in Normal file
View File

@@ -0,0 +1,5 @@
#pragma once
#define OBS_VERSION "@OBS_VERSION@"

27
libobs/obs-config.h Normal file
View File

@@ -0,0 +1,27 @@
/******************************************************************************
Copyright (C) 2014 by Hugh Bailey <obs.jim@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#pragma once
#ifdef HAVE_CONFIG_H
# include "config.h"
#else
#define OBS_VERSION "unknown"
#endif