Okay, forget all that. Generating an output folder was stupid.
3
.gitignore
vendored
|
@ -3,7 +3,8 @@
|
|||
|
||||
# Misc
|
||||
/obj
|
||||
/build
|
||||
/build_en
|
||||
/build_jp
|
||||
*.dat
|
||||
*.rec
|
||||
build.7z
|
||||
|
|
|
@ -220,11 +220,9 @@ set(RESOURCES
|
|||
|
||||
# Handle options
|
||||
if (JAPANESE)
|
||||
set(FILES_DIR "res/files_jp")
|
||||
list(APPEND RESOURCES "BITMAP/PIXEL_JP.bmp")
|
||||
target_compile_definitions(CSE2 PRIVATE JAPANESE)
|
||||
else()
|
||||
set(FILES_DIR "res/files_en")
|
||||
list(APPEND RESOURCES "BITMAP/PIXEL.bmp")
|
||||
endif()
|
||||
|
||||
|
@ -242,7 +240,7 @@ endif()
|
|||
|
||||
# Make some tweaks if we're targetting Windows
|
||||
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)
|
||||
set_target_properties(CSE2 PROPERTIES WIN32_EXECUTABLE YES) # Disable the console window
|
||||
else()
|
||||
|
@ -252,7 +250,7 @@ endif()
|
|||
# Magic to convert resources to header files
|
||||
add_executable(bin2h src/misc/bin2h.c)
|
||||
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")
|
||||
get_filename_component(DIRECTORY "${FILENAME}" DIRECTORY)
|
||||
add_custom_command(
|
||||
|
@ -274,10 +272,6 @@ if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|||
endif()
|
||||
|
||||
if (MSVC)
|
||||
if (STATIC)
|
||||
message(STATUS "STATIC option doesn't affect MSVC builds")
|
||||
endif()
|
||||
|
||||
# Find dependencies
|
||||
|
||||
# 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_compile_options(CSE2 PRIVATE ${SDL2_CFLAGS_OTHER} ${FREETYPE_CFLAGS_OTHER})
|
||||
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()
|
||||
|
|
25
Makefile
|
@ -8,6 +8,8 @@ else
|
|||
endif
|
||||
|
||||
ifeq ($(JAPANESE), 1)
|
||||
BUILD_DIR = build_jp
|
||||
|
||||
CXXFLAGS += -DJAPANESE
|
||||
|
||||
ifeq ($(RELEASE), 1)
|
||||
|
@ -15,6 +17,8 @@ ifeq ($(JAPANESE), 1)
|
|||
else
|
||||
FILENAME_DEF = debugjp
|
||||
endif
|
||||
else
|
||||
BUILD_DIR = build_en
|
||||
endif
|
||||
|
||||
FILENAME ?= $(FILENAME_DEF)
|
||||
|
@ -200,19 +204,9 @@ ifeq ($(WINDOWS), 1)
|
|||
OBJECTS += obj/$(FILENAME)/win_icon.o
|
||||
endif
|
||||
|
||||
all: build
|
||||
all: $(BUILD_DIR)/$(FILENAME)
|
||||
|
||||
ifeq ($(JAPANESE), 1)
|
||||
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)
|
||||
$(BUILD_DIR)/$(FILENAME): $(OBJECTS)
|
||||
@mkdir -p $(@D)
|
||||
@echo Linking
|
||||
@$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
|
||||
|
@ -228,7 +222,7 @@ obj/$(FILENAME)/Resource.o: src/Resource.cpp $(addprefix src/Resource/, $(addsuf
|
|||
@echo Compiling $<
|
||||
@$(CXX) $(CXXFLAGS) $< -o $@ -c
|
||||
|
||||
src/Resource/%.h: res/resources/% obj/bin2h
|
||||
src/Resource/%.h: res/% obj/bin2h
|
||||
@mkdir -p $(@D)
|
||||
@echo Converting $<
|
||||
@obj/bin2h $< $@
|
||||
|
@ -240,9 +234,10 @@ obj/bin2h: src/misc/bin2h.c
|
|||
|
||||
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)
|
||||
@windres $< $@
|
||||
|
||||
# TODO
|
||||
clean:
|
||||
@rm -rf build obj
|
||||
@rm -rf obj
|
||||
|
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 654 B After Width: | Height: | Size: 654 B |
Before Width: | Height: | Size: 258 B After Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 766 B |
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |