Made top level cmake file not build a shared library if part of a subproject.

This commit is contained in:
Davis King 2017-10-29 08:42:02 -04:00
parent 88d8b7c671
commit bc37789144

View File

@ -1,10 +1,15 @@
cmake_minimum_required(VERSION 2.8.12) cmake_minimum_required(VERSION 2.8.12)
# Set this so that the dlib subfolder will build both a static and shared
# library, since the only reason to build this CMakeLists.txt is if you want
# to install dlib. It should be noted however that installing dlib is not get_directory_property(has_parent PARENT_DIRECTORY)
# necessary. A simpler approach is to use it the way shown in if(NOT has_parent)
# examples/CMakeLists.txt # Set this so that the dlib subfolder will build both a static and shared
set(DLIB_IN_PROJECT_BUILD false) # library, since the only reason to build this CMakeLists.txt by itself is
# if you want to install dlib. It should be noted however that installing
# dlib is not necessary. A simpler approach is to use it the way shown in
# examples/CMakeLists.txt
set(DLIB_IN_PROJECT_BUILD false)
endif()
add_subdirectory(dlib) add_subdirectory(dlib)