Skip to content

Commit

Permalink
generate config.h
Browse files Browse the repository at this point in the history
  • Loading branch information
tokuhirom committed Jul 13, 2012
1 parent 773da55 commit fb6fbf9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
SET(CMAKE_CXX_COMPILER "clang++")
SET(CMAKE_C_COMPILER "clang")
SET(CMAKE_CC_FLAGS "-L.")
SET(CMAKE_CXX_FLAGS "-std=c++0x -L.")
SET(CMAKE_CXX_FLAGS_RELEASE "-Wall -Wno-sign-compare -fstack-protector -fPIC -O2")
SET(CMAKE_CXX_FLAGS_DEBUG "-g")
Expand All @@ -23,7 +24,10 @@ endif ()

find_package(RE2C REQUIRED)

SET(TORA_VERSION "0.0.5")
SET(TORA_VERSION_STR "0.0.5")
SET(TORA_CCFLAGS "${CMAKE_CC_FLAGS}")
SET(TORA_CXXFLAGS "${CMAKE_CXX_FLAGS}")
SET(TORA_PREFIX "${CMAKE_INSTALL_PREFIX}")

CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/tora/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/tora/config.h)

Expand Down Expand Up @@ -107,7 +111,7 @@ foreach(f ${TEST_CC_FILES})
"${_output}"
"${f}"
)
TARGET_LINK_LIBRARIES("${_output}" "tora" ${libs} dl)
TARGET_LINK_LIBRARIES("${_output}" libtora_a ${libs} dl)
endforeach(f)

# test settings
Expand Down
5 changes: 4 additions & 1 deletion tora/config.h.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#ifndef TORA_CONFIG_H_
#define TORA_CONFIG_H_

#cmakedefine TORA_VERSION "@TORA_VERSION@"
#cmakedefine TORA_VERSION_STR "@TORA_VERSION_STR@"
#cmakedefine TORA_CCFLAGS "@TORA_CCFLAGS@"
#cmakedefine TORA_CXXFLAGS "@TORA_CXXFLAGS@"
#cmakedefine TORA_PREFIX "@TORA_PREFIX@"

#endif // TORA_CONFIG_H_

0 comments on commit fb6fbf9

Please sign in to comment.