File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -21,13 +21,18 @@ set (PACKAGE_TARNAME "${PACKAGE}")
2121set (PACKAGE_VERSION "${VERSION} " )
2222set (PACKAGE_STRING "${PACKAGE} ${VERSION} " )
2323
24- check_function_exists(strlcpy HAVE_STRLCPY)
25- check_function_exists(timegm HAVE_TIMEGM)
26-
27- message ("-- Configuring cmake.h" )
28- configure_file (
29- ${CMAKE_SOURCE_DIR} /cmake.h.in
30- ${CMAKE_SOURCE_DIR} /cmake.h)
24+ if (PROJECT_IS_TOP_LEVEL)
25+ # cmake.h should only be configured if libshared is not used as a CMake subdirectory.
26+ # If libshared is a CMake subdirectory, the top-level project already configures
27+ # cmake.h by itself.
28+ check_function_exists(strlcpy HAVE_STRLCPY)
29+ check_function_exists(timegm HAVE_TIMEGM)
30+
31+ message ("-- Configuring cmake.h" )
32+ configure_file (
33+ ${CMAKE_SOURCE_DIR} /cmake.h.in
34+ ${CMAKE_SOURCE_DIR} /cmake.h)
35+ endif (PROJECT_IS_TOP_LEVEL)
3136
3237add_subdirectory (src)
3338if (EXISTS ${CMAKE_SOURCE_DIR} /test )
You can’t perform that action at this time.
0 commit comments