CMakeLists.txt
cd177a2a
 cmake_minimum_required( VERSION 3.0)
9935b7fb
 
cd177a2a
 project( mulle-vararg C)
e7c0a695
 
9935b7fb
 
95c203dd
 ### mulle-sde environment
cd177a2a
 
95c203dd
 # add cmake module paths to search path
 list( INSERT CMAKE_MODULE_PATH 0 "${PROJECT_SOURCE_DIR}/cmake/share")
 list( INSERT CMAKE_MODULE_PATH 0 "${PROJECT_SOURCE_DIR}/cmake")
cd177a2a
 
95c203dd
 include( Environment)
 
 
 ### Files
 
 include( PreFiles OPTIONAL)
 
 set( MULLE_VARARG_LIBRARY ON)
cd177a2a
 
95c203dd
 #
 # Include all non underscored .cmake files in ./cmake
 #
 file( GLOB LOCAL_CMAKE_INCLUDES
    "cmake/[A-Za-z0-9]*.cmake"
cd177a2a
 )
9935b7fb
 
95c203dd
 foreach( FILE ${LOCAL_CMAKE_INCLUDES} )
    include( "${FILE}")
 endforeach()
 
 
 include_directories( ${INCLUDE_DIRS})
 
 include( PostFiles OPTIONAL)
 
 ### Library
 
 include( PreLibrary OPTIONAL)
9935b7fb
 
95c203dd
 add_library( "mulle-vararg"
 # definitions from cmake/HeadersAndSources.cmake
a05d8ae8
 ${SOURCES}
95c203dd
 ${PUBLIC_HEADERS}
 ${PRIVATE_HEADERS}
 # definitions from cmake/share/Environment.cmake
 ${CMAKE_EDITABLE_FILES}
a05d8ae8
 )
 
9935b7fb
 
95c203dd
 
 if( BUILD_SHARED_LIBS)
    target_link_libraries( mulle-vararg
 # definitions from cmake/share/DependenciesAndLibraries.cmake
aa271def
 ${DEPENDENCY_LIBRARIES}
95c203dd
 ${OS_SPECIFIC_LIBRARIES}
 )
 endif()
 
 include( PostLibrary OPTIONAL)
 
 option( STANDALONE "Create standalone library for debugging" OFF)
 
 set( INSTALL_LIBRARY_TARGETS
 "mulle-vararg"
aa271def
 )
 
95c203dd
 if( STANDALONE)
    set( STANDALONE_BASE_NAME "mulle-vararg")
    set( STANDALONE_NAME "mulle-vararg-standalone")
    set( STANDALONE_DEFINITIONS ${MULLE_VARARG_DEFINITIONS})
    set( STANDALONE_DEPENDENCIES
    mulle-vararg
    )
 
    set( STANDALONE_ALL_LOAD_LIBRARIES
    $<TARGET_FILE:mulle-vararg>
    ${DEPENDENCY_LIBRARIES}
    ${OPTIONAL_DEPENDENCY_LIBRARIES}
    ${OS_SPECIFIC_LIBRARIES}
    )
 
    include( Standalone)
 
    set( INSTALL_LIBRARY_TARGETS
    ${INSTALL_LIBRARY_TARGETS}
    "mulle-vararg-standalone"
    )
 endif()
 
 ### Install
 
 include( PreInstall OPTIONAL)
fde10646
 
95c203dd
 install( TARGETS ${INSTALL_LIBRARY_TARGETS} DESTINATION "lib")
 install( FILES ${PUBLIC_HEADERS}  DESTINATION "include/mulle-vararg")
 install( FILES ${PRIVATE_HEADERS} DESTINATION "include/mulle-vararg/private")
aa271def
 
95c203dd
 # definitions from cmake/share/Environment.cmake
 install( FILES ${CMAKE_INCLUDES}  DESTINATION "include/mulle-vararg/cmake")
417cb7be
 
95c203dd
 # definitions from cmake/share/LinkManifest.cmake
 install( FILES ${LINK_MANIFEST_FILES}  DESTINATION "include/mulle-vararg/link")
aa271def
 
95c203dd
 include( PostInstall OPTIONAL)