[CMake] Include directory issue ... -I are not separated?
Eric Noulard
eric.noulard at gmail.com
Wed Jun 20 10:55:28 EDT 2012
2012/6/20 Ateljevich, Eli <eli at water.ca.gov>:
> Hi Eric,
> Very kind of you to reply. It is true that my example had some detritus from one of the examples that I did not prune. I apologize for the sloppiness and your advice certainly saves me some problems with the linker later. However, it does not change the compile behavior. If I understood you correctly with your advice the new file is:
>
> add_library(Hydro file1.F90 file2.F90 sflux_9c.F90)
> include_directories ( $(NETCDF_INC) )
> add_executable (mymain mymain.F90 )
> target_link_libraries (pmymain Hydro $(NETCDF_LIBRARIES) )
>
>
> and the failure remains as below with the glued together -I lines:
> cd /home/myproj_cmake/build/Hydro && /usr/local/dms/pkg/openmpi/1.4.3-intel12.0/bin/mpif90 -o CMakeFiles/Hydro.dir/sflux_9c.F90.o -I/home/myproj_cmake/src/Hydro/-I/usr/local/dms/pkg/netcdf/4.1.3-intel12.0-parallel/include -c /home/myproj_cmake/src/Hydro/sflux_9c.F90
>
> Anything you would recommend? Where does the reference to Hydro even come from? Thanks!
Don't know.
What is the content of NETCDF_INC ?
Try
message(STATUS "NETCDF_INC=${NETCDF_INC}")
--
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
More information about the CMake
mailing list