[CMake] Command line cmake not picking up variable that gets picked up in the GUI

2012-11-29 Thread katie outram
I am trying to automate my build process and before going down this path, I
set up findMYCODE script that requires a variable CODE_BUILD_DIR that the
user defines.This variable is the build directory for another code base
that my current code base is dependent on.   When I run CMAKE  in the gui,
and define the variable, the find script locates the necessary path/items
and this value is populated in the CMakeCache file.In the CMakeCache
file my variable is listed as

CODE_BUILD_DIR:PATH=C:/builddir/Win64/VC10/bin/Release

However ,when I go to the command line and try to pass the needed
build parameter via the command line, my value is not getting picked up and
so my solution does not get generated.   In order to get my solution I must
have this variable defined.

From the build directory where I am trying to complete the build I execute
the following command:

cmake -G Visual Studio 10 Win64
-DCODE_BUILD_DIR:PATH=C:/builddir/Win64/VC10/bin/Release c:\mysource

The variable CODE_BUILD_DIR int he above line is the first build directory
for another code base that my current code is dependent on.

I have tried several variations of this command line option and passing the
-D variable, with and without escaping my path, however I am not having any
success.   Without this parameter defined,* *I am unable to locate the
necessary libraries that I must use to link into my current code.

I am thinking that I am possibly missing something in my find script, or
maybe I'm not escaping the characters in my path correctly.

Does anyone have any suggestions?

Thanks
--

Powered by www.kitware.com

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

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

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

[CMake] (no subject)

2012-11-28 Thread katie outram
I have a problem where I have a build that depends on the output from
another build.   If I pass cmake the value of the libraries I want to
link against, I can see the libraries through my find script without a
problem using the find_library command.My problem is that I don't want
to make the user always tell me the name of the library before I can do the
compile since I am looking to automate the final build.

My first build creates a directory
build
--

Powered by www.kitware.com

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

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

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

[CMake] Find a library that matches a specific pattern

2012-11-28 Thread katie outram
I have a build that depends on the output from another build.   We can't
combine the code into one build due to other issues.

I need to get cmake to pass the values of the libraries I want to link
against. I have worked out a find script for my second build that
allows me to use the find_library command to pull the .lib file that I'm
looking for.However, I must force the user to specify the specific name
of the library and I need to avoid this and just be able to pick up the
value if the name passes validation and the version is any number since
ultimately this whole process will be automated and I don't want to have to
worry about specifying version numbers.
 My first build creates a directory

   - build
  - win64
  - VC10
  - bin
  - Release
 - filea1231.1.1.1.lib
 - fileb2341.1.1.1.lib
 - filec3451.1.1.1.lib


For the second build I force the user to tell me the path of the build
directory (i.e. C:\build\win64\VC10\bin\Release and assign this to a value
of first_build_dir)

I then have a find script where I am trying to find the library (i.e.
filea1231.1.1.1)

set (file_name filea1231.1.1.1)

find_library(my_library

name ${file_name}
PATHS ${first_build_dir}
)


The problem I have is that the filea1231.1.1.1 might change for the next
build (i.e filea1231.1.1.2).There is only one file named filea so I'd
like to be able to search for filea*.lib no matter what the versioning
information contains.

I thought I needed to go down the path of using a string(regex
match([filea0-9]+\\.[0-9]\\.[0-9]\\.[0-9] file_name) however I can't figure
out how to make this work in my current situation.

I then went down the path of trying the file(strings filea*.lib
file_name) option but it returned my ${first_build_dir} path

I'm looking for suggestions on how to handle pulling the changing file name
within cmake for use at anytime.

Thanks
--

Powered by www.kitware.com

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

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

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