Results 1 to 2 of 2

Thread: CMake and subdirectories

  1. #1
    Join Date
    Jan 2006
    Posts
    369
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default CMake and subdirectories

    I have this project which compiles using cmake, it compiles and works perfectly.

    Now, I want to embed this project as a subdir of another project using cmake the add_subdirectory() function.

    The problem I face is that the nested project uses:

    Qt Code:
    1. INCLUDE_DIRECTORIES( ../ . ${CMAKE_BINARY_DIR} )
    To copy to clipboard, switch view to plain text mode 

    However the problem is that the ${CMAKE_BINARY_DIR} is set to the top level directory, and when generating UI files the files are generated on the nested binary dir. Apparently I am doing something wrong, can anyone guide me?

  2. #2
    Join Date
    Jan 2006
    Posts
    369
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: CMake and subdirectories

    Solution: use this variable instead
    Qt Code:
    1. CMAKE_CURRENT_BINARY_DIR
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Searching files from directories & its subdirectories
    By ashukla in forum Qt Programming
    Replies: 4
    Last Post: 12th April 2014, 12:57
  2. Replies: 3
    Last Post: 30th March 2011, 10:30
  3. Replies: 4
    Last Post: 15th July 2010, 00:45
  4. OS X -- Using macdeployqt - where to put images and data subdirectories?
    By cometlinear in forum Installation and Deployment
    Replies: 1
    Last Post: 22nd February 2010, 21:48
  5. qmake + subdirectories
    By niko in forum Qt Programming
    Replies: 9
    Last Post: 14th April 2007, 18:50

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.