-
Notifications
You must be signed in to change notification settings - Fork 13
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
Enhanced CMake install features #112
base: master
Are you sure you want to change the base?
Conversation
@IMFTool Thanks! Will review. Any chance you can rebase against the HEAD of master? |
regxmllib/CMakeLists.txt
Outdated
project (regxmllibc) | ||
option(BUILD_SHARED_LIB Bool OFF) | ||
|
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.
cmake already defines BUILD_SHARED_LIBS
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.
Introduced for pure convenience when using a CMake GUI, from [1]:
This variable is often added to projects as an option() so that each user of a project can decide if they want to build the project using shared or static libraries
[1] https://cmake.org/cmake/help/v3.5/variable/BUILD_SHARED_LIBS.html
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.
Ok... but it says BUILD_SHARED_LIB
and not BUILD_SHARED_LIBS
.
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.
True, I forgot. It's a locally defined name.
regxmllib/CMakeLists.txt
Outdated
if(BUILD_SHARED_LIB) | ||
set(LIB_TYPE SHARED) | ||
if(WIN32 AND NOT CYGWIN) | ||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) |
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.
Can't this be set for all platforms... or does it cause problems in cygwin?
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.
It's being set specifically for WIN32 DLLs. I did not test with cygwin and have it therefore explicitly excluded.
regxmllib/CMakeLists.txt
Outdated
file(RELATIVE_PATH rel_source ${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/com/ ${source}) | ||
get_filename_component(source_path ${rel_source} DIRECTORY) | ||
string(REPLACE "\\" "/" source_path_msvc "${source_path}") | ||
source_group("${source_path_msvc}" FILES "${source}") | ||
endforeach() | ||
|
||
if(WIN32 AND NOT CYGWIN) | ||
set(DEF_INSTALL_CMAKE_DIR CMake) |
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.
Shouldn't this be set by the user?
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.
The resulting INSTALL_CMAKE_DIR can be edited by the user after configuring the build and before generating the build files. DEF_INSTALL_CMAKE_DIR holds useful default locations.
regxmllib/CMakeLists.txt
Outdated
EXPORT ${PROJECT_NAME}Targets DESTINATION ${INSTALL_LIB_DIR} | ||
) | ||
|
||
foreach ( file ${INC_FILES} ) |
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.
What is the purpose of this portion of the cmake file?
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.
Looping through all include files and installing them with their respective full relative path. lines 81 and 82 are debug output and should be removed, though.
merge with upstream
Features: