diff --git a/CMakeLists.txt b/CMakeLists.txt index 1dd067ab..40ab3981 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,15 +31,23 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") add_compile_options(-Wno-pointer-bool-conversion) endif() -set(TARGET_ARCH_SUFFIX ${TARGET_ARCH}) +IF("${TARGET_ARCH}" STREQUAL "x86_64") + set(TARGET_ARCH_SUFFIX "x64") +ELSEIF("${TARGET_ARCH}" STREQUAL "i386") + set(TARGET_ARCH_SUFFIX "x86") +ELSEIF("${TARGET_ARCH}" MATCHES "arm(.*)") + set(TARGET_ARCH_SUFFIX "arm") +ELSE() + set(TARGET_ARCH_SUFFIX ${TARGET_ARCH}) +ENDIF() -message(STATUS "Architecture detected: ${TARGET_ARCH}") +message(STATUS "Architecture detected: ${TARGET_ARCH}, suffix set to ${TARGET_ARCH_SUFFIX}") IF(WIN32) set(TARGET_PLATFORM_PREFIX "") message(STATUS "Using Win32 naming convention") ELSEIF(UNIX) - set(TARGET_PLATFORM_PREFIX "f") + set(TARGET_PLATFORM_PREFIX "") message(STATUS "Using Unix naming convention") ELSE() set(TARGET_PLATFORM_PREFIX "") @@ -76,7 +84,7 @@ set_property(TARGET fgame PROPERTY CXX_STANDARD 17) set_target_properties(fgame PROPERTIES PREFIX "${TARGET_PLATFORM_PREFIX}") set_target_properties(fgame PROPERTIES OUTPUT_NAME "game${TARGET_ARCH_SUFFIX}") set_target_properties(fgame PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TARGET_BASE_GAME}") -INSTALL(TARGETS fgame DESTINATION $/bin/${TARGET_BASE_GAME}) +INSTALL(TARGETS fgame DESTINATION "${TARGET_BASE_GAME}") ## Client game library ## TODO! Build the cgame shared library @@ -166,5 +174,5 @@ if(WIN32) target_link_libraries(omohaaded winmm) endif() -INSTALL(TARGETS omohaaded DESTINATION $/bin) +INSTALL(TARGETS omohaaded DESTINATION "./") diff --git a/code/sys/sys_main.c b/code/sys/sys_main.c index 74482a91..186223fd 100644 --- a/code/sys/sys_main.c +++ b/code/sys/sys_main.c @@ -649,7 +649,7 @@ void Sys_ParseArgs( int argc, char **argv ) # ifdef __APPLE__ # define DEFAULT_BASEDIR Sys_StripAppBundle(Sys_BinaryPath()) # else -# define DEFAULT_BASEDIR Sys_BinaryPath() +# define DEFAULT_BASEDIR Sys_Cwd() # endif #endif diff --git a/code/sys/sys_unix.c b/code/sys/sys_unix.c index 9ba0c90a..365eb2df 100644 --- a/code/sys/sys_unix.c +++ b/code/sys/sys_unix.c @@ -437,7 +437,7 @@ char **Sys_ListFiles( const char *directory, const char *extension, const char * // search nfiles = 0; - + if ((fdir = opendir(directory)) == NULL) { *numfiles = 0; return NULL;