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

Lasted cmake (3.24.2) did not genereate xxx.self target in the makefile. #215

Closed
YuriSizuku opened this issue Sep 15, 2022 · 4 comments
Closed

Comments

@YuriSizuku
Copy link

I used vita_create_self(${PROJECT_NAME}.self ${PROJECT_NAME}) in this cmake file.

The command is cmake .. -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="$VITASDK/share/vita.toolchain.cmake" to generate makefile.
It seems that the lasted cmake generated the target xxx.self-self instaed of xxx.self.

old cmake (3.19.5) has onsjh.self

#=============================================================================
# Target rules for targets named onsjh.self

# Build rule for target.
onsjh.self: cmake_check_build_system
	$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 onsjh.self
.PHONY : onsjh.self

# fast build rule for target.
onsjh.self/fast:
	$(MAKE) $(MAKESILENT) -f CMakeFiles/onsjh.self.dir/build.make CMakeFiles/onsjh.self.dir/build
.PHONY : onsjh.self/fast

but the new cmake (3.24.2) changes to onsjh.self-self target.

#=============================================================================
# Target rules for targets named onsjh.self-self

# Build rule for target.
onsjh.self-self: cmake_check_build_system
	$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 onsjh.self-self
.PHONY : onsjh.self-self

# fast build rule for target.
onsjh.self-self/fast:
	$(MAKE) $(MAKESILENT) -f CMakeFiles/onsjh.self-self.dir/build.make CMakeFiles/onsjh.self-self.dir/build
.PHONY : onsjh.self-self/fast

Here's my vita project https://github.com/YuriSizuku/psv-OnscripterJH

@isage
Copy link
Contributor

isage commented Sep 15, 2022

Isn't a bug. That was done to support BYPRODUCTS in newer cmake

@YuriSizuku
Copy link
Author

Isn't a bug. That was done to support BYPRODUCTS in newer cmake

Thank you for your replay.

If I want to build the vpk which depends on some self files in the sub directory, I used DEPENDS onsjh.self onsjh_vitagui.self before. Is there any way to add these denpends in compatible with the newer cmake ?

I think just simply changes the DEPENDS to xxx.self-self is not a good method for compability reason.

add_custom_target(vpk
  echo "prepare for making ${PROJECT_NAME}.vpk ..."
  COMMAND vita-mksfoex -s APP_VER=${VITA_VERSION} -s TITLE_ID=${VITA_TITLEID} ${VITA_APP_NAME} ${CMAKE_CURRENT_BINARY_DIR}/param.sfo
  COMMAND vita-pack-vpk ${VITA_PACK_ARGS} ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.vpk
  DEPENDS onsjh.self onsjh_vitagui.self
)

@isage
Copy link
Contributor

isage commented Sep 15, 2022

You can branch based on cmake version (if(${CMAKE_VERSION} VERSION_LESS "3.20.0")) and use self for old cmake, self-self for new.

@YuriSizuku
Copy link
Author

You can branch based on cmake version (if(${CMAKE_VERSION} VERSION_LESS "3.20.0")) and use self for old cmake, self-self for new.

Thank you very much. This method works for both cmake.

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

2 participants