title: CMake; 386:x86-64 architecture of input file (.. ) is incompatible with i386 output
body: <p>I get this error when first doing 'cmake build' and then 'make':</p>
  
  <pre><code>/usr/bin/ld: i386:x86-64 architecture of input file `CMakeFiles/eperftool.dir/mp4reader.o' is incompatible with i386 output
  /usr/bin/ld: i386:x86-64 architecture of input file `CMakeFiles/eperftool.dir/codec_instance_mgmt.o' is incompatible with i386 output
  /usr/bin/ld: i386:x86-64 architecture of input file `CMakeFiles/eperftool.dir/callbacks.o' is incompatible with i386 output
  (...)"
  </code></pre>
  
  <p>This is the format of my make-file:</p>
  
  <pre><code>file (GLOB eperftool_sources ./*)
  
  set(EPERFTOOL_BIN ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}/eperftool CACHE STRING "eperftool dir")
  add_executable( eperftool ${eperftool_sources})
  
  
  find_package (Threads)
  if (Threads_FOUND)
    include_directories(${Threads_INCLUDE_DIRS})
  endif (Threads_FOUND)
  
  target_link_libraries(eperftool openfec m)
  
  target_link_libraries(eperftool ${CMAKE_THREAD_LIBS_INIT} )
  
  set(CMAKE_SHARED_LINKER_FLAGS "-m32")"
  </code></pre>
  
  <p>I added the final line 'set(CMAKE_SHARED_LINKER_FLAGS "-m32")' after Googling the problem and finding a person that has added the linker-flag '-m32' in order to solve it, but it didn't solve the problem for me.</p>
  
  <p>What should I do in order to solve the problem?</p>
  
  <p>Thanks!</p>