When generating project files that depend on SFGUI the .lib file can't be found












0














I'm a bit stuck with an issue trying to build a simple test program using SFML and SFGUI. This is on Windows, and I've used cmake to generate Visual Studio 2017 projects.



First I cloned SFML and SFGUI from github and generated the solution files. I ran Visual Studio in administrator mode and build the INSTALL project with both release and debug targets so that they would all be built and dropped in C:Program Files (x86)SFML and C:Program Files (x86)SFGUI respectively. Everything built and installed fine right out of the box. I also added those two directories to my PATH environment variable. I can build and run the sample projects that come with SFGUI that show up in the solution file.



So now I go and create my own project, and things start to fall apart. Importing SFML itself works fine. I have a simple program that pops open a window and it works fine. When I add in find_package(SFGUI REQUIRED) CMake fails when the project tries to update. I get the following error:



2>CMake Error at C:/Program Files (x86)/SFGUI/cmake/SFGUITargets.cmake:78 (message):
2> The imported target "SFGUI::SFGUI" references the file
2>
2> "C:/Program Files (x86)/lib/SFGUI-d.lib"
2>
2> but this file does not exist. Possible reasons include:
2>
2> * The file was deleted, renamed, or moved to another location.
2>
2> * An install or uninstall procedure did not complete successfully.
2>
2> * The installation package was faulty and contained
2>
2> "C:/Program Files (x86)/SFGUI/cmake/SFGUITargets.cmake"
2>
2> but not all the files it references.


Notice in the error, the file is "C:/Program Files (x86)/lib/SFGUI-d.lib" and not "C:/Program Files (x86)/SFGUI/lib/SFGUI-d.lib". The former is an invalid directory, the latter actually exists.



Looking at the SFGUI cmake files, it looks like the variable _IMPORT_PREFIX is being set to C:/Program Files (x86)/, when I think it should be setting set to C:/Program Files (x86)/SFGUI. I think that variable is getting set by the call to set_target_properties in SFGUITargets[-debug].cmake. I'm not sure if this is the core issue, or if it is, why it's getting set wrong. Any ideas what I did wrong?



Here is the entirety of my CMakeLists.txt in case it helps:



cmake_minimum_required(VERSION 3.1)

set(PROJECT_NAME TestProj)

project(${PROJECT_NAME})

set(SOURCES src/main.cpp)

find_package(OpenGL REQUIRED)
find_package(SFML 2.5 REQUIRED COMPONENTS graphics window audio network system)
find_package(SFGUI REQUIRED) # Errors here. Without this line it's fine.

add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} sfml-graphics sfml-window sfml-audio sfml-network sfml-system)









share|improve this question



























    0














    I'm a bit stuck with an issue trying to build a simple test program using SFML and SFGUI. This is on Windows, and I've used cmake to generate Visual Studio 2017 projects.



    First I cloned SFML and SFGUI from github and generated the solution files. I ran Visual Studio in administrator mode and build the INSTALL project with both release and debug targets so that they would all be built and dropped in C:Program Files (x86)SFML and C:Program Files (x86)SFGUI respectively. Everything built and installed fine right out of the box. I also added those two directories to my PATH environment variable. I can build and run the sample projects that come with SFGUI that show up in the solution file.



    So now I go and create my own project, and things start to fall apart. Importing SFML itself works fine. I have a simple program that pops open a window and it works fine. When I add in find_package(SFGUI REQUIRED) CMake fails when the project tries to update. I get the following error:



    2>CMake Error at C:/Program Files (x86)/SFGUI/cmake/SFGUITargets.cmake:78 (message):
    2> The imported target "SFGUI::SFGUI" references the file
    2>
    2> "C:/Program Files (x86)/lib/SFGUI-d.lib"
    2>
    2> but this file does not exist. Possible reasons include:
    2>
    2> * The file was deleted, renamed, or moved to another location.
    2>
    2> * An install or uninstall procedure did not complete successfully.
    2>
    2> * The installation package was faulty and contained
    2>
    2> "C:/Program Files (x86)/SFGUI/cmake/SFGUITargets.cmake"
    2>
    2> but not all the files it references.


    Notice in the error, the file is "C:/Program Files (x86)/lib/SFGUI-d.lib" and not "C:/Program Files (x86)/SFGUI/lib/SFGUI-d.lib". The former is an invalid directory, the latter actually exists.



    Looking at the SFGUI cmake files, it looks like the variable _IMPORT_PREFIX is being set to C:/Program Files (x86)/, when I think it should be setting set to C:/Program Files (x86)/SFGUI. I think that variable is getting set by the call to set_target_properties in SFGUITargets[-debug].cmake. I'm not sure if this is the core issue, or if it is, why it's getting set wrong. Any ideas what I did wrong?



    Here is the entirety of my CMakeLists.txt in case it helps:



    cmake_minimum_required(VERSION 3.1)

    set(PROJECT_NAME TestProj)

    project(${PROJECT_NAME})

    set(SOURCES src/main.cpp)

    find_package(OpenGL REQUIRED)
    find_package(SFML 2.5 REQUIRED COMPONENTS graphics window audio network system)
    find_package(SFGUI REQUIRED) # Errors here. Without this line it's fine.

    add_executable(${PROJECT_NAME} ${SOURCES})
    target_link_libraries(${PROJECT_NAME} sfml-graphics sfml-window sfml-audio sfml-network sfml-system)









    share|improve this question

























      0












      0








      0







      I'm a bit stuck with an issue trying to build a simple test program using SFML and SFGUI. This is on Windows, and I've used cmake to generate Visual Studio 2017 projects.



      First I cloned SFML and SFGUI from github and generated the solution files. I ran Visual Studio in administrator mode and build the INSTALL project with both release and debug targets so that they would all be built and dropped in C:Program Files (x86)SFML and C:Program Files (x86)SFGUI respectively. Everything built and installed fine right out of the box. I also added those two directories to my PATH environment variable. I can build and run the sample projects that come with SFGUI that show up in the solution file.



      So now I go and create my own project, and things start to fall apart. Importing SFML itself works fine. I have a simple program that pops open a window and it works fine. When I add in find_package(SFGUI REQUIRED) CMake fails when the project tries to update. I get the following error:



      2>CMake Error at C:/Program Files (x86)/SFGUI/cmake/SFGUITargets.cmake:78 (message):
      2> The imported target "SFGUI::SFGUI" references the file
      2>
      2> "C:/Program Files (x86)/lib/SFGUI-d.lib"
      2>
      2> but this file does not exist. Possible reasons include:
      2>
      2> * The file was deleted, renamed, or moved to another location.
      2>
      2> * An install or uninstall procedure did not complete successfully.
      2>
      2> * The installation package was faulty and contained
      2>
      2> "C:/Program Files (x86)/SFGUI/cmake/SFGUITargets.cmake"
      2>
      2> but not all the files it references.


      Notice in the error, the file is "C:/Program Files (x86)/lib/SFGUI-d.lib" and not "C:/Program Files (x86)/SFGUI/lib/SFGUI-d.lib". The former is an invalid directory, the latter actually exists.



      Looking at the SFGUI cmake files, it looks like the variable _IMPORT_PREFIX is being set to C:/Program Files (x86)/, when I think it should be setting set to C:/Program Files (x86)/SFGUI. I think that variable is getting set by the call to set_target_properties in SFGUITargets[-debug].cmake. I'm not sure if this is the core issue, or if it is, why it's getting set wrong. Any ideas what I did wrong?



      Here is the entirety of my CMakeLists.txt in case it helps:



      cmake_minimum_required(VERSION 3.1)

      set(PROJECT_NAME TestProj)

      project(${PROJECT_NAME})

      set(SOURCES src/main.cpp)

      find_package(OpenGL REQUIRED)
      find_package(SFML 2.5 REQUIRED COMPONENTS graphics window audio network system)
      find_package(SFGUI REQUIRED) # Errors here. Without this line it's fine.

      add_executable(${PROJECT_NAME} ${SOURCES})
      target_link_libraries(${PROJECT_NAME} sfml-graphics sfml-window sfml-audio sfml-network sfml-system)









      share|improve this question













      I'm a bit stuck with an issue trying to build a simple test program using SFML and SFGUI. This is on Windows, and I've used cmake to generate Visual Studio 2017 projects.



      First I cloned SFML and SFGUI from github and generated the solution files. I ran Visual Studio in administrator mode and build the INSTALL project with both release and debug targets so that they would all be built and dropped in C:Program Files (x86)SFML and C:Program Files (x86)SFGUI respectively. Everything built and installed fine right out of the box. I also added those two directories to my PATH environment variable. I can build and run the sample projects that come with SFGUI that show up in the solution file.



      So now I go and create my own project, and things start to fall apart. Importing SFML itself works fine. I have a simple program that pops open a window and it works fine. When I add in find_package(SFGUI REQUIRED) CMake fails when the project tries to update. I get the following error:



      2>CMake Error at C:/Program Files (x86)/SFGUI/cmake/SFGUITargets.cmake:78 (message):
      2> The imported target "SFGUI::SFGUI" references the file
      2>
      2> "C:/Program Files (x86)/lib/SFGUI-d.lib"
      2>
      2> but this file does not exist. Possible reasons include:
      2>
      2> * The file was deleted, renamed, or moved to another location.
      2>
      2> * An install or uninstall procedure did not complete successfully.
      2>
      2> * The installation package was faulty and contained
      2>
      2> "C:/Program Files (x86)/SFGUI/cmake/SFGUITargets.cmake"
      2>
      2> but not all the files it references.


      Notice in the error, the file is "C:/Program Files (x86)/lib/SFGUI-d.lib" and not "C:/Program Files (x86)/SFGUI/lib/SFGUI-d.lib". The former is an invalid directory, the latter actually exists.



      Looking at the SFGUI cmake files, it looks like the variable _IMPORT_PREFIX is being set to C:/Program Files (x86)/, when I think it should be setting set to C:/Program Files (x86)/SFGUI. I think that variable is getting set by the call to set_target_properties in SFGUITargets[-debug].cmake. I'm not sure if this is the core issue, or if it is, why it's getting set wrong. Any ideas what I did wrong?



      Here is the entirety of my CMakeLists.txt in case it helps:



      cmake_minimum_required(VERSION 3.1)

      set(PROJECT_NAME TestProj)

      project(${PROJECT_NAME})

      set(SOURCES src/main.cpp)

      find_package(OpenGL REQUIRED)
      find_package(SFML 2.5 REQUIRED COMPONENTS graphics window audio network system)
      find_package(SFGUI REQUIRED) # Errors here. Without this line it's fine.

      add_executable(${PROJECT_NAME} ${SOURCES})
      target_link_libraries(${PROJECT_NAME} sfml-graphics sfml-window sfml-audio sfml-network sfml-system)






      c++ windows cmake sfml sfgui






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 12 '18 at 4:51









      Alex

      7,801104581




      7,801104581





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53256133%2fwhen-generating-project-files-that-depend-on-sfgui-the-lib-file-cant-be-found%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53256133%2fwhen-generating-project-files-that-depend-on-sfgui-the-lib-file-cant-be-found%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini