131 lines
No EOL
3.4 KiB
CMake
131 lines
No EOL
3.4 KiB
CMake
# * NL_LIB_PREFIX (default: $CMAKE_INSTALL_PREFIX/lib)
|
|
# * NL_DRIVER_PREFIX (default: $CMAKE_INSTALL_PREFIX/lib (windows) or $CMAKE_INSTALL_PREFIX/lib/nel)
|
|
SET(EXTERNAL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty" CACHE PATH "3rd party libraries root path.")
|
|
ENDIF(NOT EXTERNAL_PATH)
|
|
|
|
IF(NOT EXTERNAL_INCLUDE_PATH)
|
|
SET(EXTERNAL_INCLUDE_PATH "${EXTERNAL_PATH}/include" CACHE PATH "3rd party libraries include path.")
|
|
ENDIF(NOT EXTERNAL_INCLUDE_PATH)
|
|
|
|
IF(NOT EXTERNAL_LIBRARY_PATH)
|
|
SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib" CACHE PATH "3rd party libraries lib path.")
|
|
ENDIF(NOT EXTERNAL_LIBRARY_PATH)
|
|
|
|
SET(CMAKE_INCLUDE_PATH "${EXTERNAL_INCLUDE_PATH};${CMAKE_INCLUDE_PATH}")
|
|
|
|
PROJECT(NeL CXX C)
|
|
|
|
IF(WITH_STATIC_DRIVERS)
|
|
IF(WIN32)
|
|
ADD_DEFINITIONS(/DNL_STATIC)
|
|
ELSE(WIN32)
|
|
ADD_DEFINITIONS(-DNL_STATIC)
|
|
ENDIF(WIN32)
|
|
ENDIF(WITH_STATIC_DRIVERS)
|
|
|
|
# On Windows we need to find DirectInput for NLMISC.
|
|
# This is how we get events.
|
|
IF(WIN32)
|
|
FIND_PACKAGE(DirectXSDK)
|
|
|
|
# On Win32 we can also build the MAX plugins.
|
|
IF(WITH_MAXPLUGIN)
|
|
FIND_PACKAGE(3dsMaxSDK)
|
|
ENDIF(WITH_MAXPLUGIN)
|
|
ENDIF(WIN32)
|
|
|
|
IF(WITH_3D)
|
|
FIND_PACKAGE(FreeType)
|
|
|
|
IF(WITH_DRIVER_OPENGL)
|
|
FIND_PACKAGE(OpenGL)
|
|
IF(NOT WIN32)
|
|
IF(APPLE)
|
|
FIND_LIBRARY(CARBON NAMES Carbon)
|
|
FIND_LIBRARY(COCOA NAMES Cocoa)
|
|
ELSE(APPLE)
|
|
FIND_PACKAGE(X11)
|
|
FIND_PACKAGE(XF86VidMode)
|
|
FIND_PACKAGE(XRandR)
|
|
ENDIF(APPLE)
|
|
ENDIF(NOT WIN32)
|
|
ENDIF(WITH_DRIVER_OPENGL)
|
|
|
|
IF(WITH_CEGUI)
|
|
FIND_PACKAGE(CEGUI)
|
|
ENDIF(WITH_CEGUI)
|
|
|
|
ENDIF(WITH_3D)
|
|
|
|
IF(WITH_SOUND)
|
|
FIND_PACKAGE(Ogg)
|
|
FIND_PACKAGE(Vorbis)
|
|
|
|
IF(WITH_DRIVER_OPENAL)
|
|
FIND_PACKAGE(OpenAL)
|
|
ENDIF(WITH_DRIVER_OPENAL)
|
|
|
|
IF(WITH_DRIVER_FMOD)
|
|
FIND_PACKAGE(FMOD)
|
|
ENDIF(WITH_DRIVER_FMOD)
|
|
ENDIF(WITH_SOUND)
|
|
|
|
IF(WITH_MFC)
|
|
FIND_PACKAGE(MFC)
|
|
ENDIF(WITH_MFC)
|
|
|
|
IF(WITH_GTK)
|
|
FIND_PACKAGE(GTK2)
|
|
ENDIF(WITH_GTK)
|
|
|
|
IF(WITH_NEL_TESTS)
|
|
FIND_PACKAGE(CppTest)
|
|
|
|
ENABLE_TESTING()
|
|
ADD_TEST(nel_unit_test ${EXECUTABLE_OUTPUT_PATH}/nel_unit_test --html)
|
|
IF(BUILD_DASHBOARD)
|
|
INCLUDE(Dart)
|
|
SET(SVNCOMMAND svn)
|
|
SET(SVNSOURCEDIR http://dev.ryzom.com/svn/trunk/nel)
|
|
SET(GENERATELOGS svn2cl)
|
|
ENDIF(BUILD_DASHBOARD)
|
|
ENDIF(WITH_NEL_TESTS)
|
|
|
|
IF(UNIX)
|
|
SET(prefix ${CMAKE_INSTALL_PREFIX})
|
|
SET(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin)
|
|
SET(libdir "${CMAKE_INSTALL_PREFIX}/lib")
|
|
SET(includedir "${CMAKE_INSTALL_PREFIX}/include")
|
|
SET(enable_ligo ${WITH_LIGO})
|
|
SET(enable_logic ${WITH_LOGIC})
|
|
SET(enable_georges ${WITH_GEORGES})
|
|
SET(enable_net ${WITH_NET})
|
|
SET(enable_3d ${WITH_3D})
|
|
SET(enable_pacs ${WITH_PACS})
|
|
SET(enable_sound ${WITH_SOUND})
|
|
CONFIGURE_FILE(nel-config.in nel-config)
|
|
|
|
INSTALL(PROGRAMS ${CMAKE_BINARY_DIR}/nel-config DESTINATION bin)
|
|
ENDIF(UNIX)
|
|
|
|
IF(WIN32)
|
|
INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
|
|
SET(WINSOCK2_LIB ws2_32.lib)
|
|
ENDIF(WIN32)
|
|
|
|
ADD_SUBDIRECTORY(include)
|
|
# config.h configuration and use by projects
|
|
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
|
|
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
|
|
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
|
|
|
|
ADD_SUBDIRECTORY(src)
|
|
|
|
IF(WITH_NEL_SAMPLES)
|
|
ADD_SUBDIRECTORY(samples)
|
|
ENDIF(WITH_NEL_SAMPLES)
|
|
|
|
IF(WITH_NEL_TOOLS)
|
|
FIND_PACKAGE(Squish)
|
|
ADD_SUBDIRECTORY(tools)
|
|
ENDIF(WITH_NEL_TOOLS) |