Patrickquinn1212 icon

FindMyLib.cmake

Patrickquinn1212 | PRO | 10/08/22 01:37:49 PM UTC (Edited) | 0 ⭐ | 1114 👁️ | Never ⏰ | []
C |

1.16 KB

|

None

|

0 👍

/

0 👎

# The places to look for the MyLib folders
set(FIND_MyLib_PATHS   "/home/pat/Desktop/projects/Mylibraries")                              
 
# The location of the include folder (and thus the header files)
# find_path uses the paths we defined above as places to look
# Saves the location of the header files in a variable called MyLib_INCLUDE_DIR
find_path(MyLib_INCLUDE_DIR list.h,list.c   # The variable to store the path in and the name of the header files
        PATH_SUFFIXES include               # The folder name containing the header files
        PATHS ${FIND_MyLib_PATHS})       # Where to look (defined above)
 
# The location of the lib folder (and thus the .a file)
# find_library uses the paths we defined above as places to look
# Saves the location of the .a file in a variable called MyLib_LIBRARY
find_library(MyLib_LIBRARY               # The variable to store where it found the .a files
        NAMES MyLib                      # The name of the .a file (without the extension and without the 'lib')
        PATH_SUFFIXES lib                   # The folder the .a file is in
PATHS ${FIND_MyLib_PATHS})               # Where to look (defined above)

Comments

  • Patrickquinn1212 icon
    09/25/22 01:44:44 PM UTC (Edited)
    text |

    0 B

    |

    0 👍

    /

    0 👎

    time and time again. I could not get cmakelist.txt to pick up. In the end I renamed the file, and it just went