Skip to content
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

Adding library though FetchContent won't work. #357

Open
Wolftein opened this issue Oct 6, 2024 · 7 comments
Open

Adding library though FetchContent won't work. #357

Wolftein opened this issue Oct 6, 2024 · 7 comments

Comments

@Wolftein
Copy link
Contributor

Wolftein commented Oct 6, 2024

I'm getting CMake Error: install(EXPORT "FAudio-targets-shared" ...) includes target "FAudio-shared" which requires target "SDL3-static" that is not in any export set. when using:

SET(XNASONG            OFF)
SET(BUILD_SHARED_LIBS, OFF)
SET(BUILD_SDL3         ON)
SET(SDL3_INCLUDE_DIRS  ${external_sdl_SOURCE_DIR}/include)
SET(SDL3_LIBRARIES     "SDL3-static")

FetchContent_Declare(External_FAudio
        GIT_REPOSITORY https://github.com/FNA-XNA/FAudio)
FetchContent_MakeAvailable(External_FAudio)

TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC "FAudio-static")
@Wolftein
Copy link
Contributor Author

Wolftein commented Oct 6, 2024

If I remove "INSTALL" from CMake then it works.

@flibitijibibo
Copy link
Member

@rkitover, any ideas?

@rkitover
Copy link
Contributor

rkitover commented Oct 6, 2024

I will take a look.

@rkitover
Copy link
Contributor

rkitover commented Oct 7, 2024

@Wolftein Which install() commands did you remove?

@rkitover
Copy link
Contributor

rkitover commented Oct 8, 2024

I should note that FetchContent should be used with EXCLUDE_FROM_ALL to disable the installation of any files from things you are just using as a library, component or whatever. Unless you actually need to install a dll or something.

Also, in a subproject the targets are defined directly in the same CMake session.

If there is an issue here, I need more details. I still can't even test or run anything because of US government ****s.

@xagalvarez
Copy link

I added EXCLUDE_FROM_ALL but still getting an error.

CMake Error: install(EXPORT "FAudio-targets-static" ...) includes target "FAudio-static" which requires target "SDL3-static" that is not in any export set.

@rkitover
Copy link
Contributor

Try this:

add_dependencies(FAudio-static SDL3-static)

. That can be anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants