-
Notifications
You must be signed in to change notification settings - Fork 417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++ visibility support (take II) #233
Changes from 14 commits
43d6a4e
17a6c33
3fb1525
59e3f2d
c8c6d50
9fa581d
d090a99
268af4c
3751298
22a8fb6
4c9e019
23afecf
956d3a9
3a24d6f
b511676
f98dd43
a232b08
fd81e43
c367a8b
831a13e
2b2478d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,9 @@ project(fcl CXX C) | |
|
||
option(FCL_ENABLE_PROFILING "Enable profiling" OFF) | ||
option(FCL_TREAT_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF) | ||
# Option for some bundle-like build system in order not to expose | ||
# any FCL binary symbols in their public ABI | ||
option(FCL_HIDE_ALL_SYMBOLS "Hide all binary symbols" OFF) | ||
|
||
# set the default build type | ||
if (NOT MSVC AND NOT CMAKE_BUILD_TYPE) | ||
|
@@ -42,6 +45,7 @@ include(FCLMacros) | |
include(CompilerSettings) | ||
include(FCLVersion) | ||
include(GNUInstallDirs) | ||
include(GenerateExportHeader) | ||
|
||
if(MSVC OR IS_ICPC) | ||
option(FCL_STATIC_LIBRARY "Whether the FCL library should be static rather than shared" ON) | ||
|
@@ -229,6 +233,11 @@ else() | |
message(STATUS "FCL does not use OctoMap (as requested)") | ||
endif() | ||
|
||
# Need to include directory to find export file | ||
include_directories(${PROJECT_BINARY_DIR}) | ||
|
||
install(FILES ${PROJECT_BINARY_DIR}/${PROJECT_NAME}_export.h | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we change the export header to simply #include "fcl/export.h" // in FCL code base
#include <fcl/export.h> // in FCL dependent projects. |
||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe FCL installs all the headers under |
||
|
||
# FCL's own include dir should be at the front of the include path | ||
include_directories(BEFORE "include") | ||
|
@@ -261,11 +270,13 @@ add_custom_target(uninstall | |
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/CMakeModules/cmake_uninstall.cmake") | ||
|
||
option(FCL_BUILD_TESTS "Build FCL tests" ON) | ||
if(FCL_BUILD_TESTS) | ||
if(FCL_BUILD_TESTS AND NOT FCL_HIDE_ALL_SYMBOLS) | ||
enable_testing() | ||
add_subdirectory(test) | ||
endif() | ||
|
||
generate_export_header(${PROJECT_NAME}) | ||
|
||
#=============================================================================== | ||
# API documentation using Doxygen | ||
# References: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just learned this very useful CMake utility! 😮