Re: [CMake] Why is XXX_INCLUDE_DIRS plural and should it be deep?

2012-12-13 Thread Lori A. Pritchett-Sheats
My $0.02..I just completed a CMake system for a code project that required several TPLs (third party libraries) two of which were the NetCDF and HDF5. I struggled with the same problems you mention here. When I wrote my FindXXX modules, the standard I adopted was, XXX_INCLUDE_DIR only cont

Re: [CMake] How to use CMAKE_POLICY?

2012-12-13 Thread David Cole
You could use if(POLICY (if 2.6.2 supports that... I think it does, but it was very long ago..) to avoid the call on older CMakes. On Thu, Dec 13, 2012 at 6:31 AM, Marcel Loose wrote: > Hi all, > > I'm trying to figure out how to use the CMAKE_POLICY() command. I want to > get rid of the wa

[CMake] How to use CMAKE_POLICY?

2012-12-13 Thread Marcel Loose
Hi all, I'm trying to figure out how to use the CMAKE_POLICY() command. I want to get rid of the warning on CMP0017. I've strategically placed "cmake_policy(PUSH)", "cmake_policy(SET CMP0017 OLD)", and "cmake_policy(POP)" which solves the problem when configuring with CMake 2.8.9. However,

[CMake] Linking library with custom target

2012-12-13 Thread Reza Housseini
Hello I want to link a library to a custom target: add_custom_command( OUTPUT ${FILE} DEPENDS ${SRC} COMMAND ${EXECUTABLE} ARGS ${SRC} COMMENT "Generating ${FILE}" VERBATIM) add_custom_target(mytarget ALL DEPENDS ${FILE}) target_link_libraries(mytarget /usr/local/lib/libmylib.so)