#------------------------------------------------------------------- # This file is part of the CMake build system for Scol # # The contents of this file are placed in the public domain. Feel # free to make use of it in any way you like. #------------------------------------------------------------------- ###################################################################### # Scol BUILD SYSTEM # Welcome to the CMake build system for Scol. # Inspired from the Ogre build system (modules FindPkgMacros.cmake, # PrecompiledHeader.cmake and PreprocessorUtils.cmake are Ogre's ones) # This is the main file where we prepare the general build environment # and provide build configuration options. ###################################################################### ###################################################################### # What i want is: # * One global visual studio file, preparing all the stuff needed to # generate the installer. # * One visual studio solution file by vm, and one solution file by # plugin. ###################################################################### cmake_minimum_required(VERSION 2.6) cmake_policy(SET CMP0003 NEW) project(Scol) # Include necessary submodules set(CMAKE_MODULE_PATH "${Scol_SOURCE_DIR}/CMake" "${Scol_SOURCE_DIR}/CMake/Utils" "${Scol_SOURCE_DIR}/CMake/Packages" ) # CMake includes: include(CMakeDependentOption) include(CheckCXXCompilerFlag) include(PreprocessorUtils) include(ScolMacroLogFeature) include(ScolConfigTargets) set(Scol_TEMPLATES_DIR "${Scol_SOURCE_DIR}/CMake/Templates") set(Scol_WORK_DIR ${Scol_BINARY_DIR}) ##################################################################### # Set up the basic build environment ##################################################################### if (CMAKE_BUILD_TYPE STREQUAL "") # CMake defaults to leaving CMAKE_BUILD_TYPE empty. This screws up # differentiation between debug and release builds. set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE) endif () # determine Scol version numbers include(ScolGetVersion) scol_get_version(${Scol_SOURCE_DIR}/vm/kernel5/include/common/vscol.h) message(STATUS "Configuring Scol ${Scol_VERSION}") if (NOT APPLE) # Create debug libraries with no postfix set(CMAKE_DEBUG_POSTFIX "") endif () # Set compiler specific build flags if (CMAKE_COMPILER_IS_GNUCXX) # check_cxx_compiler_flag(-msse SCOL_GCC_HAS_SSE) # if (SCOL_GCC_HAS_SSE) # add_definitions(-msse) # endif () endif () if (MSVC) add_definitions(/fp:fast) endif () if (CMAKE_COMPILER_IS_GNUCXX) # Fix x64 issues on Linux if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND NOT APPLE) add_definitions(-fPIC) endif() endif (CMAKE_COMPILER_IS_GNUCXX) # Add Main include path (will be used by plugins, this system replace the original Scol_SDK). include_directories("${Scol_SOURCE_DIR}/vm/kernel5/include/") # Find dependencies include(ScolDependencies) # Specify build paths set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Scol_BINARY_DIR}/lib") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Scol_BINARY_DIR}/lib") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Scol_BINARY_DIR}/bin") if (WIN32 OR APPLE) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) # We don't want to install in default system location, install is really for the SDK, so call it for that set(CMAKE_INSTALL_PREFIX "${Scol_SOURCE_DIR}/../scol_sdk" CACHE PATH "Scol install prefix" FORCE) endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) endif(WIN32 OR APPLE) ###################################################################### # Provide user options to customise the build process ###################################################################### # Customise what to install cmake_dependent_option(Scol_INSTALL_PDB "Install debug pdb files" FALSE "MSVC" FALSE) if (WIN32) cmake_dependent_option(Scol_BUILD_LIB2D_OS "Build Lib 2D OS plugin" TRUE "JPEG_FOUND;PNG_FOUND;ZLIB_FOUND" FALSE) endif () cmake_dependent_option(Scol_BUILD_EMBEDDED_NAVIGATOR "Build embedded navigator plugin, using CEF" TRUE "CEF_FOUND" FALSE) ################################################################### # configure global build settings based on selected build options ################################################################### include(ScolConfigureBuild) ################################################################## # Now setup targets ################################################################## # Setup Scol core project add_subdirectory(vm) # Setup plugins projects add_subdirectory(plugins) if (WIN32) # Setup UsmWin project add_subdirectory(usmwin) endif (WIN32)