More cmake cleanup

This commit is contained in:
Davis King 2017-10-16 21:36:18 -04:00
parent 6ffdf802ee
commit 38a2846dda
7 changed files with 21 additions and 20 deletions

View File

@ -135,7 +135,7 @@ else()
endif()
# include dlib so we can link against it
include(${CMAKE_CURRENT_LIST_DIR}/../cmake)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/.. dlib_build)
# We put the extra _ on the end of the name just so it's possible to

View File

@ -12,7 +12,7 @@ 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)
add_subdirectory(.. dlib_build)
# This variable contains a list of all the tests we are building
# into the regression test suite.

View File

@ -6,15 +6,15 @@
# create a variable called target_name and set it to the string "test"
set (target_name gui)
PROJECT(${target_name})
project(${target_name})
add_subdirectory(../.. dlib_build)
# add all the cpp files we want to compile to this list. This tells
# cmake that they are part of our target (which is the executable named test)
ADD_EXECUTABLE(${target_name} main.cpp )
add_executable(${target_name} main.cpp )
# Add the folder containing the dlib folder to the include path
INCLUDE_DIRECTORIES(../../..)
# Tell cmake to link our target executable to dlib.
TARGET_LINK_LIBRARIES(${target_name} dlib )
target_link_libraries(${target_name} dlib::dlib )

View File

@ -2,3 +2,4 @@ cmake_minimum_required(VERSION 2.8.12)
add_subdirectory(../../../tools/imglab imglab_build)
add_subdirectory(../../../tools/htmlify htmlify_build)
add_subdirectory(../../../tools/convert_dlib_nets_to_caffe convert_dlib_nets_to_caffe_build)

View File

@ -9,13 +9,13 @@ set (target_name dtoc)
PROJECT(${target_name})
include(../../dlib/cmake)
add_subdirectory(../../dlib dlib_build)
ADD_EXECUTABLE(${target_name}
add_executable(${target_name}
main.cpp
)
TARGET_LINK_LIBRARIES(${target_name} dlib::dlib )
target_link_libraries(${target_name} dlib::dlib )
INSTALL(TARGETS ${target_name}

View File

@ -8,23 +8,23 @@ cmake_minimum_required(VERSION 2.8.12)
# create a variable called target_name and set it to the string "htmlify"
set (target_name htmlify)
PROJECT(${target_name})
project(${target_name})
include(../../dlib/cmake)
add_subdirectory(../../dlib dlib_build)
# add all the cpp files we want to compile to this list. This tells
# cmake that they are part of our target (which is the executable named htmlify)
ADD_EXECUTABLE(${target_name}
add_executable(${target_name}
htmlify.cpp
to_xml.cpp
)
# Tell cmake to link our target executable to dlib.
TARGET_LINK_LIBRARIES(${target_name} dlib::dlib )
target_link_libraries(${target_name} dlib::dlib )
INSTALL(TARGETS ${target_name}
install(TARGETS ${target_name}
RUNTIME DESTINATION bin
)

View File

@ -9,11 +9,11 @@ cmake_minimum_required(VERSION 2.8.12)
set (target_name imglab)
PROJECT(${target_name})
include(../../dlib/cmake)
add_subdirectory(../../dlib dlib_build)
# add all the cpp files we want to compile to this list. This tells
# cmake that they are part of our target (which is the executable named imglab)
ADD_EXECUTABLE(${target_name}
add_executable(${target_name}
src/main.cpp
src/metadata_editor.h
src/metadata_editor.cpp
@ -30,11 +30,11 @@ ADD_EXECUTABLE(${target_name}
# Tell cmake to link our target executable to dlib.
TARGET_LINK_LIBRARIES(${target_name} dlib::dlib )
target_link_libraries(${target_name} dlib::dlib )
INSTALL(TARGETS ${target_name}
install(TARGETS ${target_name}
RUNTIME DESTINATION bin
)
INSTALL(PROGRAMS convert_imglab_paths_to_relative copy_imglab_dataset DESTINATION bin )
install(PROGRAMS convert_imglab_paths_to_relative copy_imglab_dataset DESTINATION bin )