1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
# Project name definition
# --------------------------------------------
project( "kT Engine" )
# --------------------------------------------
# Allow the developer to select if Dynamic or Static libraries are built
# --------------------------------------------
option( BUILD_SHARED_LIBS "Build kT Engine as Shared Libraries" ON )
if( BUILD_SHARED_LIBS )
# User wants to build Dynamic Libraries, so change the LIB_TYPE variable to CMake keyword 'SHARED'
set( kt_lib_type SHARED )
add_definitions( -DKT_BUILDING_LIBRARY -DKT_DYNAMIC )
endif( BUILD_SHARED_LIBS )
# --------------------------------------------
# --------------------------------------------
# Set the output path
# --------------------------------------------
set( LIBRARY_OUTPUT_PATH ../lib/ )
# --------------------------------------------
# Add -d to debug builds
# --------------------------------------------
if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
set( kt_lib_suffix "-d" )
else()
set( kt_lib_suffix "" )
endif( CMAKE_BUILD_TYPE STREQUAL "Debug" )
# --------------------------------------------
# Add -s to the static libs
# --------------------------------------------
if( NOT BUILD_SHARED_LIBS )
set( kt_lib_suffix -s${kt_lib_suffix} )
endif( NOT BUILD_SHARED_LIBS )
# --------------------------------------------
# Add the compiler include / lib paths
# to the default CMake paths
# --------------------------------------------
set(CMAKE_INCLUDE_PATH $CMAKE_INCLUDE_PATH $ENV{INCLUDE})
set(CMAKE_LIBRARY_PATH $CMAKE_LIBRARY_PATH $ENV{LIB})
# --------------------------------------------
# Add the folder to the compilation libraries path
# --------------------------------------------
link_directories( ../lib )
# --------------------------------------------
# Add the folder to the compilation includes path
# --------------------------------------------
include_directories( ../include )
# --------------------------------------------
# Add the core module to the build
# --------------------------------------------
file(
GLOB_RECURSE
core_source_files
../src/kT/Core/*
)
file(
GLOB_RECURSE
core_header_files
../include/kT/Core/*
)
set( ktCoreLibName ktCore${kt_lib_suffix})
add_library(
${ktCoreLibName}
${kt_lib_type}
${core_source_files}
${core_header_files}
) |
Partager