X-Git-Url: https://git.jsancho.org/?p=lugaru.git;a=blobdiff_plain;f=CMakeLists.txt;h=f65500d8c1ce7f86488d5f787aef7a70dd31aeb4;hp=3958eeb13af76467166d43e2713437d941a83ce2;hb=refs%2Fheads%2Fimprovements;hpb=a09b7f8c367dd9dabae2eeac9032217cfc6f901a diff --git a/CMakeLists.txt b/CMakeLists.txt index 3958eeb..f65500d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,11 +16,33 @@ if(UNIX AND NOT APPLE) endif() +### CMake config + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE RelWithDebInfo) +endif(NOT CMAKE_BUILD_TYPE) +message(STATUS "CMake build type: ${CMAKE_BUILD_TYPE}") + +set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-parentheses -pedantic --std=gnu++11 ${CMAKE_CXX_FLAGS}") + +if(APPLE) + set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX") + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING + "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value") + set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.11.sdk" CACHE PATH + "The product will be built against the headers and libraries located inside the indicated SDK.") +endif(APPLE) + +if(LINUX) + option(SYSTEM_INSTALL "Enable system-wide installation, with hardcoded data directory defined with CMAKE_INSTALL_DATADIR" OFF) +endif(LINUX) + + ### Version # Version for the current (stable) or next (development) release set(LUGARU_VERSION_MAJOR 1) -set(LUGARU_VERSION_MINOR 2) +set(LUGARU_VERSION_MINOR 3) set(LUGARU_VERSION_PATCH 0) # MAJOR.MINOR, or MAJOR.MINOR.PATCH if PATCH != 0 @@ -30,8 +52,8 @@ if(LUGARU_VERSION_PATCH) endif() # Set to "" for stable (tagged) builds, "-dev" for dev builds -#set(LUGARU_VERSION_SUFFIX "-dev") # development -set(LUGARU_VERSION_SUFFIX "") # stable +set(LUGARU_VERSION_SUFFIX "-dev") # development +#set(LUGARU_VERSION_SUFFIX "") # stable # Set to 7-char git commit hash if available, otherwise "". # On stable (tagged) builds, this is ignored. @@ -65,30 +87,6 @@ message(STATUS "Version string: ${LUGARU_VERSION_STRING}") configure_file(${SRCDIR}/Version.hpp.in ${SRCDIR}/Version.hpp ESCAPE_QUOTES @ONLY) -### CMake config - -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE RelWithDebInfo) -endif(NOT CMAKE_BUILD_TYPE) -message(STATUS "CMake build type: ${CMAKE_BUILD_TYPE}") - -set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-parentheses -pedantic --std=gnu++11 ${CMAKE_CXX_FLAGS}") - -if(APPLE) - set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX") - set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING - "Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value") - set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.11.sdk" CACHE PATH - "The product will be built against the headers and libraries located inside the indicated SDK.") -endif(APPLE) - -if(LINUX) - option(SYSTEM_INSTALL "Enable system-wide installation, with hardcoded data directory defined with CMAKE_INSTALL_DATADIR" OFF) -endif(LINUX) - -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake/Modules/") - - ### Sources set(LUGARU_SRCS @@ -219,22 +217,20 @@ endif(APPLE) find_package(PNG REQUIRED) find_package(JPEG REQUIRED) -find_package(ZLIB REQUIRED) -find_package(OggVorbis REQUIRED) + +pkg_check_modules(VORBISFILE vorbisfile REQUIRED) include_directories( ${OPENAL_INCLUDE_DIR} ${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} - ${ZLIB_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ${SDL2_INCLUDE_DIRS} ${VORBISFILE_INCLUDE_DIR} - ${OGG_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/Source ) -set(LUGARU_LIBS ${OPENAL_LIBRARY} ${PNG_LIBRARY} ${JPEG_LIBRARY} ${ZLIB_LIBRARIES} ${SDL2_LIBRARIES} ${OPENGL_LIBRARIES} ${VORBISFILE_LIBRARY} ${OGG_LIBRARY} ${PLATFORM_LIBS}) +set(LUGARU_LIBS ${OPENAL_LIBRARY} ${PNG_LIBRARY} ${JPEG_LIBRARY} ${SDL2_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${VORBISFILE_LIBRARIES} ${PLATFORM_LIBS}) ### Definitions