Skip to content

Commit e696df4

Browse files
committed
cmake: Use cmake's built-in TestForSSTREAM when testing for sstream.
The original test for SSTREAM actually tested for STRSTREAM. Instead of fixing the logic to test for SSTREAM, it seemed easier just to use cmake's built-in macro to perform the test.
1 parent 9188c56 commit e696df4

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

Configure.cmake

+3-10
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@
22
# LOG4CPP_HAVE_SSTREAM
33
###########################################################
44

5-
FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/configure-tryouts/strstream.cpp.in"
6-
"#include <strstream>\n"
7-
"int main()\n"
8-
"{\n"
9-
" std::ostrstream os;\n"
10-
" os.str();\n"
11-
" return 0;\n"
12-
"}")
13-
CONFIGURE_FILE(${CMAKE_CURRENT_BINARY_DIR}/configure-tryouts/strstream.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/configure-tryouts/strstream.cpp)
14-
TRY_COMPILE(LOG4CPP_HAVE_SSTREAM ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/configure-tryouts/strstream.cpp OUTPUT_VARIABLE OUTPUT)
5+
INCLUDE(TestForSSTREAM)
6+
7+
SET (LOG4CPP_HAVE_SSTREAM NOT ${CMAKE_NO_ANSI_STRING_HEADERS})
158

169
###########################################################
1710
# LOG4CPP_HAVE_GETTIMEOFDAY

0 commit comments

Comments
 (0)