Skip to content

Commit ff1f1e6

Browse files
Andreas Bießmannwilx
authored andcommitted
Merge changes to CMake build system from Andreas Bießmann.
2 parents 19cfb1d + 74992a1 commit ff1f1e6

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

CMakeLists.txt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ set (log4cplus_version_patch 0)
77
set (log4cplus_soversion 0)
88
set (log4cplus_postfix "")
99

10+
option(LOG4CPLUS_BUILD_TESTING "Build the test suite." ON)
11+
1012
find_package (Threads)
1113
message (STATUS "Threads: ${CMAKE_THREAD_LIBS_INIT}")
1214

@@ -40,17 +42,21 @@ set (log4cplus "log4cplus${log4cplus_postfix}")
4042

4143
include(ConfigureChecks.cmake)
4244

43-
configure_file(include/log4cplus/config.h.cmake.in ${CMAKE_BINARY_DIR}/include/log4cplus/config.h @ONLY)
44-
configure_file(include/log4cplus/config/defines.hxx.cmake.in ${CMAKE_BINARY_DIR}/include/log4cplus/config/defines.hxx @ONLY)
45+
configure_file(include/log4cplus/config.h.cmake.in ${log4cplus_BINARY_DIR}/include/log4cplus/config.h @ONLY)
46+
configure_file(include/log4cplus/config/defines.hxx.cmake.in ${log4cplus_BINARY_DIR}/include/log4cplus/config/defines.hxx @ONLY)
4547

46-
include_directories (${CMAKE_SOURCE_DIR}/include
47-
${CMAKE_BINARY_DIR}/include
48+
include_directories (${log4cplus_SOURCE_DIR}/include
49+
${log4cplus_BINARY_DIR}/include
4850
)
4951

50-
enable_testing()
52+
if (LOG4CPLUS_BUILD_TESTING)
53+
enable_testing()
54+
endif (LOG4CPLUS_BUILD_TESTING)
5155

5256
add_subdirectory (src)
5357
add_subdirectory (loggingserver)
54-
add_subdirectory (tests)
58+
if (LOG4CPLUS_BUILD_TESTING)
59+
add_subdirectory (tests)
60+
endif (LOG4CPLUS_BUILD_TESTING)
5561

5662
include(Log4CPlusCPack.cmake)

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,6 @@ install(FILES ../include/log4cplus/thread/syncprims-pub-impl.h
170170
install(FILES ../include/log4cplus/config/macosx.h
171171
../include/log4cplus/config/win32.h
172172
../include/log4cplus/config/windowsh-inc.h
173-
${CMAKE_BINARY_DIR}/include/log4cplus/config/defines.hxx
173+
${log4cplus_BINARY_DIR}/include/log4cplus/config/defines.hxx
174174
DESTINATION include/log4cplus/config )
175175

0 commit comments

Comments
 (0)