libcmaes is a multithreaded C++11 library with Python bindings for high performance blackbox stochastic optimization using the CMA-ES algorithm for Covariance Matrix Adaptation Evolution Strategy
Other
321
stars
78
forks
source link
Issue with CMake when including libcmaes as a subproject #239
I've noticed an issue in the project's CMake configuration: while there are multipleissues reporting the libcmaes/cmaes_export.h: No such file or directory error message if the build instructions for the bundled Makefile setup are not properly followed, I found that this also happens in when building with CMake as a subproject:
The underlying cause is that the cmaes_export.h header is placed under the root (top-level) of the build directory (i.e.build/) and not on the build subdirectory (i.e.build/libcmaes/) which then prompts the failed include.
I'm far from a CMake expert, so there may be an underlying reason for this and better ways to solve this; one "dirty" way for other projects to workaround this to move build/include into build/libcmaes after configuration and before build;
A better option is to replace CMAKE_BINARY_DIR with libcmaes_BINARY_DIR in the line 81 of src/CMakeLists.txt.
In any case I think should either be solved at the source or at the very least addressed in the wiki/docs.
I've noticed an issue in the project's CMake configuration: while there are multiple issues reporting the
libcmaes/cmaes_export.h: No such file or directory
error message if the build instructions for the bundled Makefile setup are not properly followed, I found that this also happens in when building with CMake as a subproject:and included through the
add_subdirectory
command:The underlying cause is that the
cmaes_export.h
header is placed under the root (top-level) of the build directory (i.e.build/
) and not on the build subdirectory (i.e.build/libcmaes/
) which then prompts the failed include.I'm far from a CMake expert, so there may be an underlying reason for this and better ways to solve this; one "dirty" way for other projects to workaround this to move
build/include
intobuild/libcmaes
after configuration and before build; A better option is to replaceCMAKE_BINARY_DIR
withlibcmaes_BINARY_DIR
in the line 81 of src/CMakeLists.txt. In any case I think should either be solved at the source or at the very least addressed in the wiki/docs.