{"action":"opened","issue":{"url":"https://api.github.com/repos/cpputest/cpputest/issues/877","repository_url":"https://api.github.com/repos/cpputest/cpputest","labels_url":"https://api.github.com/repos/cpputest/cpputest/issues/877/labels{/name}","comments_url":"https://api.github.com/repos/cpputest/cpputest/issues/877/comments","events_url":"https://api.github.com/repos/cpputest/cpputest/issues/877/events","html_url":"https://github.com/cpputest/cpputest/issues/877","id":134331727,"number":877,"title":"CMake-generated Xcode builds fail","user":{"login":"charlesnicholson","id":3010295,"avatar_url":"https://avatars.githubusercontent.com/u/3010295?v=3","gravatar_id":"","url":"https://api.github.com/users/charlesnicholson","html_url":"https://github.com/charlesnicholson","followers_url":"https://api.github.com/users/charlesnicholson/followers","following_url":"https://api.github.com/users/charlesnicholson/following{/other_user}","gists_url":"https://api.github.com/users/charlesnicholson/gists{/gist_id}","starred_url":"https://api.github.com/users/charlesnicholson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlesnicholson/subscriptions","organizations_url":"https://api.github.com/users/charlesnicholson/orgs","repos_url":"https://api.github.com/users/charlesnicholson/repos","events_url":"https://api.github.com/users/charlesnicholson/events{/privacy}","received_events_url":"https://api.github.com/users/charlesnicholson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-17T16:37:22Z","updated_at":"2016-02-17T16:37:22Z","closed_at":null,"body":"These repro steps use the Xcode command-line tools, but I've confirmed that it happens in the GUI. This also happens if CppUTest is pulled in via a CMake ExternalProject_Add() command from another CMake project, which is how I found it.\r\n\r\n```\r\ngit clone https://github.com/cpputest/cpputest.git\r\ncd cpputest\r\ncmake -G Xcode\r\nxcodebuild\r\n```\r\n\r\nCppUTest, CppUTestExt, CppUTestTests all appear to build correctly, but the build fails during test discovery:\r\n\r\n```\r\nPhaseScriptExecution CMake\\ PostBuild\\ Rules tests/CppUTest.build/Debug/CppUTestTests.build/Script-44B36442352E44DA89F0468A.sh\r\n    cd /Users/cnicholson/src/cpputest\r\n    /bin/sh -c /Users/cnicholson/src/cpputest/tests/CppUTest.build/Debug/CppUTestTests.build/Script-44B36442352E44DA89F0468A.sh\r\necho \"Discovering Tests in CppUTestTests\"\r\nDiscovering Tests in CppUTestTests\r\ncd /Users/cnicholson/src/cpputest/tests && /usr/local/Cellar/cmake/3.4.3/bin/cmake -DTESTS_DETAILED:BOOL=OFF -DEXECUTABLE=CppUTestTests -P /Users/cnicholson/src/cpputest/cmake/Scripts/CppUTestBuildTimeDiscoverTests.cmake\r\nCMake Error at /Users/cnicholson/src/cpputest/cmake/Scripts/CppUTestBuildTimeDiscoverTests.cmake:42 (message):\r\n  Executable \"/Users/cnicholson/src/cpputest/tests/CppUTestTests -lg\" failed\r\n  with output:\r\n\r\n  No such file or directory\r\n\r\n  Please check that the excutable was added.\r\nCall Stack (most recent call first):\r\n  /Users/cnicholson/src/cpputest/cmake/Scripts/CppUTestBuildTimeDiscoverTests.cmake:75 (buildtime_discover_tests)\r\n  \r\n\r\n\r\nmake: *** [CppUTestTests_buildpart_0] Error 1\r\n\r\n** BUILD FAILED **\r\n\r\n\r\nThe following build commands failed:\r\n\tPhaseScriptExecution CMake\\ PostBuild\\ Rules tests/CppUTest.build/Debug/CppUTestTests.build/Script-44B36442352E44DA89F0468A.sh\r\n(1 failure)\r\n```\r\n\r\nThe issue appears to be that CMake is looking for\r\n`.../cpputest/tests/CppUTestTests`\r\nbut the executable actually lives at\r\n`.../cpputest/tests/[Debug|Release]/CppUTestTests`\r\n\r\nIt looks like the CMake script isn't putting the build configuration string into the path to the test executable when performing test discovery. Note that in other generators that don't have build configurations by default, like make and ninja, this isn't a problem; the path is correct there."}}