[CMake] How to invoke a separate build with CMAKE_CUSTOM_TARGET?

Heine, Christian (EXTERN: VWGEDS) extern.christian.heine at volkswagen.de
Fri May 13 02:36:19 EDT 2011


I've followed your instructions, removed the obsolete lines but
no effect, the libbrOpenGL.dll which is located at ./lib is still 
missing on startup ...  

The br* stuff are my dependencies library which I've created 
and installed separatelly, not in context of the actual project.
The resulting dll's of those modules are installed to system32
folder.

What I've figured out is, that anything works if I place the 
libbrOpenGL.dll directly in the module/cmake root folder and
not at lib subdirectory ...

>Mit freundlichen Grüßen
>
Christian Heine

T-Systems on site services GmbH
Procurement Systems

>Telefon/phone: +49-5361-9-78564
>E-Mail: extern.christian.heine at volkswagen.de
>
--------------------------------------------------------------------------------

Christian Heine
Consultant
Alessandro-Volta-Straße 11, 38440 Wolfsburg
+49-5361-464 78-x (Tel.)
+49-5361-464 78-10 (Fax)
E-Mail: christian.heine at t-systems.com
Internet: http://www.t-systems-onsite.de 

Geschäftsführung: Stefan Kappe, Georg Rätker
Handelsregister: Amtsgericht Berlin HRB 51336
Sitz der Gesellschaft: Berlin
Ust.-Id Nr. DE 181 120 485

--------------------------------------------------------------------------------

Notice: This transmittal and/or attachments may be privileged or confidential. If you are not the intended recipient, you are hereby notified that you have received this transmittal in error; any review, dissemination, or copying is strictly prohibited. If you received this transmittal in error, please notify us immediately by reply and immediately delete this message and all its attachments. Thank you.

-----Ursprüngliche Nachricht-----
Von: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] Im Auftrag von Rolf Eike Beer
Gesendet: Donnerstag, 12. Mai 2011 17:29
An: cmake at cmake.org
Betreff: Re: [CMake] How to invoke a separate build with CMAKE_CUSTOM_TARGET?

Am Donnerstag, 12. Mai 2011, 14:51:42 schrieb Heine, Christian:
> Hmm, this is strange. I've followed your instructions, but those take no
> effect. When i try to run the executable I got the failure message box that
> my libbrOpenGL.dll of the acutal build result is missing. Here is what I do
> on demo build:
> 
> INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}
> 		        ${CMAKE_CURRENT_SOURCE_DIR}
>                     ${CMAKE_SOURCE_DIR}/include
>                     ${COMPILER_ROOT}/include/binrev
> )
> 
> # Find OpenGL library using default CMake find script
> FIND_PACKAGE(OpenGL REQUIRED)
> 
> # create output directory
> SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
> 
> # Make sure the linker can find our libraries once they are built.
> LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib)

This is basically always wrong. Since you usually pass absolute paths to 
target_link_libraries() this doesn't help in any way but may cause trouble. 
Just don't do it.

> # Find our cmake utils with different reusable macros
> FIND_PACKAGE(OpenGL REQUIRED)

You already did that before.

> # create exectuable
> SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)

Since CMAKE_RUNTIME_OUTPUT_DIRECTORY is already set you should not need that 
anymore.

> ADD_EXECUTABLE(mydemo demo_win32Camera.cpp)
> 
> #link test libraries for unit tests
> TARGET_LINK_LIBRARIES( mydemo
>        	           brOpenGL  # this is the library of the actual build
>        	           brCore brMath brGraphics # this are other required 
libs
> )

These br* things are be created by add_library(... shared ...) in your 
project, no? Then this should work if you had previously set 
CMAKE_LIBRARY_OUTPUT_DIRECTORY to bin or so.

Eike


More information about the CMake mailing list