Commit 5f9790852cc6b903431233129f4559c52dbe93bb

Authored by Josh Klontz
1 parent 6e3bec09

disable br command line app and headers in embedded mode

app/br/CMakeLists.txt
1 -if(UNIX)  
2 - find_package(Threads REQUIRED)  
3 -endif()  
4 -  
5 -add_executable(br br.cpp ${BR_RESOURCES})  
6 -target_link_libraries(br openbr ${CMAKE_THREAD_LIBS_INIT})  
7 -qt5_use_modules(br ${QT_DEPENDENCIES}) 1 +if (NOT ${BR_EMBEDDED})
  2 + if (UNIX)
  3 + find_package(Threads REQUIRED)
  4 + endif()
8 5
9 -install(TARGETS br RUNTIME DESTINATION bin)  
10 -add_test(NAME br_initialize WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND br) 6 + add_executable(br br.cpp ${BR_RESOURCES})
  7 + target_link_libraries(br openbr ${CMAKE_THREAD_LIBS_INIT})
  8 + qt5_use_modules(br ${QT_DEPENDENCIES})
11 9
  10 + install(TARGETS br RUNTIME DESTINATION bin)
  11 + add_test(NAME br_initialize WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND br)
  12 +endif()
openbr/CMakeLists.txt
@@ -21,7 +21,7 @@ if(BR_WITH_JANUS) @@ -21,7 +21,7 @@ if(BR_WITH_JANUS)
21 endif() 21 endif()
22 22
23 # Optional GUI module 23 # Optional GUI module
24 -if(NOT BR_EMBEDDED) 24 +if (NOT ${BR_EMBEDDED})
25 aux_source_directory(gui BR_GUI) 25 aux_source_directory(gui BR_GUI)
26 qt5_add_resources(BR_ICONS ../share/openbr/icons.qrc) 26 qt5_add_resources(BR_ICONS ../share/openbr/icons.qrc)
27 file(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/gui/*.h) 27 file(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/gui/*.h)
@@ -31,13 +31,16 @@ endif() @@ -31,13 +31,16 @@ endif()
31 add_library(openbr SHARED ${SRC} ${BR_CORE} ${BR_JANUS} ${BR_GUI} ${BR_ICONS} ${BR_THIRDPARTY_SRC} ${BR_RESOURCES} ${NATURALSTRINGCOMPARE_SRC}) 31 add_library(openbr SHARED ${SRC} ${BR_CORE} ${BR_JANUS} ${BR_GUI} ${BR_ICONS} ${BR_THIRDPARTY_SRC} ${BR_RESOURCES} ${NATURALSTRINGCOMPARE_SRC})
32 qt5_use_modules(openbr ${QT_DEPENDENCIES}) 32 qt5_use_modules(openbr ${QT_DEPENDENCIES})
33 set_target_properties(openbr PROPERTIES 33 set_target_properties(openbr PROPERTIES
34 - DEFINE_SYMBOL BR_LIBRARY  
35 VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} 34 VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
36 SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR} 35 SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}
37 LINK_INTERFACE_LIBRARIES "") 36 LINK_INTERFACE_LIBRARIES "")
38 target_link_libraries(openbr ${BR_THIRDPARTY_LIBS}) 37 target_link_libraries(openbr ${BR_THIRDPARTY_LIBS})
39 add_cppcheck(openbr) 38 add_cppcheck(openbr)
40 39
  40 +if (NOT ${BR_EMBEDDED})
  41 + set_target_properties(openbr PROPERTIES DEFINE_SYMBOL BR_LIBRARY)
  42 +endif()
  43 +
41 # Janus implementation 44 # Janus implementation
42 if(BR_WITH_JANUS) 45 if(BR_WITH_JANUS)
43 set(JANUS_BUILD_PP5_WRAPPER ${BR_WITH_PP5} CACHE BOOL "Build Janus implementation using PittPatt 5") 46 set(JANUS_BUILD_PP5_WRAPPER ${BR_WITH_PP5} CACHE BOOL "Build Janus implementation using PittPatt 5")
@@ -53,8 +56,12 @@ install(TARGETS openbr @@ -53,8 +56,12 @@ install(TARGETS openbr
53 RUNTIME DESTINATION bin 56 RUNTIME DESTINATION bin
54 LIBRARY DESTINATION lib 57 LIBRARY DESTINATION lib
55 ARCHIVE DESTINATION lib) 58 ARCHIVE DESTINATION lib)
56 -file(GLOB HEADERS *.h)  
57 -install(FILES ${HEADERS} DESTINATION include/openbr) 59 +
  60 +if (NOT ${BR_EMBEDDED})
  61 + file(GLOB HEADERS *.h)
  62 + install(FILES ${HEADERS} DESTINATION include/openbr)
  63 +endif()
  64 +
58 include(InstallDependencies) 65 include(InstallDependencies)
59 install_compiler_libraries() 66 install_compiler_libraries()
60 install_qt_libraries(QT_DEPENDENCIES) 67 install_qt_libraries(QT_DEPENDENCIES)