SET( CFILES_OBJECT_CONFIG_PUBLIC
	aglob.c
	openicc_config.c
	openicc_core.c
	openicc_db.c
	openicc_io.c
	openicc_string.c
	xdg_bds.c
   )
SET( CFILES_OBJECT_CONFIG_PUBLIC ${CFILES_OBJECT_CONFIG_PUBLIC} PARENT_SCOPE )
SET( CFILES_OBJECT_CONFIG
	${CFILES_OBJECT_CONFIG_PUBLIC}
   )

CONFIGURE_FILE (
		"${CMAKE_CURRENT_SOURCE_DIR}/openicc_conf.h.in"
		"${CMAKE_BINARY_DIR}/src/include/openicc_conf.h"
		@ONLY
	)

SET( SOURCES ${CFILES_OBJECT_CONFIG} )

SET( EXTRA_LIBS ${EXTRA_LIBS} ${YAJL_LIBRARIES} )


IF(APPLE)
   INCLUDE_DIRECTORIES ( /Developer/Headers/FlatCarbon )
   FIND_LIBRARY( CARBON_LIBRARY Carbon )
   FIND_LIBRARY( IOKIT_LIBRARY IOKit )
   MARK_AS_ADVANCED( CARBON_LIBRARY )
   MARK_AS_ADVANCED( IOKIT_LIBRARY )
   SET(EXTRA_LIBS_CS ${CARBON_LIBRARY} ${IOKIT_LIBRARY})
ENDIF (APPLE)

#ADD_LIBRARY( OpenICC SHARED ${SOURCES} )
#TARGET_LINK_LIBRARIES (
#   OpenICC
#   ${EXTRA_LIBS} ${EXTRA_LIBS_CS} )
ADD_LIBRARY( openicc-static STATIC ${SOURCES} )
TARGET_LINK_LIBRARIES (
   openicc-static
   ${EXTRA_LIBS} ${EXTRA_LIBS_CS} )

#INSTALL( TARGETS openicc-static
#         RUNTIME DESTINATION bin
#         LIBRARY DESTINATION lib${LIB_SUFFIX}
#         ARCHIVE DESTINATION lib${LIB_SUFFIX} )


