FAIRDataPipeline / cppDataPipeline

C++ Implementation of the FAIR Data Pipeline API
http://www.fairdatapipeline.org/cppDataPipeline
Other
0 stars 2 forks source link

Do not use `CMAKE_SOURCE_DIR` or `PROJECT_NAME` for a library used by other projects #2

Closed kzscisoft closed 2 years ago

kzscisoft commented 2 years ago

I discovered this only yesterday but if you include another CMake project in your own (like users of this API will in their code) the variables of the child project will be overwritten by the parent when using:

add_subdirectory(/path/to/cppAPI)

and so CMAKE_SOURCE_DIR will point to the parent project, not the API anymore. Same applies to PROJECT_NAME taking the name of the parent project.

Need to use CMAKE_CURRENT_SOURCE_DIR and switch PROJECT_NAME to adding set( FDPAPI fdpapi ) and replacing PROJECT_NAME then with FDPAPI.

RyanJField commented 2 years ago

New code does not use either