diff --git a/CMakeLists.txt b/CMakeLists.txt index 95ee0c6..78df609 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -251,6 +251,20 @@ else() endif(WIN32 OR CYGWIN) # requirements + +include(CheckSymbolExists) +# Some platforms provide their own strlcpy & strlcat. (BSD, MacOSX) +# Others don't so we provide our own. (Most, but not all Linux) +# Define the preprocessor macro so libgps does not supply its own version. +check_symbol_exists(strlcpy string.h HAVE_STRLCPY) +if(HAVE_STRLCPY) + add_compile_options(-DHAVE_STRLCPY) +endif() +check_symbol_exists(strlcat string.h HAVE_STRLCAT) +if(HAVE_STRLCAT) + add_compile_options(-DHAVE_STRLCAT) +endif() + set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 44c6c17..16121b8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,15 +1,3 @@ -include(CheckSymbolExists) -# Some platforms provide their own strlcpy & strlcat. (BSD, MacOSX) -# Others don't so we provide our own. (Most, but not all Linux) -# Define the preprocessor macro so libgps does not supply its own version. -check_symbol_exists(strlcpy string.h HAVE_STRLCPY) -if(HAVE_STRLCPY) - add_compile_options(-DHAVE_STRLCPY) -endif() -check_symbol_exists(strlcat string.h HAVE_STRLCAT) -if(HAVE_STRLCAT) - add_compile_options(-DHAVE_STRLCAT) -endif() # global includes # not ideal but not so slow