mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Simplified cmake scripts
This commit is contained in:
parent
bbfcf2557b
commit
0a39006dea
@ -142,26 +142,19 @@ PROJECT(${target_name})
|
||||
# cmake that they are part of our target (which is the executable named test)
|
||||
ADD_EXECUTABLE(${target_name} main.cpp tester.cpp ${tests})
|
||||
|
||||
# add the folder containing the dlib folder to the include path
|
||||
INCLUDE_DIRECTORIES(../..)
|
||||
|
||||
# Turn on all warnings when using gcc.
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_definitions("-W -Wall")
|
||||
endif()
|
||||
|
||||
# There is a CMakeLists.txt file in the dlib source folder that tells cmake
|
||||
# how to build the dlib library. Tell cmake about that file.
|
||||
add_subdirectory(.. dlib_build)
|
||||
|
||||
# Tell cmake to link our target executable to dlib.
|
||||
include(../cmake)
|
||||
TARGET_LINK_LIBRARIES(${target_name} dlib )
|
||||
|
||||
|
||||
if (NOT DLIB_NO_GUI_SUPPORT)
|
||||
add_subdirectory(gui)
|
||||
endif()
|
||||
|
||||
# Tell cmake to link our target executable to the non-gui version of the dlib
|
||||
# library.
|
||||
TARGET_LINK_LIBRARIES(${target_name} dlib )
|
||||
|
||||
# make the default build be in "Release" mode
|
||||
include(../release_build_by_default)
|
||||
|
||||
|
@ -12,14 +12,9 @@ PROJECT(${target_name})
|
||||
# cmake that they are part of our target (which is the executable named test)
|
||||
ADD_EXECUTABLE(${target_name} main.cpp )
|
||||
|
||||
# add the folder containing the dlib folder to the include path
|
||||
# Add the folder containing the dlib folder to the include path
|
||||
INCLUDE_DIRECTORIES(../../..)
|
||||
|
||||
# There is a CMakeLists.txt file in the dlib source folder that tells cmake
|
||||
# how to build the dlib library. Tell cmake about that file.
|
||||
|
||||
|
||||
# Tell cmake to link our target executable to the non-gui version of the dlib
|
||||
# library.
|
||||
# Tell cmake to link our target executable to dlib.
|
||||
TARGET_LINK_LIBRARIES(${target_name} dlib )
|
||||
|
||||
|
@ -4,30 +4,16 @@
|
||||
#
|
||||
|
||||
|
||||
# setting this makes CMake allow normal looking IF ELSE statements
|
||||
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||
cmake_minimum_required(VERSION 2.4)
|
||||
if(COMMAND cmake_policy)
|
||||
cmake_policy(SET CMP0003 NEW)
|
||||
endif()
|
||||
|
||||
|
||||
#set default build type to Release
|
||||
include(../dlib/release_build_by_default)
|
||||
|
||||
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
PROJECT(examples)
|
||||
|
||||
# add the folder containing the dlib folder to the include path
|
||||
INCLUDE_DIRECTORIES(..)
|
||||
|
||||
|
||||
# There is a CMakeLists.txt file in the dlib source folder that tells cmake
|
||||
# how to build the dlib library. Tell cmake about that file.
|
||||
add_subdirectory(../dlib dlib_build)
|
||||
|
||||
include(../dlib/cmake)
|
||||
|
||||
# We are going to use a macro to add all the example programs. However,
|
||||
# usually you will only create one executable in your cmake projects.
|
||||
# Therefore, you would just need to invoke ADD_EXECUTABLE() and
|
||||
# TARGET_LINK_LIBRARIES() as shown below.
|
||||
MACRO(add_example name)
|
||||
ADD_EXECUTABLE(${name} ${name}.cpp)
|
||||
TARGET_LINK_LIBRARIES(${name} dlib )
|
||||
|
Loading…
Reference in New Issue
Block a user