generate config.h via CMake.

This commit is contained in:
Kelvin Sherlock 2016-08-09 15:29:10 -04:00
parent 2893f7fe79
commit 0422976719
2 changed files with 22 additions and 1 deletions

View File

@ -1,11 +1,25 @@
# CMAKE_INSTALL_PREFIX defaults to /usr/local.
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.1)
project("mpw-shell")
set (PROJECT_TYPE "CXX")
set (PROJECT_NAME "MPW Shell")
#
# build config.h
#
INCLUDE (CheckFunctionExists)
SET(CMAKE_EXTRA_INCLUDE_FILES stdio.h)
CHECK_FUNCTION_EXISTS(dprintf HAVE_DPRINTF)
SET(CMAKE_EXTRA_INCLUDE_FILES)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
set(CMAKE_CXX_FLAGS "-g -Wall -Wno-unused-variable -Wno-multichar -O1")
if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")

7
config.h.in Normal file
View File

@ -0,0 +1,7 @@
#ifndef __mpw_shell_config_h__
#define __mpw_shell_config_h__
#cmakedefine HAVE_DPRINTF
#endif