On Wednesday 20 December 2006 23:38, Mike Jackson wrote:
So in Project B's CMakeLists.txt file I have:
SUBDIRS(${PROJECT_SOURCE_DIR}/Project_A)
ADD_EXECUTABLE( MyProgram ${SOURCES})
TARGET_LINK_LIBRARIES( MyProgram ${A_LIB_OUTPUT_NAME})
As far as I understand it variables
Original-Nachricht
Datum: Wed, 20 Dec 2006 11:27:45 -0500
Von: Mike Jackson <[EMAIL PROTECTED]>
An: David Cole <[EMAIL PROTECTED]>
Betreff: Re: [CMake] How to get a variable that is defined in another
CMakeLists.txt file
> That did not seem to work either.
On Wednesday 20 December 2006 23:38, Mike Jackson wrote:
> So in Project B's CMakeLists.txt file I have:
>
> SUBDIRS(${PROJECT_SOURCE_DIR}/Project_A)
>
> ADD_EXECUTABLE( MyProgram ${SOURCES})
> TARGET_LINK_LIBRARIES( MyProgram ${A_LIB_OUTPUT_NAME})
As far as I understand it variables def
On Dec 20, 2006, at 3:15 PM, Axel Roebel wrote:
On Wednesday 20 December 2006 17:27, Mike Jackson wrote:
That did not seem to work either. Basically I am trying to set a
place where we can set the names of the libraries and apps and have
those found by other projects that depend on these base
On Wednesday 20 December 2006 17:27, Mike Jackson wrote:
> That did not seem to work either. Basically I am trying to set a
> place where we can set the names of the libraries and apps and have
> those found by other projects that depend on these base libraries.
>
>I have noticed that if you "I
That did not seem to work either. Basically I am trying to set a
place where we can set the names of the libraries and apps and have
those found by other projects that depend on these base libraries.
I have noticed that if you "INCLUDE(${PROJECT_SOURCE_DIR}/
FindHDF.cmake)" a file, in this
You can inherit from the top level CMakelists.txt variables.
So if the GET_DIRECTORY_PROPERTY command does not work for your case,
you can use the SET command in the top level CMakeLists.txt which calls
the command ADD_SUBDIRECTORY of your libraries A and B.
Something like:
IF(condition)
S
Try GET_DIRECTORY_PROPERTY with VARIABLES -- it should give you a list of
variables for that directory. It will only be accurate after the
ADD_SUBDIRECTORY for the given directory...
The presence or absence of the variable in question should give you the
"defined-ness" of it... As long as you can
well, that verified what I am seeing:
#-- from Project B CMakeLists.txt file
IF ( NOT DEFINED MHD_INTERFACE_LIB_NAME)
MESSAGE ( FATAL_ERROR "MHD_INTERFACE_LIB_NAME is not defined and
should be")
ENDIF ( NOT DEFINED )
where MHD_INTERFACE_LIB_NAME is defined in Project A, and I want to
use
DEFINED should be used with the variable name itself, not the value of the
variable:
IF(NOT DEFINED PROJECT_A_LIB_NAME)
Scratch the ${} and see what happens...
On 12/19/06, Mike Jackson <[EMAIL PROTECTED]> wrote:
I have couple of projects, lets call them A and B. In project A I
"SET" a varia
I have couple of projects, lets call them A and B. In project A I
"SET" a variable as follows:
SET (PROJECT_A_LIB_NAME MyLib)
then use that further down A's cmake file in the ADD_LIBRARY() function.
Now in Project B I would like to automagically be able to read the
PROJECT_A_LIB_NAME variab
11 matches
Mail list logo