Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
0a39006d
Commit
0a39006d
authored
Feb 10, 2013
by
Davis King
Browse files
Simplified cmake scripts
parent
bbfcf255
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
39 deletions
+13
-39
dlib/test/CMakeLists.txt
dlib/test/CMakeLists.txt
+5
-12
dlib/test/gui/CMakeLists.txt
dlib/test/gui/CMakeLists.txt
+2
-7
examples/CMakeLists.txt
examples/CMakeLists.txt
+6
-20
No files found.
dlib/test/CMakeLists.txt
View file @
0a39006d
...
...
@@ -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
)
dlib/test/gui/CMakeLists.txt
View file @
0a39006d
...
...
@@ -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
)
#
a
dd the folder containing the dlib folder to the include path
#
A
dd 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
)
examples/CMakeLists.txt
View file @
0a39006d
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment