Re: [CMake] CMake fails on Win7 x64 with VS 2012

2013-12-28 Thread Ansis Māliņš
Yes. It shouldn't matter though.


On Sat, Dec 28, 2013 at 3:08 PM, John Drescher  wrote:

> On Sat, Dec 28, 2013 at 9:05 AM, Ansis Māliņš 
> wrote:
> > Yes, I'm using Visual Studio 11 (aka 2012) generator.
>
> Did you try running cmake-gui from a Visual Studio 2012 x64 Command
> Prompt so that the compiler environment variables are set?
>
> John
>
--

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:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] CMake fails on Win7 x64 with VS 2012

2013-12-28 Thread Ansis Māliņš
Yes, I'm using Visual Studio 11 (aka 2012) generator.


On Sat, Dec 28, 2013 at 3:04 PM, John Drescher  wrote:

> On Sat, Dec 28, 2013 at 8:35 AM, Ansis Māliņš 
> wrote:
> > The minimal CMakeLists.txt with content
> >
> > CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
> > PROJECT(CMakeTest)
> >
> > on CMake 2.8.12.1 on Windows 7 64 bit with Visual Studio 2012 produces
> the
> > result
> >
> > CMake Error at C:/Program Files (x86)/CMake
> > 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:446
> > (execute_process):
> >   execute_process given COMMAND argument with no value.
> > Call Stack (most recent call first):
> >   C:/Program Files (x86)/CMake
> > 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:48
> > (CMAKE_DETERMINE_COMPILER_ID_VENDOR)
> >   C:/Program Files (x86)/CMake
> > 2.8/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:131
> > (CMAKE_DETERMINE_COMPILER_ID)
> >   CMakeLists.txt:2 (PROJECT)
> >
> >
> > The C compiler identification is unknown
> > CMake Error at C:/Program Files (x86)/CMake
> > 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:446
> > (execute_process):
> >   execute_process given COMMAND argument with no value.
> > Call Stack (most recent call first):
> >   C:/Program Files (x86)/CMake
> > 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:48
> > (CMAKE_DETERMINE_COMPILER_ID_VENDOR)
> >   C:/Program Files (x86)/CMake
> > 2.8/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake:127
> > (CMAKE_DETERMINE_COMPILER_ID)
> >   CMakeLists.txt:2 (PROJECT)
> >
> >
> > The CXX compiler identification is unknown
> > Configuring incomplete, errors occurred!
> >
> > What do?
> >
>
> Did you use the correct generator? Remember that Visual Studio 2012 is
> Visual Studio 11 not Visual Studio 12.
>
> John
>
--

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:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] CMake fails on Win7 x64 with VS 2012

2013-12-28 Thread Ansis Māliņš
The minimal CMakeLists.txt with content

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(CMakeTest)

on CMake 2.8.12.1 on Windows 7 64 bit with Visual Studio 2012 produces the
result

CMake Error at C:/Program Files (x86)/CMake
2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:446
(execute_process):
  execute_process given COMMAND argument with no value.
Call Stack (most recent call first):
  C:/Program Files (x86)/CMake
2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:48
(CMAKE_DETERMINE_COMPILER_ID_VENDOR)
  C:/Program Files (x86)/CMake
2.8/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:131
(CMAKE_DETERMINE_COMPILER_ID)
  CMakeLists.txt:2 (PROJECT)


The C compiler identification is unknown
CMake Error at C:/Program Files (x86)/CMake
2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:446
(execute_process):
  execute_process given COMMAND argument with no value.
Call Stack (most recent call first):
  C:/Program Files (x86)/CMake
2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:48
(CMAKE_DETERMINE_COMPILER_ID_VENDOR)
  C:/Program Files (x86)/CMake
2.8/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake:127
(CMAKE_DETERMINE_COMPILER_ID)
  CMakeLists.txt:2 (PROJECT)


The CXX compiler identification is unknown
Configuring incomplete, errors occurred!

What do?
--

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:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Where to put generated files.

2013-06-12 Thread Ansis Māliņš
Build directory. Every time. No exceptions.​
--

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

Re: [CMake] Listing headers in source lists

2013-06-11 Thread Ansis Māliņš
No, it's not necessary, and you don't have to list them. In fact, I didn't
know you *can* list them.
--

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

Re: [CMake] Cross-platform build under Windows targeting Linux

2013-06-10 Thread Ansis Māliņš
Don't bother. Setting up VirtualBox  with
Lubuntu  is way easier.​
--

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

Re: [CMake] "make superclean" target? (i.e. clear *everything*)

2013-04-04 Thread Ansis Māliņš
What would be the benefit of such a command besides syntax?
--

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

Re: [CMake] Link different libraries in different targets

2013-04-02 Thread Ansis Māliņš
Just add more link_directories commands or put more arguments in the one
your have:
link_directories("/path/to/libA" "path/to/libB")
--

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

Re: [CMake] Do not build targets whose dependencies are not available

2013-03-19 Thread Ansis Māliņš
find_package(a)
if(a_FOUND)
ExternalProject_Add(b PREFIX blabla ...)
endif()


On Mon, Mar 18, 2013 at 7:57 PM, Chris Stankevitz  wrote:

> Hello,
>
> I have a library target ("a") that is a dependency of an executable
> ("b").  I have many more libraries and many more executable, some with
> "complex" dependencies on the others.  Sometimes target "a" cannot be
> built either because the user does not want it built or because
> FIND_PACKAGE failed to find a dependency of "a".
>
> Q: Can cmake automatically not build "b" when "a" is not available?
>
> I hope the answer is "yes" otherwise I will have to add IF(HAVE_A)
> code throughout my CMakeLists.txt file.  Worse, in my complex file I
> will have to add lots of IF(HAVE_C), IF(HAVE_D) etc.
>
> Thank you,
>
> Chris
> --
>
> 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
>
--

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

Re: [CMake] Accessing data

2013-03-11 Thread Ansis Māliņš
One solution is to use CONFIGURE_FILE to produce a my_data_path.h file that
contains a #define to the data dir.
--

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

Re: [CMake] Read-only files lose their read-only attribute when packaged using either ZIP or NSIS

2013-03-08 Thread Ansis Māliņš
Out of curiosity, what is the read-only flag good for anyway?
--

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

Re: [CMake] ExternalProject and hardwired "src" directory

2013-03-05 Thread Ansis Māliņš
You can override parts of PREFIX with these
   TMP_DIR  = /tmp
   STAMP_DIR= /src/-stamp
   DOWNLOAD_DIR = /src
   SOURCE_DIR   = /src/
   BINARY_DIR   = /src/-build
   INSTALL_DIR  = 
--

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

Re: [CMake] ExternalProject and hardwired "src" directory

2013-03-05 Thread Ansis Māliņš
I don't think you're supposed to set PREFIX to a system path. To avoid
needing root to configure and compile among other things.

I always set PREFIX to CMAKE_BINARY_DIR and so far I can't imagine any
reason to ever set it to anything else.
--

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

Re: [CMake] Resolving static lib dependency at executable link time

2013-02-25 Thread Ansis Māliņš
>libB depends on libC and libC depends on libB.
How is that even possible? You compile B and it fails because there's no C
yet. You compile C and it fails because there's no B yet.
--

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

Re: [CMake] Please critique my "hello world" CMakeLists.txt and Config.cmake

2013-02-24 Thread Ansis Māliņš
# You don't need the .in file.

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

PROJECT(hello)

set (hello_VERSION_MAJOR 1)
set (hello_VERSION_MINOR 1)

ENABLE_TESTING()

ADD_LIBRARY(hello hello.cpp)

# This works just the same. Unless I'm missing something.
SET(hello_INCLUDE_DIRS

${CMAKE_INSTALL_PREFIX}/include/hello-${hello_VERSION_MAJOR}.${hello_VERSION_MINOR})
SET(hello_LIBRARIES

${CMAKE_INSTALL_PREFIX}/lib/hello-${hello_VERSION_MAJOR}.${hello_VERSION_MINOR}/libhello.a)

INSTALL(TARGETS hello DESTINATION
  lib/hello-${hello_VERSION_MAJOR}.${hello_VERSION_MINOR})

INSTALL(FILES helloConfig.cmake DESTINATION
  lib/hello-${hello_VERSION_MAJOR}.${hello_VERSION_MINOR})

INSTALL(FILES hello.h DESTINATION
  include/hello-${hello_VERSION_MAJOR}.${hello_VERSION_MINOR})
--

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

Re: [CMake] how to compile as 32bit on a 64bit Linux host ?

2013-02-15 Thread Ansis Māliņš
The *easiest* way is to use a virtual machine.
--

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

Re: [CMake] comparing strings

2013-02-14 Thread Ansis Māliņš
Never mind, I get it. What a landmine!
--

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

Re: [CMake] comparing strings

2013-02-14 Thread Ansis Māliņš
Uh, why are you talking about STREQUAL when the problem is with set(baz
foo)? It should set baz to "foo" not "bar" because there are no ${} around
foo.
--

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

Re: [CMake] Best way to 'pull through' dependencies of External projects?

2013-02-14 Thread Ansis Māliņš
If I guessed right, your problem is linker errors when building your
project. My solution is to just manually add whatever extra
target_link_libraries are needed to shut the linker up and move on.


On Thu, Feb 14, 2013 at 5:48 PM, Nick Overdijk  wrote:

> I don't really get your specific problem... CMake can find and install ITK
> and DCMTK just fine here? (I had to manipulate the linker-order of DCMTK a
> bit but that's almost to be expected, sadly).
>
> You're saying that when you find_package(DCMTK) it's libraries doesn't
> include some library it needs?
>
> On 2013-14-02, at 16:45:12 , Kent Williams wrote:
>
> The specific problem I'm trying to solve:
>
> Build DCMTK library, along with libraries upon which it depends, for use
> by ITK as a 'system library'
>
> The problem: Setting up the External Projects is simple enough; the
> problem is that the revision/configuration of TIFF -- 3.9.4 -- by default
> requires ZLib.
>
> DCMTK builds against this external TIFF library just fine.
>
> What doesn't happen?  The TIFF's ZLib dependency doesn't get propogated to
> builds that depend on DCMTK, so Zlib is not on the DCMTK library list.
>
> This wouldn't be a problem if TIFF and DCMTK were proper CMake builds. If
> they were when they export their libraries, find_package would carry along
> the dependencies of the imported libraries.
>
> There doesn't appear to be either an elegant or a quick & dirty solution
> to this. The problem is that until DCMTK creates proper CMake config files
> that clue in ITK to DCMTK's own dependencies, ITK's own CMake config files
> will not reflect those dependencies.
>
> Suggestions?
>
> Oh, and by the way I am trying to get DCMTK to generate proper
> configuration files for find_package(NO_MODULE):
> https://github.com/InsightSoftwareConsortium/DCMTK/tree/AddProperConfig
>  --
>
> 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
>
>
>
> --
>
> 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
>
--

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

Re: [CMake] Wrapper for cmake (configure-script)

2013-02-14 Thread Ansis Māliņš
So, it's for, for example, Slackware or Gentoo users, who install
everything from source and have the ./configure & make & make install combo
ingrained in their motor memory?


On Thu, Feb 14, 2013 at 10:59 AM, Richard Wiedenhöft <
richard.wiedenho...@gmail.com> wrote:

> Hello,
>
> I recently started writing a configure shell-script that is calling
> cmake and accepts options similar to the autotools configure script.
>
> https://github.com/Richard-W/cmake-configure-wrapper
>
> Maybe it is useful to some of you.
>
> As of now it is only supporting the CC, CXX and --prefix option, because
> they are sufficient for me. Contributions however are very welcome.
>
> ~Richard
>
> --
>
> 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
>
--

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

Re: [CMake] CPack: Packaging debug and release configurations in a single zip

2013-02-07 Thread Ansis Māliņš
How about something like this:

if(${CMAKE_BUILD_TYPE STREQUAL DebugAndRelease)
include(ExternalProject)
ExternalProject_Add(MEDEBUG
CMAKE_FLAGS -DCMAKE_BUILD_TYPE Debug)
ExternalProject_Add(MERELEASE
CMAKE_FLAGS -DCMAKE_BUILD_TYPE Release)
install(FILES ...)
#etc, etc.
return()
endif()
# the usual build code comes after

That is, add a new special build type, that, when built, makes the project
just build itself twice as an external project, package it up, and exit
before the normal build code.
--

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

Re: [CMake] Linker command line length issues when cross-compiling from Windows->Linux

2013-02-06 Thread Ansis Māliņš
In case you haven't thought of it, you could run actual Linux in VirtualBox
and not have to deal with cross compilation.
--

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

Re: [CMake] When should I use add_subdirectory and when ExternalProject?

2013-02-04 Thread Ansis Māliņš
>SuperBuild pattern
Tell me all about it!
--

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

Re: [CMake] External dependencies and Windows

2013-02-04 Thread Ansis Māliņš
It looks like I'm still asking the wrong questions.

As a last resort, here's my specific problem: I want to compile and run a
hello world SDL2 application on Windows, Linux, and OS X - purely as an
exercise in CMake. How would YOU do this?

SDL2 only exists in source form in their repository.

This is my main.cpp:
#include 
int main(int argc, char** argv)
{
if (SDL_Init(SDL_INIT_VIDEO) < 0) printf("FAILURE\n");
 else printf("SUCCESS\n");
SDL_Quit();
 return 0;
}
--

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

Re: [CMake] External dependencies and Windows

2013-02-04 Thread Ansis Māliņš
Exactly! So, going back to my original question, how do I use CMake in face
of DLL Hell?


On Mon, Feb 4, 2013 at 2:58 PM, Michael Wild  wrote:

> That has nothing to do whether the libraries are shared (i.e. dynamically
> linked) or not. It has to do with the way that packaging works (or rather,
> doesn't work) on Windows. In the pre-.NET era it was simply impossible to
> use library versioning on Windows. If package A installed python.dll
> version X.Y into C:\Windows\System32 and later package B installed version
> Z.F into the same place, package A stopped working. Further, packagers
> where essentially forced to include all dependencies in their packages
> because there's no dependency-resolution mechanism. That's why people
> started providing a copy of all the dependencies in the installation
> directory of their package. Of course, this leads to a lot of duplication,
> especially for rather popular things such as Python or Qt. The whole
> situation is referred to as "DLL hell":
> http://en.wikipedia.org/wiki/DLL_Hell
>
> Michael
>
>
> On Mon, Feb 4, 2013 at 1:43 PM, Ansis Māliņš wrote:
>
>> If shared libraries on Windows are truly shared, then why so many
>> applications carry their own copies of that same Qt and Python? Examples
>> from my own Program Files: Anki, Blender, Mixxx, Mumble, TortoiseHg.
>>
>>
>> On Mon, Feb 4, 2013 at 2:15 PM, Michael Wild  wrote:
>>
>>> Hi
>>>
>>>
>>> On Mon, Feb 4, 2013 at 12:43 PM, Ansis Māliņš wrote:
>>>
>>>> I'm just learning CMake and posting questions in this mailing list, but
>>>> the answers I get only confuse me. It seems I must take a step back and ask
>>>> more general questions.
>>>>
>>>> In Linux there is a package for everything, so you just find_package
>>>> whatever you need.
>>>>
>>>> But on Windows most libraries exist only as zip files that you're
>>>> supposed to unpack right in your build environment and ship them together
>>>> with the executable. (Basically, in practice, there is no such thing as
>>>> shared libraries in Windows - nothing for find_package to find.)
>>>>
>>>
>>> What then are DLL's? They are the shared libraries of the Windows world.
>>> True, the semantics are a bit different, but they are dynamically linked.
>>> It's also not true that on Windows everything is a "zip files that you're
>>> supposed to unpack right in your build environment". If you don't believe
>>> me, try to take a look at Qt or Python.
>>>
>>>
>>>>
>>>> So how am I supposed to write portable CMake scripts in face of this?
>>>>
>>>
>>>
>>>  Often the Windows packages are installed into a few well known
>>> locations, or even better, create a registry key containing installation
>>> information which you then can use to find the software in your CMake code.
>>> Also, for SDL I would recommend to use the FindSDL.cmake module (not sure
>>> whether that works with SDL2, though), and only if that fails, to resort to
>>> ExternalProject. It is good practice to offer the user the choice which way
>>> should be used through a cached variable.
>>>
>>> HTH
>>>
>>> Michael
>>>
>>
>>
>
--

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

Re: [CMake] External dependencies and Windows

2013-02-04 Thread Ansis Māliņš
If shared libraries on Windows are truly shared, then why so many
applications carry their own copies of that same Qt and Python? Examples
from my own Program Files: Anki, Blender, Mixxx, Mumble, TortoiseHg.


On Mon, Feb 4, 2013 at 2:15 PM, Michael Wild  wrote:

> Hi
>
>
> On Mon, Feb 4, 2013 at 12:43 PM, Ansis Māliņš wrote:
>
>> I'm just learning CMake and posting questions in this mailing list, but
>> the answers I get only confuse me. It seems I must take a step back and ask
>> more general questions.
>>
>> In Linux there is a package for everything, so you just find_package
>> whatever you need.
>>
>> But on Windows most libraries exist only as zip files that you're
>> supposed to unpack right in your build environment and ship them together
>> with the executable. (Basically, in practice, there is no such thing as
>> shared libraries in Windows - nothing for find_package to find.)
>>
>
> What then are DLL's? They are the shared libraries of the Windows world.
> True, the semantics are a bit different, but they are dynamically linked.
> It's also not true that on Windows everything is a "zip files that you're
> supposed to unpack right in your build environment". If you don't believe
> me, try to take a look at Qt or Python.
>
>
>>
>> So how am I supposed to write portable CMake scripts in face of this?
>>
>
>
>  Often the Windows packages are installed into a few well known locations,
> or even better, create a registry key containing installation information
> which you then can use to find the software in your CMake code. Also, for
> SDL I would recommend to use the FindSDL.cmake module (not sure whether
> that works with SDL2, though), and only if that fails, to resort to
> ExternalProject. It is good practice to offer the user the choice which way
> should be used through a cached variable.
>
> HTH
>
> Michael
>
--

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] External dependencies and Windows

2013-02-04 Thread Ansis Māliņš
I'm just learning CMake and posting questions in this mailing list, but the
answers I get only confuse me. It seems I must take a step back and ask
more general questions.

In Linux there is a package for everything, so you just find_package
whatever you need.

But on Windows most libraries exist only as zip files that you're supposed
to unpack right in your build environment and ship them together with the
executable. (Basically, in practice, there is no such thing as shared
libraries in Windows - nothing for find_package to find.)

So how am I supposed to write portable CMake scripts in face of this?
--

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

Re: [CMake] When should I use add_subdirectory and when ExternalProject?

2013-02-04 Thread Ansis Māliņš
"SDL installation"? But there is no such thing. At least not on Windows.
... Right?


On Mon, Feb 4, 2013 at 1:10 PM, Michael Wild  wrote:

> In that case, clearly ExternalProject_Add. It is an external dependency,
> and should be treated as such. If a users have SDL already installed on
> their system, they're going to hate you for shipping it AGAIN in your
> package, possibly even wrecking their original installation of SDL. By
> providing download information in the ExternalProject_Add call, you can
> make things even fully automated for your user.
>
> Michael
>
>
> On Mon, Feb 4, 2013 at 9:23 AM, Ansis Māliņš wrote:
>
>> If I have a dependency (e.g. SDL2) that seems to work with
>> add_subdirectory just fine, should I still use ExternalProject_Add instead?
>> Given both ways work, what should I prefer? What are the tradeoffs?
>>
>> --
>>
>> 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
>>
>
>
--

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] When should I use add_subdirectory and when ExternalProject?

2013-02-04 Thread Ansis Māliņš
If I have a dependency (e.g. SDL2) that seems to work with add_subdirectory
just fine, should I still use ExternalProject_Add instead? Given both ways
work, what should I prefer? What are the tradeoffs?
--

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

Re: [CMake] Why does ExternalProject require root access?

2013-01-20 Thread Ansis Māliņš
There is no Bullet package for Ubuntu. But most importantly there is no
such thing as packages in Windows. So I have to build it into my app.

I also want to avoid having to alter the CMake files of my dependencies. I
want other devs to be able to just check out the latest version of Bullet
into a specific folder and hit compile on my meta project.
--

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

Re: [CMake] Why does ExternalProject require root access?

2013-01-20 Thread Ansis Māliņš
> I use add_subdirectory to add bullet and sdl.. Could you try that?
That's what I tried initially, but another external project dependent on
Bullet, btOgre, failed to find_package(Bullet). I think it's because when
CMake configures btOgre it expects Bullet binaries to be built and
installed already.
--

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] Why does ExternalProject require root access?

2013-01-20 Thread Ansis Māliņš
The line
ExternalProject_Add(bullet PREFIX ${PROJECT_SOURCE_DIR})
fails with
Install the project...
-- Install configuration: "Release"
CMake Error at cmake_install.cmake:38 (FILE):
  file cannot create directory: /usr/local/lib/pkgconfig.  Maybe need
  administrative privileges.

Why? How do I avoid needing root for building my project?

What I'm trying to do: Build several projects (bullet, ogre, btogre, sdl,
mygame) into one thing. ExternalProject seems like the correct way to do
that.

Lubuntu Linux 12.04
CMake 2.8.7
--

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