#
# This is CMakeLists for project: BitData_Static
#
project(BitData_Static)

# ${SRC} cmake file defines ${SOURCES} variable which holds all sources used during compilation
include_cmake(${SRC})

enable_all_warnings()
enable_warnings_as_errors()

# Add the given directories to those the compiler uses to search for include files.
# Relative paths are interpreted as relative to the current source directory.
include_directories(
	"${OPENIPC_ROOT}/Source/Public_Include"
	"${OPENIPC_ROOT}/Source/Foundation/CommonUtils/Public"
	"${OPENIPC_ROOT}/Source/Foundation/BitData"
	"${IPC_ROOT}/Private/InternalUtils"
	)

add_library(BitData_Objects OBJECT ${SOURCES} )

target_compile_definitions(BitData_Objects
    PRIVATE
        BITDATA_EXPORTS)

target_include_directories(BitData_Objects
    PUBLIC
        "${OPENIPC_ROOT}/Source/Public_Include")

set(DUMMY_SOURCE_FILE "${CMAKE_CURRENT_BINARY_DIR}/Generated/dummy.cpp")
if (NOT EXISTS "${DUMMY_SOURCE_FILE}")
    file(WRITE "${DUMMY_SOURCE_FILE}" "/*This is needed because some generators (e.g. Xcode) do not like targets that are only made up of objects*/")
endif()

add_library(BitData_Static STATIC ${DUMMY_SOURCE_FILE} $<TARGET_OBJECTS:BitData_Objects>)

set_target_properties(BitData_Objects PROPERTIES
                      OUTPUT_NAME BitData_Objects_${ARCHITECTURE_NAME}
                      FOLDER "/Foundation")

target_link_libraries(BitData_Static PUBLIC IndexList_Static
                                            CommonUtils
                                            InternalUtils)

set_target_properties(BitData_Static PROPERTIES
                      OUTPUT_NAME BitData_Static_${ARCHITECTURE_NAME}
                      FOLDER "/Foundation")

