Skip to content

Commit

Permalink
compilation refactored. Removed custom FindOpenCV. Removed custom CMA…
Browse files Browse the repository at this point in the history
…KE_LIBRARY_PATH and CMAKE_INCLUDE_PATH
  • Loading branch information
libo24 committed Feb 4, 2016
1 parent 506053a commit 6afef7c
Show file tree
Hide file tree
Showing 21 changed files with 62 additions and 402 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -30,6 +30,7 @@
# Editors
.*~
*~
*.sw[a-z]

# Build Folder
build/*
Expand Down
29 changes: 3 additions & 26 deletions CMakeLists.txt
Expand Up @@ -14,30 +14,6 @@ INCLUDE(InstallSettings)


# Libraries
LIST(APPEND CMAKE_LIBRARY_PATH ~/.linuxbrew/lib)
LIST(APPEND CMAKE_LIBRARY_PATH /opt/local/lib)
LIST(APPEND CMAKE_LIBRARY_PATH /opt/local/lib/ufsparse) # Mac OS X
LIST(APPEND CMAKE_LIBRARY_PATH /usr/lib)
LIST(APPEND CMAKE_LIBRARY_PATH /usr/lib/atlas)
LIST(APPEND CMAKE_LIBRARY_PATH /usr/lib/suitesparse) # Ubuntu
LIST(APPEND CMAKE_LIBRARY_PATH /usr/lib64/atlas)
LIST(APPEND CMAKE_LIBRARY_PATH /usr/local/homebrew/lib) # Mac OS X
LIST(APPEND CMAKE_LIBRARY_PATH /usr/local/lib)
LIST(APPEND CMAKE_LIBRARY_PATH /usr/local/lib/suitesparse)
# Headers
LIST(APPEND CMAKE_INCLUDE_PATH ~/.linuxbrew/include)
LIST(APPEND CMAKE_INCLUDE_PATH /opt/local/include)
LIST(APPEND CMAKE_INCLUDE_PATH /opt/local/include/ufsparse) # Mac OS X
LIST(APPEND CMAKE_INCLUDE_PATH /opt/local/var/macports/software/eigen3/opt/local/include/eigen3) # Mac OS X
LIST(APPEND CMAKE_INCLUDE_PATH /usr/include)
LIST(APPEND CMAKE_INCLUDE_PATH /usr/include/eigen3) # Ubuntu 10.04's default location.
LIST(APPEND CMAKE_INCLUDE_PATH /usr/include/suitesparse) # Ubuntu
LIST(APPEND CMAKE_INCLUDE_PATH /usr/local/homebrew/include) # Mac OS X
LIST(APPEND CMAKE_INCLUDE_PATH /usr/local/homebrew/include/eigen3) # Mac OS X
LIST(APPEND CMAKE_INCLUDE_PATH /usr/local/include)
LIST(APPEND CMAKE_INCLUDE_PATH /usr/local/include/eigen3)
LIST(APPEND CMAKE_INCLUDE_PATH /usr/local/include/suitesparse)

set(CAMODOCAL_INCLUDE_INSTALL_PATH "include")
# Library finding
include(LibraryConfig)
Expand Down Expand Up @@ -119,7 +95,7 @@ configure_file(CamOdoCalPathConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/CamOdoCalPat
include_directories(
# External
${EIGEN3_INCLUDE_DIR}
${OPENCV_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}

# All library includes are prefixed with the path to avoid conflicts
${CMAKE_CURRENT_SOURCE_DIR}
Expand All @@ -146,7 +122,7 @@ if(CAMODOCAL_PLATFORM_UNIX)
#set_linker_flags("-Wl,--no-undefined -ldl -lnsl -lm -pthread -lrt" CACHE)
find_package(LibDL)
find_package(Libnsl)
find_package(LibM)
# find_package(LibM)
find_package(Threads)
find_package(Librt)
find_package(Libm)
Expand Down Expand Up @@ -191,6 +167,7 @@ include_directories(
include
)

message("GLOG_FOUND in main" ${GLOG_FOUND})
add_subdirectory(src)

install(DIRECTORY "include/camodocal" DESTINATION ${CAMODOCAL_INCLUDE_INSTALL_PATH})
Expand Down
13 changes: 13 additions & 0 deletions cmake/DependencyUtilities.cmake
Expand Up @@ -6,12 +6,25 @@ macro(camodocal_required_dependency _name)

list(APPEND __required_dependencies ${_name})
set(__required_dependencies ${__required_dependencies} CACHE INTERNAL "list of all required dependencies")
string(TOUPPER ${_name} _name_upper)
if (DEFINED ${_name}_FOUND)
set(${_name_upper}_FOUND ${${_name}_FOUND})
else (DEFINED ${_name}_FOUND)
set(${_name}_FOUND ${${_name_upper}_FOUND})
endif (DEFINED ${_name}_FOUND)

endmacro(camodocal_required_dependency _name)

macro(camodocal_optional_dependency _name)
find_package(${_name})

list(APPEND __optional_dependencies ${_name})
set(__optional_dependencies ${__optional_dependencies} CACHE INTERNAL "list of all optional dependencies")
string(TOUPPER ${_name} _name_upper)
if (DEFINED ${_name}_FOUND)
set(${_name_upper}_FOUND ${${_name}_FOUND})
else (DEFINED ${_name}_FOUND)
set(${_name}_FOUND ${${_name_upper}_FOUND})
endif (DEFINED ${_name}_FOUND)
endmacro(camodocal_optional_dependency _name)

298 changes: 0 additions & 298 deletions cmake/FindOpenCV.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion cmake/LibraryConfig.cmake
Expand Up @@ -84,7 +84,7 @@ endif()

##### Boost #####
# Expand the next statement if newer boost versions than 1.40.0 are released
set(Boost_ADDITIONAL_VERSIONS "1.40" "1.40.0" "1.49" "1.49.0")
# set(Boost_ADDITIONAL_VERSIONS "1.40" "1.40.0" "1.49" "1.49.0")

find_package(Boost 1.40 REQUIRED COMPONENTS filesystem program_options serialization system thread)

Expand Down

0 comments on commit 6afef7c

Please sign in to comment.