From baa0b76ef35cc337899f4c92312afe9ca6bde2d1 Mon Sep 17 00:00:00 2001 From: DepthDeluxe Date: Fri, 8 Apr 2016 07:12:56 -0400 Subject: [PATCH] addressed build system issues in PR --- CMakeLists.txt | 2 +- openbr/CMakeLists.txt | 17 +---------------- openbr/plugins/plugins.cmake | 20 +++++++++----------- 3 files changed, 11 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b3a1e15..d068a3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,7 +106,7 @@ endif() # Compiler flags if(UNIX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-strict-overflow -Wno-comment -Wno-unknown-pragmas -fvisibility=hidden -fno-omit-frame-pointer -pthread") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-strict-overflow -Wno-comment -Wno-unknown-pragmas -fvisibility=hidden -fno-omit-frame-pointer") set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib ${_qt5Core_install_prefix}/lib) if(NOT APPLE) if(${CMAKE_CXX_COMPILER} STREQUAL "/opt/intel/bin/icpc") diff --git a/openbr/CMakeLists.txt b/openbr/CMakeLists.txt index 75e3593..610dbb8 100644 --- a/openbr/CMakeLists.txt +++ b/openbr/CMakeLists.txt @@ -29,18 +29,8 @@ if(NOT BR_EMBEDDED) install(FILES ${HEADERS} DESTINATION include/openbr/gui) endif() -# add CUDA compiler flags if CUDA support is enabled -option(BR_WITH_CUDA "Build CUDA-accelerate plugins." OFF) -if (BR_WITH_CUDA) - FIND_PACKAGE(CUDA REQUIRED) - SET(CUDA_SEPARABLE_COMPILATION ON) - SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -arch=sm_20;--compiler-options "-fPIC") - - cuda_add_library(openbr SHARED ${SRC} ${BR_CORE} ${BR_JANUS} ${BR_GUI} ${BR_ICONS} ${BR_THIRDPARTY_SRC} ${BR_RESOURCES} ${NATURALSTRINGCOMPARE_SRC} ${THIRDPARTY_RESOURCES}) -else() # otherwise, build with normal system - add_library(openbr SHARED ${SRC} ${BR_CORE} ${BR_JANUS} ${BR_GUI} ${BR_ICONS} ${BR_THIRDPARTY_SRC} ${BR_RESOURCES} ${NATURALSTRINGCOMPARE_SRC} ${THIRDPARTY_RESOURCES}) -endif() +add_library(openbr SHARED ${SRC} ${BR_CORE} ${BR_JANUS} ${BR_GUI} ${BR_ICONS} ${BR_THIRDPARTY_SRC} ${BR_RESOURCES} ${NATURALSTRINGCOMPARE_SRC} ${THIRDPARTY_RESOURCES}) qt5_use_modules(openbr ${QT_DEPENDENCIES}) set_target_properties(openbr PROPERTIES DEFINE_SYMBOL BR_LIBRARY @@ -48,11 +38,6 @@ set_target_properties(openbr PROPERTIES SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}) target_link_libraries(openbr ${BR_THIRDPARTY_LIBS}) -# include CUDA dependencies -if (BR_WITH_CUDA) - target_link_libraries(openbr ${CUDA_LIBRARIES}) -endif() - add_cppcheck(openbr) # Janus implementation diff --git a/openbr/plugins/plugins.cmake b/openbr/plugins/plugins.cmake index 1e84821..753af30 100644 --- a/openbr/plugins/plugins.cmake +++ b/openbr/plugins/plugins.cmake @@ -12,13 +12,15 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${BR_THIRDPARTY_PLUGINS_DIR}) file(GLOB SUBFILES plugins/*) foreach(FILE ${SUBFILES}) if(IS_DIRECTORY ${FILE}) - # don't add the CUDA directory in plugins folder if we have disabled CUDA - get_filename_component(FILE_NAME ${FILE} NAME) - if (NOT ${BR_WITH_CUDA} AND ${FILE_NAME} STREQUAL "cuda") - continue() + # check to see if there is a cmake file for the folder, if there is, then that + # file should be used to build the contents of the directory + if (EXISTS ${FILE}/module.cmake) + message(STATUS "importing ${FILE}/module.cmake") + include(${FILE}/module.cmake) + else() + message(STATUS "adding ${FILE}") + set(BR_PLUGINS_DIR ${BR_PLUGINS_DIR} ${FILE}) endif() - - set(BR_PLUGINS_DIR ${BR_PLUGINS_DIR} ${FILE}) endif() endforeach() set(BR_PLUGINS_DIR ${BR_PLUGINS_DIR} plugins/) # Remove this when finished with reorg @@ -37,11 +39,7 @@ endforeach() # Collect all source files except for excluded plugins foreach(DIR ${BR_PLUGINS_DIR} ${BR_THIRDPARTY_PLUGINS_DIR}) get_filename_component(DIR_NAME ${DIR} NAME) - if (BR_WITH_CUDA) - file(GLOB PLUGINS ${DIR}/*.cpp ${DIR}/*.cu ${DIR}/*.h) - else() - file(GLOB PLUGINS ${DIR}/*.cpp ${DIR}/*.h) - endif() + file(GLOB PLUGINS ${DIR}/*.cpp ${DIR}/*.h) foreach(PLUGIN ${PLUGINS}) get_filename_component(PLUGIN_NAME ${PLUGIN} NAME) set(EXCLUDE FALSE) -- libgit2 0.21.4