Commit 5e0cc695 authored by Davis King's avatar Davis King

Improved how the unit tests build all/source.cpp

parent 3ca48028
......@@ -568,6 +568,11 @@ if (NOT TARGET dlib)
endif () ##### end of if NOT DLIB_ISO_CPP_ONLY ##########################################################
# Allow the unit tests to ask us to compile the all/source.cpp file just to make sure it compiles.
if (DLIB_TEST_COMPILE_ALL_SOURCE_CPP)
ADD_LIBRARY(dlib_all_source_cpp STATIC all/source.cpp)
endif()
# Install the library
if (NOT DLIB_IN_PROJECT_BUILD)
set (LIB_INSTALL_DIR lib CACHE STRING "Install location of libraries (e.g. lib32 or lib64 for multilib installations)")
......
......@@ -9,6 +9,9 @@ cmake_minimum_required(VERSION 2.8.4)
set (target_name dtest)
PROJECT(${target_name})
# compile the dlib/all/source.cpp file into its own object just to make sure it compiles
set(DLIB_TEST_COMPILE_ALL_SOURCE_CPP ON)
include(../cmake)
# This variable contains a list of all the tests we are building
......@@ -177,7 +180,6 @@ TARGET_LINK_LIBRARIES(${target_name} dlib )
if (NOT DLIB_NO_GUI_SUPPORT)
add_subdirectory(gui)
add_subdirectory(examples)
add_subdirectory(all_source)
endif()
#
# This is a CMake makefile. You can find the cmake utility and
# information about it at http://www.cmake.org
#
cmake_minimum_required(VERSION 2.8.4)
set (target_name test_all_source_builds)
PROJECT(${target_name})
include(../../cmake_utils/use_cpp_11.cmake)
ADD_LIBRARY(${target_name} STATIC ../../all/source.cpp)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment