CMakeLists.txt
8cde11d7
 cmake_minimum_required (VERSION 3.0)
 
f4e722f6
 project( MulleScion C)
8cde11d7
 
f4e722f6
 # 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")
27dc2200
 
b22b6908
 include( Environment OPTIONAL)
8cde11d7
 
b22b6908
 set( CMAKE_EDITABLE_FILES
    CMakeLists.txt
    cmake/HeadersAndSources.cmake
    cmake/DependenciesAndLibraries.cmake
dda12564
 )
 
b22b6908
 include( PreFiles OPTIONAL)
 
 include( HeadersAndSources )
 include( DependenciesAndLibraries)
 
8cde11d7
 set( HEADERS
 ${MULLE_SCION_HEADERS}
 ${MULLE_SCION_FOUNDATION_HEADERS}
 ${MULLE_SCION_PARSER_HEADERS}
 ${MULLE_SCION_PRINTER_HEADERS}
 )
 
b22b6908
 include( PostFiles OPTIONAL)
 
1bd1fc1b
 set( PROJECT_VERSION 1859.1.1)
f5ba98cf
 
 add_definitions( -DPROJECT_VERSION={PROJECT_VERSION})
8cde11d7
 
b22b6908
 message( STATUS "CMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}")
 message( STATUS "CMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}")
 
 if( ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(MulleClang)$")
    set( OBJC_COVERAGE_OPTIMIZED_LIBS OFF)
    set( CREATE_OBJC_LOADER_INC OFF)
 endif()
 
 ### Library
 
8cde11d7
 
b22b6908
 set( LIBRARY_SOURCES
d5423eed
 ${MULLE_SCION_SOURCES}
 ${MULLE_SCION_FOUNDATION_SOURCES}
 ${MULLE_SCION_PARSER_SOURCES}
 ${MULLE_SCION_PRINTER_SOURCES}
8cde11d7
 ${GOOGLE_TOOLBOX_SOURCES}
 ${HOEDOWN_SOURCES}
9a10bab1
 ${HEADERS}
b22b6908
 cmake/HeadersAndSources.cmake
8cde11d7
 )
 
b22b6908
 include( PreLibrary OPTIONAL)
 include( Library )
f4e722f6
 include( PostLibrary OPTIONAL)
 
 
b22b6908
 ### Executable
8cde11d7
 
b22b6908
 set( EXECUTABLE_NAME mulle-scion)
 set( EXECUTABLE_SOURCES ${TOOL_SOURCES}
d5423eed
 ${MONGOOSE_SOURCES}
8cde11d7
 )
 
b22b6908
 if( APPLE)
    set( EXECUTABLE_LIBRARY_LIST
       ${EXECUTABLE_LIBRARY_LIST}
       -ObjC
    )
 
    set( EXECUTABLE_LIBRARY_LIST
       ${EXECUTABLE_LIBRARY_LIST}
       $<TARGET_FILE:${LIBRARY_NAME}>
       ${FOUNDATION_LIBRARY}
    )
 else()
    set( ALL_LOAD_DEPENDENCY_LIBRARIES
       $<TARGET_FILE:${LIBRARY_NAME}>
       ${ALL_LOAD_DEPENDENCY_LIBRARIES}
    )
 endif()
 
 
 set( EXECUTABLE_DEPENDENCY_NAMES
 MulleScion
f4e722f6
 )
 
b22b6908
 include( PreExecutable OPTIONAL)
 include( Executable )
f4e722f6
 include( PostExecutable OPTIONAL)
8cde11d7
 
b22b6908
 if( APPLE)
    target_link_libraries( "${EXECUTABLE_NAME}"
       -lz
    )
 endif()
 
9a10bab1
 
f4e722f6
 include( PreInstall OPTIONAL)
8cde11d7
 
d5423eed
 # INSTALL( TARGETS MulleScion DESTINATION "lib")
 # INSTALL( FILES ${HEADERS} DESTINATION "include/MulleScion")
8cde11d7
 
 INSTALL( TARGETS mulle-scion DESTINATION "bin")
1c36bfd4
 INSTALL( FILES ${SCIONS} ${PLISTS} DESTINATION "share/mulle-scion/dox")
d5423eed
 
f4e722f6
 include( PostInstall OPTIONAL)