CMake: properly invoke buildsystems of vendored libraries.

Before this commit, running "make" would build e.g. zlib's tests
and fail because they are not designed to work when zlib is included
as a subproject.

After this commit, EXCLUDE_FROM_ALL, which I did not know about,
prevents any actions from being done by default in these subprojects.
pull/4/head
whitequark 2016-04-22 19:39:23 +00:00
parent ab710f7ed3
commit c6747438e0
1 changed files with 3 additions and 10 deletions

View File

@ -76,13 +76,6 @@ message(STATUS "Using in-tree libdxfrw")
add_subdirectory(extlib/libdxfrw) add_subdirectory(extlib/libdxfrw)
if(WIN32) if(WIN32)
# We don't want any of the subprojects to install anything.
# We don't actually install anything on Windows (so overriding
# this is OK), but the combination of freetype's and png/zlib's
# CMakeLists.txt produces harmless but annoying CMake errors.
macro(install)
endmacro()
# Configure Freetype first. If done later, it will notice that # Configure Freetype first. If done later, it will notice that
# zlib is available, try to use it and promptly break on MSVC # zlib is available, try to use it and promptly break on MSVC
# in a very obscure way. Given that the only use of zlib, bzip2 # in a very obscure way. Given that the only use of zlib, bzip2
@ -93,7 +86,7 @@ if(WIN32)
if(NOT FREETYPE_FOUND) if(NOT FREETYPE_FOUND)
message(STATUS "Using in-tree libfreetype") message(STATUS "Using in-tree libfreetype")
add_subdirectory(extlib/libfreetype) add_subdirectory(extlib/libfreetype EXCLUDE_FROM_ALL)
set(FREETYPE_LIBRARY set(FREETYPE_LIBRARY
freetype) freetype)
@ -106,7 +99,7 @@ if(WIN32)
if(NOT ZLIB_FOUND) if(NOT ZLIB_FOUND)
message(STATUS "Using in-tree zlib") message(STATUS "Using in-tree zlib")
add_subdirectory(extlib/zlib) add_subdirectory(extlib/zlib EXCLUDE_FROM_ALL)
message(STATUS "Using in-tree libpng") message(STATUS "Using in-tree libpng")
set(ZLIB_LIBRARY set(ZLIB_LIBRARY
@ -124,7 +117,7 @@ if(WIN32)
set(SKIP_INSTALL_ALL set(SKIP_INSTALL_ALL
ON) ON)
add_subdirectory(extlib/libpng) add_subdirectory(extlib/libpng EXCLUDE_FROM_ALL)
set(PNG_LIBRARY set(PNG_LIBRARY
png16_static) png16_static)