CMake generating much smaller *.a files than makefile

When converting from makefile to CMake, the resulting file sizes are hugely different.

size with makefile: 266k
size with cmake: 33K

Here are the files. Any insight would be very helpful!

Makefile:

LIBOBJ = dir.o io.o libprim.o list.o prim.o sm.o str.o dyn.o u_out.o
TARG	= libprim.a
CC	= g++
CFLAGS	= -g -DLINUX -I../../include/Api -I../include -Wno-write-strings

%.o: %.cpp
	$(CC) $(CFLAGS) -c $< -o $@

all: $(TARG)
$(TARG): $(LIBOBJ)
	ar r $(TARG) $(LIBOBJ)
	ranlib $(TARG)
	cp $(TARG) ../../lib

clean:
	/bin/rm -f $(TARG) *.o

CMakeLists.txt:

include_directories(../../include/Api)
include_directories(../include)

add_definitions( -DLIBPRIM_EXPORTS )
if(WIN32)
  add_definitions( -DMSVC_VERSION=${MSVC_VERSION} -D_CRT_SECURE_NO_WARNINGS )
else()
  add_definitions( -DLINUX -Wno-write-strings)
endif()

add_library(libprim STATIC
    dir.cpp
    io.cpp
    libprim.cpp
    list.cpp
    prim.cpp
    sm.cpp
    str.cpp
    dyn.cpp
    u_out.cpp
)

Could it be the ar and ranlib?

The Makefile version has the -g flag. Maybe you built the Release version with CMake and the difference is optimization and no debug symbols?

I will look into it.

That was it! Simply adding set(CMAKE_BUILD_TYPE Debug) made it the same size. Thx!