Okay, forget all that. Generating an output folder was stupid.

This commit is contained in:
Clownacy 2019-04-14 18:25:12 +01:00
parent 2c8ccc5a0b
commit e2ed9ad950
73 changed files with 14 additions and 41 deletions

3
.gitignore vendored
View file

@ -3,7 +3,8 @@
# Misc # Misc
/obj /obj
/build /build_en
/build_jp
*.dat *.dat
*.rec *.rec
build.7z build.7z

View file

@ -220,11 +220,9 @@ set(RESOURCES
# Handle options # Handle options
if (JAPANESE) if (JAPANESE)
set(FILES_DIR "res/files_jp")
list(APPEND RESOURCES "BITMAP/PIXEL_JP.bmp") list(APPEND RESOURCES "BITMAP/PIXEL_JP.bmp")
target_compile_definitions(CSE2 PRIVATE JAPANESE) target_compile_definitions(CSE2 PRIVATE JAPANESE)
else() else()
set(FILES_DIR "res/files_en")
list(APPEND RESOURCES "BITMAP/PIXEL.bmp") list(APPEND RESOURCES "BITMAP/PIXEL.bmp")
endif() endif()
@ -242,7 +240,7 @@ endif()
# Make some tweaks if we're targetting Windows # Make some tweaks if we're targetting Windows
if (WIN32) if (WIN32)
target_sources(CSE2 PRIVATE "res/resources/ICON/ICON.rc") target_sources(CSE2 PRIVATE "res/ICON/ICON.rc")
target_compile_definitions(CSE2 PRIVATE WINDOWS) target_compile_definitions(CSE2 PRIVATE WINDOWS)
set_target_properties(CSE2 PROPERTIES WIN32_EXECUTABLE YES) # Disable the console window set_target_properties(CSE2 PROPERTIES WIN32_EXECUTABLE YES) # Disable the console window
else() else()
@ -252,7 +250,7 @@ endif()
# Magic to convert resources to header files # Magic to convert resources to header files
add_executable(bin2h src/misc/bin2h.c) add_executable(bin2h src/misc/bin2h.c)
foreach(FILENAME IN LISTS RESOURCES) foreach(FILENAME IN LISTS RESOURCES)
set(IN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/res/resources") set(IN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/res")
set(OUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/Resource") set(OUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/Resource")
get_filename_component(DIRECTORY "${FILENAME}" DIRECTORY) get_filename_component(DIRECTORY "${FILENAME}" DIRECTORY)
add_custom_command( add_custom_command(
@ -274,10 +272,6 @@ if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
endif() endif()
if (MSVC) if (MSVC)
if (STATIC)
message(STATUS "STATIC option doesn't affect MSVC builds")
endif()
# Find dependencies # Find dependencies
# In MSVC we just use our own provided copy of SDL2 and FreeType # In MSVC we just use our own provided copy of SDL2 and FreeType
@ -337,20 +331,3 @@ endif()
target_include_directories(CSE2 PRIVATE ${SDL2_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIRS}) target_include_directories(CSE2 PRIVATE ${SDL2_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIRS})
target_compile_options(CSE2 PRIVATE ${SDL2_CFLAGS_OTHER} ${FREETYPE_CFLAGS_OTHER}) target_compile_options(CSE2 PRIVATE ${SDL2_CFLAGS_OTHER} ${FREETYPE_CFLAGS_OTHER})
target_link_libraries(CSE2 ${SDL2_LIBRARIES} ${FREETYPE_LIBRARIES}) target_link_libraries(CSE2 ${SDL2_LIBRARIES} ${FREETYPE_LIBRARIES})
# Set up the output directory
# Copy the files to the output directory
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/${FILES_DIR}/" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/cavestory")
# Send the Release executable to the directory
set_target_properties(CSE2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_BINARY_DIR}/cavestory")
# On MSVC, copy across SDL2.dll as well
if (MSVC)
if (CMAKE_CL_64)
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/msvc/SDL2/lib/x64/SDL2.dll" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/cavestory")
else()
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/msvc/SDL2/lib/x86/SDL2.dll" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/cavestory")
endif()
endif()

View file

@ -8,6 +8,8 @@ else
endif endif
ifeq ($(JAPANESE), 1) ifeq ($(JAPANESE), 1)
BUILD_DIR = build_jp
CXXFLAGS += -DJAPANESE CXXFLAGS += -DJAPANESE
ifeq ($(RELEASE), 1) ifeq ($(RELEASE), 1)
@ -15,6 +17,8 @@ ifeq ($(JAPANESE), 1)
else else
FILENAME_DEF = debugjp FILENAME_DEF = debugjp
endif endif
else
BUILD_DIR = build_en
endif endif
FILENAME ?= $(FILENAME_DEF) FILENAME ?= $(FILENAME_DEF)
@ -200,19 +204,9 @@ ifeq ($(WINDOWS), 1)
OBJECTS += obj/$(FILENAME)/win_icon.o OBJECTS += obj/$(FILENAME)/win_icon.o
endif endif
all: build all: $(BUILD_DIR)/$(FILENAME)
ifeq ($(JAPANESE), 1) $(BUILD_DIR)/$(FILENAME): $(OBJECTS)
build: res/files_jp obj/$(FILENAME)/$(FILENAME)
else
build: res/files_en obj/$(FILENAME)/$(FILENAME)
endif
@mkdir -p $(@D)
@echo "Copying files to 'build'"
@cp -r $< $@
@cp obj/$(FILENAME)/$(FILENAME) $@
obj/$(FILENAME)/$(FILENAME): $(OBJECTS)
@mkdir -p $(@D) @mkdir -p $(@D)
@echo Linking @echo Linking
@$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS) @$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
@ -228,7 +222,7 @@ obj/$(FILENAME)/Resource.o: src/Resource.cpp $(addprefix src/Resource/, $(addsuf
@echo Compiling $< @echo Compiling $<
@$(CXX) $(CXXFLAGS) $< -o $@ -c @$(CXX) $(CXXFLAGS) $< -o $@ -c
src/Resource/%.h: res/resources/% obj/bin2h src/Resource/%.h: res/% obj/bin2h
@mkdir -p $(@D) @mkdir -p $(@D)
@echo Converting $< @echo Converting $<
@obj/bin2h $< $@ @obj/bin2h $< $@
@ -240,9 +234,10 @@ obj/bin2h: src/misc/bin2h.c
include $(wildcard $(DEPENDENCIES)) include $(wildcard $(DEPENDENCIES))
obj/$(FILENAME)/win_icon.o: res/resources/ICON/ICON.rc res/resources/ICON/0.ico res/resources/ICON/ICON_MINI.ico obj/$(FILENAME)/win_icon.o: res/ICON/ICON.rc res/ICON/0.ico res/ICON/ICON_MINI.ico
@mkdir -p $(@D) @mkdir -p $(@D)
@windres $< $@ @windres $< $@
# TODO
clean: clean:
@rm -rf build obj @rm -rf obj

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 654 B

After

Width:  |  Height:  |  Size: 654 B

View file

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 258 B

View file

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 766 B

View file

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 282 B

View file

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 318 B