Skip to content

How to modify the output name? #4540

Answered by sebe324
zizhang-qiu asked this question in Q&A
Discussion options

You must be logged in to vote

Hello!
I know I'm responding to this quite late, but I've recently had the same problem, but after some digging I got this to work.
What worked for me was using the Python_add_library function istead of pybind11_add_module.
Link

You can try this:

find_package(Python COMPONENTS Interpreter Development)

Python_add_library(rl_cpp pybind.cc)
target_link_libraries(rl_cpp PRIVATE pybind11::headers)
set_target_properties(rl_cpp PROPERTIES
                                INTERPROCEDURAL_OPTIMIZATION ON
                                CXX_VISIBILITY_PRESET ON
                                VISIBILITY_INLINES_HIDDEN ON
                                OUTPUT_NAME rl_cpp)

Here is the result on my pc:

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@zizhang-qiu
Comment options

@sebe324
Comment options

Answer selected by zizhang-qiu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants