From dedbec97b0273c91863c15ba0f752904caabc495 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Mon, 21 Sep 2015 12:02:52 -0400 Subject: [PATCH] a better way of disabling symbols --- app/CMakeLists.txt | 4 ++-- openbr/CMakeLists.txt | 8 ++++++-- openbr/openbr_export.h | 22 +++++++++++++--------- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 751cb5f..84896c2 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -1,8 +1,8 @@ # Build the command line interface -add_subdirectory(br) - if(NOT BR_PACKAGE_THIRDPARTY) if(NOT BR_EMBEDDED) + add_subdirectory(br) + # Build examples/tests add_subdirectory(examples) diff --git a/openbr/CMakeLists.txt b/openbr/CMakeLists.txt index a585c90..fa47f0d 100644 --- a/openbr/CMakeLists.txt +++ b/openbr/CMakeLists.txt @@ -53,8 +53,12 @@ install(TARGETS openbr RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) -file(GLOB HEADERS *.h) -install(FILES ${HEADERS} DESTINATION include/openbr) + +if(NOT BR_EMBEDDED) + file(GLOB HEADERS *.h) + install(FILES ${HEADERS} DESTINATION include/openbr) +endif() + include(InstallDependencies) install_compiler_libraries() install_qt_libraries(QT_DEPENDENCIES) diff --git a/openbr/openbr_export.h b/openbr/openbr_export.h index 4bde0f8..54524c8 100644 --- a/openbr/openbr_export.h +++ b/openbr/openbr_export.h @@ -17,17 +17,21 @@ #ifndef OPENBR_EXPORT_H #define OPENBR_EXPORT_H -#if defined BR_LIBRARY -# if defined _WIN32 || defined __CYGWIN__ -# define BR_EXPORT __declspec(dllexport) -# else -# define BR_EXPORT __attribute__((visibility("default"))) -# endif +#if defined BR_EMBEDDED +# define BR_EXPORT #else -# if defined _WIN32 || defined __CYGWIN__ -# define BR_EXPORT __declspec(dllimport) +# if defined BR_LIBRARY +# if defined _WIN32 || defined __CYGWIN__ +# define BR_EXPORT __declspec(dllexport) +# else +# define BR_EXPORT __attribute__((visibility("default"))) +# endif # else -# define BR_EXPORT +# if defined _WIN32 || defined __CYGWIN__ +# define BR_EXPORT __declspec(dllimport) +# else +# define BR_EXPORT +# endif # endif #endif -- libgit2 0.21.4