random build system tweaking

This commit is contained in:
Perttu Ahola 2011-01-09 17:28:31 +02:00
parent 359e575ba3
commit 56918c0ca4
2 changed files with 20 additions and 15 deletions

@ -14,7 +14,11 @@ set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
# Configuration options # Configuration options
if(WIN32)
set(RUN_IN_PLACE 1 CACHE BOOL "Run directly in source directory structure")
else()
set(RUN_IN_PLACE 0 CACHE BOOL "Run directly in source directory structure") set(RUN_IN_PLACE 0 CACHE BOOL "Run directly in source directory structure")
endif()
set(BUILD_CLIENT 1 CACHE BOOL "Build client") set(BUILD_CLIENT 1 CACHE BOOL "Build client")
set(BUILD_SERVER 1 CACHE BOOL "Build server") set(BUILD_SERVER 1 CACHE BOOL "Build server")
@ -68,6 +72,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}) set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
set(CPACK_PACKAGE_VENDOR "celeron55") set(CPACK_PACKAGE_VENDOR "celeron55")
set(CPACK_PACKAGE_CONTACT "Perttu Ahola <celeron55@gmail.com>")
if(WIN32) if(WIN32)
# For some reason these aren't copied otherwise # For some reason these aren't copied otherwise
@ -87,7 +92,6 @@ if(WIN32)
elseif(APPLE) elseif(APPLE)
# TODO # TODO
# see http://cmake.org/Wiki/CMake:CPackPackageGenerators#Bundle_.28OSX_only.29 # see http://cmake.org/Wiki/CMake:CPackPackageGenerators#Bundle_.28OSX_only.29
# this too http://0xfe.blogspot.com/2006/03/how-os-x-executes-applications.html
# #
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-osx") set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-osx")
set(CPACK_PACKAGE_ICON "") set(CPACK_PACKAGE_ICON "")

@ -5,19 +5,7 @@ if(RUN_IN_PLACE)
add_definitions ( -DRUN_IN_PLACE ) add_definitions ( -DRUN_IN_PLACE )
endif(RUN_IN_PLACE) endif(RUN_IN_PLACE)
if(UNIX) if(WIN32)
# Unix
if(BUILD_CLIENT)
find_package(X11 REQUIRED)
find_package(OpenGL REQUIRED)
find_package(JPEG REQUIRED)
find_package(BZip2 REQUIRED)
find_package(PNG REQUIRED)
endif(BUILD_CLIENT)
find_package(ZLIB REQUIRED)
set(PLATFORM_LIBS -lpthread)
set(CLIENT_PLATFORM_LIBS -lXxf86vm)
elseif(WIN32)
# Windows # Windows
# Surpress some warnings # Surpress some warnings
add_definitions ( /D "_CRT_SECURE_NO_DEPRECATE" /W1 ) add_definitions ( /D "_CRT_SECURE_NO_DEPRECATE" /W1 )
@ -28,6 +16,18 @@ elseif(WIN32)
CACHE PATH "Path to zlibwapi.lib") CACHE PATH "Path to zlibwapi.lib")
set(ZLIB_DLL "${PROJECT_SOURCE_DIR}/../../zlib125dll/dll32/zlibwapi.dll" set(ZLIB_DLL "${PROJECT_SOURCE_DIR}/../../zlib125dll/dll32/zlibwapi.dll"
CACHE PATH "Path to zlibwapi.dll (for installation)") CACHE PATH "Path to zlibwapi.dll (for installation)")
else()
# Unix probably
if(BUILD_CLIENT)
find_package(X11 REQUIRED)
find_package(OpenGL REQUIRED)
find_package(JPEG REQUIRED)
find_package(BZip2 REQUIRED)
find_package(PNG REQUIRED)
endif(BUILD_CLIENT)
find_package(ZLIB REQUIRED)
set(PLATFORM_LIBS -lpthread)
set(CLIENT_PLATFORM_LIBS -lXxf86vm)
endif() endif()
configure_file( configure_file(
@ -121,6 +121,7 @@ if(BUILD_CLIENT)
${CLIENT_PLATFORM_LIBS} ${CLIENT_PLATFORM_LIBS}
) )
endif(BUILD_CLIENT) endif(BUILD_CLIENT)
if(BUILD_SERVER) if(BUILD_SERVER)
add_executable(minetestserver ${minetestserver_SRCS}) add_executable(minetestserver ${minetestserver_SRCS})
target_link_libraries( target_link_libraries(