Re: [CMake] find_library doesn't find .dll on windows

2018-06-12 Thread Bo Zhou
Hi,

This is a feature/problem on Windows, the library used for dynamic linking
is not the runtime module as Linux or OSX but the .lib, a collection of
symbols.

I suggest you could still use find_library() to locate the .lib file for
linking, then use find_file() to collect the runtime file then install it
to the distribution.

Thanks.

On Fri, Jun 1, 2018 at 11:53 PM Romain LEGUAY 
wrote:

> Hi everyone,
>
> I try to find MYSQL dynamic library on windows.
> For this, I use the following command:
>
> set(_PF86 "ProgramFiles(x86)")
> find_library( MYSQL_LIBRARY
> NAME "libmysql.dll"
> PATHS "$ENV{PROGRAMFILES}/MySQL/*/lib"
>   "$ENV{${_PF86}}/MySQL/*/lib"
>   "$ENV{SYSTEMDRIVE}/MySQL/*/lib"
>   NO_DEFAULT_PATH)
>
> This command doesn't work on my computer (Windows 10 Pro x64, CMake
> 3.11.3).
> If I remove the .dll extension, find_library find libmysql.lib which is in
> the same folder as libmysql.dll.
>
> How to say to CMake to use the name I chosen?
>
> Thank you!
> Romain
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] CMakeLists.txt in different place than source

2018-06-12 Thread Andrew White
I have a situation where I want my CMakeLists.txt in a different place than my 
source.

e.g.:

/some/path/project/CMakeLists.txt
/other/path/source/src/a.c
/other/path/source/include/a.h

Is there an easy way to say "process this CMakeLists.txt as if it were in 
/other/path/source" (at least as far as file paths are concerned)?

e.g.:

add_library(my_lib
src/a.c
include/a.h
)

target_include_directories(my_lib PUBLIC include)

I know I can add a full path prefix to every file, but there are a lot of them. 
 I'm hoping for a shortcut.

--
Andrew


-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] Is there a way to customize the generate step trigger?

2018-06-12 Thread Ulrich Hierl

Hi folks,

my cmake code reads version tags from the underlying git repository, 
derives a new version with the help of the existing tags and then sets 
that new version to the project() call. However, the cmake generate step 
is not triggered when the version tags in the repository change, so the 
version that is compiled into the project is not always up-to-date. So I 
was wondering if CMake offers the possibility to customize the 
up-to-date check of the generate step, to make it automatically re-run 
when the tags in the repository are changed?


Thank you for your time.

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake