[cmake-developers] [CMake 0015539]: LIBRARY_OUTPUT_DIRECTORY for MODULE
Mantis Bug Tracker
mantis at public.kitware.com
Wed Apr 29 06:27:36 EDT 2015
The following issue has been SUBMITTED.
======================================================================
http://www.cmake.org/Bug/view.php?id=15539
======================================================================
Reported By: Mathieu Malaterre
Assigned To:
======================================================================
Project: CMake
Issue ID: 15539
Category: CMake
Reproducibility: have not tried
Severity: minor
Priority: normal
Status: new
======================================================================
Date Submitted: 2015-04-29 06:27 EDT
Last Modified: 2015-04-29 06:27 EDT
======================================================================
Summary: LIBRARY_OUTPUT_DIRECTORY for MODULE
Description:
As per documentation for LIBRARY_OUTPUT_DIRECTORY, we have:
$ cmake --help-property LIBRARY_OUTPUT_DIRECTORY
[...]
For DLL platforms the DLL part of a shared library is
treated as a runtime target and the corresponding import library
is treated as an archive target.
[...]
And
$ cmake --help-command add_library
[...]
``MODULE`` libraries are plugins that
are not linked into other targets but may be loaded dynamically at runtime
using dlopen-like functionality.
[...]
However using the following simple demo project:
$ cat foo.c
__declspec( dllexport ) int foo() { return 42; }
$ cat CMakeLists.txt
project(demo)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/dll_part)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib_part)
add_library(foo_shared SHARED foo.c)
add_library(foo_module MODULE foo.c)
After compilation leads to:
$ find . -name \*.dll
./lib_part/foo_module.dll
./dll_part/foo_shared.dll
Which means:
1. Either MODULE is not a library since it's dll part is generated in
`LIBRARY_OUTPUT_DIRECTORY`, which imply the documentation is inaccurate
2. Or MODULE is indeed a library, but there is a bug in cmake where the dll part
of the library is generated in the `LIBRARY_OUTPUT_DIRECTORY` path.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2015-04-29 06:27 Mathieu MalaterreNew Issue
======================================================================
More information about the cmake-developers
mailing list