<p>Sorry for misunderstanding. I can reproduce only when calling from build folder without ctest:</p>

<pre><code> ./tests/test-output-pgsql-tablespace 
</code></pre>

<p>ctest explicitly says to use working directory:</p>

<pre><code> add_test(NAME ${test_name} COMMAND ${test_name}
    WORKING_DIRECTORY ${osm2pgsql_SOURCE_DIR})
</code></pre>

<p>However, I am not sure if osm2pgsql_SOURCE_DIR is set correctly on old cmake. Which version do you use?</p>

<p>Maybe replacing  ${osm2pgsql_SOURCE_DIR} with  ${PROJECT_SOURCE_DIR} or absolute path can help (then the changes will be needed).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/openstreetmap/osm2pgsql/issues/490#issuecomment-153060831">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AD2-7vZvcqxWLGHmpsK81tJ9avV-AJnoks5pB38GgaJpZM4GZqZC.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/openstreetmap/osm2pgsql/issues/490#issuecomment-153060831"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>