Unix

CMakeLists.txt example for static libraries

ForceCore 2010. 3. 5. 13:59
cmake_minimum_required(VERSION 2.4)

set( CMAKE_CXX_FLAGS "-O2" )

include_directories( "${PROJECT_SOURCE_DIR}/.." )
set(LIBRARY_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/release")

add_subdirectory( lib_filter )
add_subdirectory( lib_kernel )
add_subdirectory( lib_maploader )
add_subdirectory( lib_rand )
add_subdirectory( lib_renderer )

In each directories...

ADD_LIBRARY( filter STATIC filter.cpp mat.cpp )

ADD_LIBRARY( kernel STATIC
    Calculator.cpp
    Command.cpp
   ...
)

ADD_LIBRARY( rand STATIC
    boxmuller.c
    r250.c
    randlcg.c
)

etc.