Skip to content

Commit

Permalink
Added a simple cmake script users can use to simplify their own CMake…
Browse files Browse the repository at this point in the history
…Lists.txt scripts
  • Loading branch information
davisking committed Feb 10, 2013
1 parent d2cfcb7 commit c7b5b9e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
20 changes: 20 additions & 0 deletions dlib/cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@


# Determine the path to dlib.
string(REPLACE "cmake" "" dlib_path ${CMAKE_CURRENT_LIST_FILE})

if (CMAKE_COMPILER_IS_GNUCXX)
# By default, g++ won't warn or error if you forget to return a value in a
# function which requires you to do so. This option makes it give a warning
# for doing this.
add_definitions("-Wreturn-type")
endif()

# Add folder containing dlib to the include search path.
INCLUDE_DIRECTORIES(${dlib_path}/..)

# This is really optional, but nice. It will make sure the build mode
# created by cmake is always release by default.
include(${dlib_path}/release_build_by_default)

add_subdirectory(${dlib_path} dlib_build)
15 changes: 2 additions & 13 deletions tools/imglab/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,12 @@ ADD_EXECUTABLE(${target_name}
)



# 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)

# Tell cmake to link our target executable to the non-gui version of the dlib
# library.
# Tell cmake to link our target executable dlib.
include(../../dlib/cmake)
TARGET_LINK_LIBRARIES(${target_name} dlib )



INSTALL(TARGETS ${target_name}
RUNTIME DESTINATION bin
)

#set default build type to Release
include(../../dlib/release_build_by_default)

0 comments on commit c7b5b9e

Please sign in to comment.