Commit baa0b76ef35cc337899f4c92312afe9ca6bde2d1
1 parent
e6e3eb93
addressed build system issues in PR
Showing
3 changed files
with
11 additions
and
28 deletions
CMakeLists.txt
| @@ -106,7 +106,7 @@ endif() | @@ -106,7 +106,7 @@ endif() | ||
| 106 | 106 | ||
| 107 | # Compiler flags | 107 | # Compiler flags |
| 108 | if(UNIX) | 108 | if(UNIX) |
| 109 | - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-strict-overflow -Wno-comment -Wno-unknown-pragmas -fvisibility=hidden -fno-omit-frame-pointer -pthread") | 109 | + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-strict-overflow -Wno-comment -Wno-unknown-pragmas -fvisibility=hidden -fno-omit-frame-pointer") |
| 110 | set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib ${_qt5Core_install_prefix}/lib) | 110 | set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib ${_qt5Core_install_prefix}/lib) |
| 111 | if(NOT APPLE) | 111 | if(NOT APPLE) |
| 112 | if(${CMAKE_CXX_COMPILER} STREQUAL "/opt/intel/bin/icpc") | 112 | if(${CMAKE_CXX_COMPILER} STREQUAL "/opt/intel/bin/icpc") |
openbr/CMakeLists.txt
| @@ -29,18 +29,8 @@ if(NOT BR_EMBEDDED) | @@ -29,18 +29,8 @@ if(NOT BR_EMBEDDED) | ||
| 29 | install(FILES ${HEADERS} DESTINATION include/openbr/gui) | 29 | install(FILES ${HEADERS} DESTINATION include/openbr/gui) |
| 30 | endif() | 30 | endif() |
| 31 | 31 | ||
| 32 | -# add CUDA compiler flags if CUDA support is enabled | ||
| 33 | -option(BR_WITH_CUDA "Build CUDA-accelerate plugins." OFF) | ||
| 34 | -if (BR_WITH_CUDA) | ||
| 35 | - FIND_PACKAGE(CUDA REQUIRED) | ||
| 36 | - SET(CUDA_SEPARABLE_COMPILATION ON) | ||
| 37 | - SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -arch=sm_20;--compiler-options "-fPIC") | ||
| 38 | - | ||
| 39 | - cuda_add_library(openbr SHARED ${SRC} ${BR_CORE} ${BR_JANUS} ${BR_GUI} ${BR_ICONS} ${BR_THIRDPARTY_SRC} ${BR_RESOURCES} ${NATURALSTRINGCOMPARE_SRC} ${THIRDPARTY_RESOURCES}) | ||
| 40 | -else() | ||
| 41 | # otherwise, build with normal system | 32 | # otherwise, build with normal system |
| 42 | - add_library(openbr SHARED ${SRC} ${BR_CORE} ${BR_JANUS} ${BR_GUI} ${BR_ICONS} ${BR_THIRDPARTY_SRC} ${BR_RESOURCES} ${NATURALSTRINGCOMPARE_SRC} ${THIRDPARTY_RESOURCES}) | ||
| 43 | -endif() | 33 | +add_library(openbr SHARED ${SRC} ${BR_CORE} ${BR_JANUS} ${BR_GUI} ${BR_ICONS} ${BR_THIRDPARTY_SRC} ${BR_RESOURCES} ${NATURALSTRINGCOMPARE_SRC} ${THIRDPARTY_RESOURCES}) |
| 44 | qt5_use_modules(openbr ${QT_DEPENDENCIES}) | 34 | qt5_use_modules(openbr ${QT_DEPENDENCIES}) |
| 45 | set_target_properties(openbr PROPERTIES | 35 | set_target_properties(openbr PROPERTIES |
| 46 | DEFINE_SYMBOL BR_LIBRARY | 36 | DEFINE_SYMBOL BR_LIBRARY |
| @@ -48,11 +38,6 @@ set_target_properties(openbr PROPERTIES | @@ -48,11 +38,6 @@ set_target_properties(openbr PROPERTIES | ||
| 48 | SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}) | 38 | SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}) |
| 49 | target_link_libraries(openbr ${BR_THIRDPARTY_LIBS}) | 39 | target_link_libraries(openbr ${BR_THIRDPARTY_LIBS}) |
| 50 | 40 | ||
| 51 | -# include CUDA dependencies | ||
| 52 | -if (BR_WITH_CUDA) | ||
| 53 | - target_link_libraries(openbr ${CUDA_LIBRARIES}) | ||
| 54 | -endif() | ||
| 55 | - | ||
| 56 | add_cppcheck(openbr) | 41 | add_cppcheck(openbr) |
| 57 | 42 | ||
| 58 | # Janus implementation | 43 | # Janus implementation |
openbr/plugins/plugins.cmake
| @@ -12,13 +12,15 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${BR_THIRDPARTY_PLUGINS_DIR}) | @@ -12,13 +12,15 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${BR_THIRDPARTY_PLUGINS_DIR}) | ||
| 12 | file(GLOB SUBFILES plugins/*) | 12 | file(GLOB SUBFILES plugins/*) |
| 13 | foreach(FILE ${SUBFILES}) | 13 | foreach(FILE ${SUBFILES}) |
| 14 | if(IS_DIRECTORY ${FILE}) | 14 | if(IS_DIRECTORY ${FILE}) |
| 15 | - # don't add the CUDA directory in plugins folder if we have disabled CUDA | ||
| 16 | - get_filename_component(FILE_NAME ${FILE} NAME) | ||
| 17 | - if (NOT ${BR_WITH_CUDA} AND ${FILE_NAME} STREQUAL "cuda") | ||
| 18 | - continue() | 15 | + # check to see if there is a cmake file for the folder, if there is, then that |
| 16 | + # file should be used to build the contents of the directory | ||
| 17 | + if (EXISTS ${FILE}/module.cmake) | ||
| 18 | + message(STATUS "importing ${FILE}/module.cmake") | ||
| 19 | + include(${FILE}/module.cmake) | ||
| 20 | + else() | ||
| 21 | + message(STATUS "adding ${FILE}") | ||
| 22 | + set(BR_PLUGINS_DIR ${BR_PLUGINS_DIR} ${FILE}) | ||
| 19 | endif() | 23 | endif() |
| 20 | - | ||
| 21 | - set(BR_PLUGINS_DIR ${BR_PLUGINS_DIR} ${FILE}) | ||
| 22 | endif() | 24 | endif() |
| 23 | endforeach() | 25 | endforeach() |
| 24 | set(BR_PLUGINS_DIR ${BR_PLUGINS_DIR} plugins/) # Remove this when finished with reorg | 26 | set(BR_PLUGINS_DIR ${BR_PLUGINS_DIR} plugins/) # Remove this when finished with reorg |
| @@ -37,11 +39,7 @@ endforeach() | @@ -37,11 +39,7 @@ endforeach() | ||
| 37 | # Collect all source files except for excluded plugins | 39 | # Collect all source files except for excluded plugins |
| 38 | foreach(DIR ${BR_PLUGINS_DIR} ${BR_THIRDPARTY_PLUGINS_DIR}) | 40 | foreach(DIR ${BR_PLUGINS_DIR} ${BR_THIRDPARTY_PLUGINS_DIR}) |
| 39 | get_filename_component(DIR_NAME ${DIR} NAME) | 41 | get_filename_component(DIR_NAME ${DIR} NAME) |
| 40 | - if (BR_WITH_CUDA) | ||
| 41 | - file(GLOB PLUGINS ${DIR}/*.cpp ${DIR}/*.cu ${DIR}/*.h) | ||
| 42 | - else() | ||
| 43 | - file(GLOB PLUGINS ${DIR}/*.cpp ${DIR}/*.h) | ||
| 44 | - endif() | 42 | + file(GLOB PLUGINS ${DIR}/*.cpp ${DIR}/*.h) |
| 45 | foreach(PLUGIN ${PLUGINS}) | 43 | foreach(PLUGIN ${PLUGINS}) |
| 46 | get_filename_component(PLUGIN_NAME ${PLUGIN} NAME) | 44 | get_filename_component(PLUGIN_NAME ${PLUGIN} NAME) |
| 47 | set(EXCLUDE FALSE) | 45 | set(EXCLUDE FALSE) |