Re: [CMake] using macros

2016-01-15 Thread Owen Hogarth II
Yes, indeed. Yikes, thanks for this!

On Thu, Jan 14, 2016, 17:21 Petr Kmoch <petr.km...@gmail.com> wrote:

> Hi Owen.
>
> As a sanity check, the definition of the macro in the toplevel CMakeList
> comes *before* the add_subdirectory() command for the one which errors out,
> right?
>
> Petr
>
> On Thu, Jan 14, 2016 at 8:25 AM, Owen Hogarth II <gurenc...@gmail.com>
> wrote:
>
>> I am trying to use a macro to enable c99 in some of my cmake modules.
>>
>> In the top level cmake file I add this macro
>>
>> macro(use_c99)
>>   if (CMAKE_VERSION VERSION_LESS "3.1")
>> if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
>>   set (CMAKE_C_FLAGS "--std=gnu99 ${CMAKE_C_FLAGS}")
>> endif ()
>>   else ()
>> set (CMAKE_C_STANDARD 99)
>>   endif ()
>> endmacro(use_c99)
>>
>> then in another CMakeLists.txt file I add
>> use_c99()
>>
>> but I get this error:
>>
>> CMake Error at source/internal_src/cube/CMakeLists.txt:1 (use_c
>> 99):
>>   Unknown CMake command "use_c99".
>>
>> why am I unable to use the macro? My main cmake is using 3.0.2 from
>> debian repository.
>>
>>
>> --
>>
>> 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://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] using macros

2016-01-13 Thread Owen Hogarth II
I am trying to use a macro to enable c99 in some of my cmake modules.

In the top level cmake file I add this macro

macro(use_c99)
  if (CMAKE_VERSION VERSION_LESS "3.1")
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
  set (CMAKE_C_FLAGS "--std=gnu99 ${CMAKE_C_FLAGS}")
endif ()
  else ()
set (CMAKE_C_STANDARD 99)
  endif ()
endmacro(use_c99)

then in another CMakeLists.txt file I add
use_c99()

but I get this error:

CMake Error at source/internal_src/cube/CMakeLists.txt:1 (use_c
99):
  Unknown CMake command "use_c99".

why am I unable to use the macro? My main cmake is using 3.0.2 from debian
repository.
-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] debugging symbols in project

2016-01-02 Thread Owen Hogarth II
wow, that was a silly mistake, my builds are automated and I removed that
line somewhere along the line.

Thanks!

On Sun, Jan 3, 2016 at 5:28 AM, Rainer Poisel <rainer.poi...@gmail.com>
wrote:

> Owen,
>
> sorry, I replied directly to you instead of replying to this mailing list.
>
> Have you tried passing "-DCMAKE_BUILD_TYPE=Debug" to CMake when invoking
> it?
>
> It is also possible to set this option when using "cmake-gui".
>
> Many regards,
>   Rainer
>
>
> On Sat, Jan 2, 2016 at 9:23 PM, Owen Hogarth II <gurenc...@gmail.com>
> wrote:
> > I have a simple cmake project that I am trying to test with gdb but I am
> > having trouble. GDB is reporting now debugging symbols.
> >
> > CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
> > PROJECT(core_e)
> >
> >
> > SET(CMAKE_MACOSX_RPATH 1)
> >
> > set(CMAKE_C_FLAGS "-g -Wall")
> >
> > FIND_PACKAGE(OpenGL REQUIRED)
> >
> > SET(HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/headers/core_e.h)
> > SET(SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/core_e.c)
> > SET(TARGET_LIBS glfw ${OPENGL_LIBRARIES})
> > SET(TARGET_INC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/headers" )
> >
> > ADD_LIBRARY(core_e SHARED ${SRC_FILES} ${HEADER_FILES})
> > TARGET_LINK_LIBRARIES(core_en\ ${TARGET_LIBS})
> > TARGET_INCLUDE_DIRECTORIES(core_e PUBLIC ${TARGET_INC_DIR})
> >
> >
> >
> >
> > --
> >
> > 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://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] debugging symbols in project

2016-01-02 Thread Owen Hogarth II
I have a simple cmake project that I am trying to test with gdb but I am
having trouble. GDB is reporting now debugging symbols.

CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
PROJECT(core_e)


SET(CMAKE_MACOSX_RPATH 1)

set(CMAKE_C_FLAGS "-g -Wall")

FIND_PACKAGE(OpenGL REQUIRED)

SET(HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/headers/core_e.h)
SET(SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/core_e.c)
SET(TARGET_LIBS glfw ${OPENGL_LIBRARIES})
SET(TARGET_INC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/headers" )

ADD_LIBRARY(core_e SHARED ${SRC_FILES} ${HEADER_FILES})
TARGET_LINK_LIBRARIES(core_en\ ${TARGET_LIBS})
TARGET_INCLUDE_DIRECTORIES(core_e PUBLIC ${TARGET_INC_DIR})
-- 

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://public.kitware.com/mailman/listinfo/cmake

[CMake] cross platform way to unzip

2015-12-22 Thread Owen Hogarth II
Hi

Is there a standardized way to unzip a file with cmake that can work on all
of cmake's target platforms?
-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] build order

2015-12-19 Thread Owen Hogarth II
Hi David

Thank you for the response, I thought that I was doing something wrong. I
mean it's documented and I followed the docs as close as possible to write
my scripts but there's literally no mention about how to solve this
external/ internal project setup in the official docs.

I saw some things online but I honestly it seemed overly complicated and
really prone to breaking.

I'll edit my project to make them all external projects and work from that
angle.

Thanks

On Sat, Dec 19, 2015 at 9:18 PM, David Cole <dlrd...@aol.com> wrote:

> Build the second thing as an ExternalProject, too, and use the DEPENDS
> keyword to make it build after the first thing.
>
> Don't try to mix-and-match external projects and non-external projects in
> the same CMake configure... It's just too much work to get things working
> in a reasonable cross-platform way. It's possible, but certainly not easy.
>
>
> David
>
>
> > On Dec 18, 2015, at 3:29 PM, Owen Hogarth II <gurenc...@gmail.com>
> wrote:
> >
> > If you download, compile and install a cmake project through external
> project
> >
> > How can I make sure that the external project is built before something
> that depends on that external project?
> > --
> >
> > 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://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] build order

2015-12-18 Thread Owen Hogarth II
If you download, compile and install a cmake project through external
project

How can I make sure that the external project is built before something
that depends on that external project?
-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] external project add and configure

2015-12-15 Thread Owen Hogarth II
In response to myself I've figure it out with using add_step function and
calling some commands.

Full source for what's working building both external libraries.

include(ExternalProject)

ExternalProject_Add(sdl
HG_REPOSITORY http://hg.libsdl.org/SDL
UPDATE_COMMAND hg pull -u http://hg.libsdl.org/SDL

CMAKE_ARGS -DSDL_STATIC:BOOL=FALSE
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}

SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDL

INSTALL_DIR ${CMAKE_BINARY_DIR}
)

ExternalProject_Get_Property(sdl install_dir)
SET(SDL_INSTALL_DIR ${install_dir})

ExternalProject_Add(sdl_image
DEPENDS sdl
HG_REPOSITORY http://hg.libsdl.org/SDL_image/
UPDATE_COMMAND hg pull -u http://hg.libsdl.org/SDL_image/
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image/./autogen.sh #this works

CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image/./configure
  --prefix=${SDL_INSTALL_DIR}

SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image

INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}
)
ExternalProject_Get_Property(sdl_image install_dir)
SET(SDL_IMAGE_INSTALL_DIR ${install_dir})

this installs the sdl things in
build-tree/lib
build-tree/include
build-tree/share

but even if I try to hardcode the path's they don't get picked up. The
other libraries not build with external project add cannot find those
files. How do I get those files to be picked up by the regular cmake build?

Also I have one further question though they might be related and can be
solved at the same time.

I would like to add this to my external projects, their include directories
are located in
TARGET_INCLUDE_DIRECTORIES(sdl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)



On Tue, Dec 15, 2015 at 8:47 PM, Owen Hogarth II <gurenc...@gmail.com>
wrote:

> I was able to build the external project that required cmake like this:
> include(ExternalProject)
>
> ExternalProject_Add(sdl
> HG_REPOSITORY http://hg.libsdl.org/SDL
> UPDATE_COMMAND hg pull -u http://hg.libsdl.org/SDL
>
> CMAKE_ARGS -DSDL_STATIC:BOOL=FALSE
> -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/lib
>
> SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDL
>
> INSTALL_DIR ${CMAKE_BINARY_DIR}
> )
> ExternalProject_Get_Property(sdl install_dir)
> SET(SDL_INSTALL_DIR ${install_dir})
>
>
> now this second file uses ./configure to set up it's environment.
> I can build it by going into the folder first running ./autogen.sh then
> ./configure ...
>
> or If I use this external project script below
> ExternalProject_Add(sdl_image
> DEPENDS sdl
> HG_REPOSITORY http://hg.libsdl.org/SDL_image/
> UPDATE_COMMAND hg pull -u http://hg.libsdl.org/SDL_image/
>
> # MAKE_COMMAND make
> CONFIGURE_COMMAND  ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image/./configure
> --prefix=${SDL_INSTALL_DIR}/lib
> #adding this prefix I get further in my build then I get an error
>
> SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image
>
> INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}
> )
>
> error:
> missing: line 81: aclocal-1.13:
>  command not found
> WARNING: 'aclocal-1.13' is missing on your system.
>  You should only need it if you modified 'acinclude.m4' or
>  'configure.ac' or m4 files included by 'configure.ac'.
>  The 'aclocal' program is part of the GNU Automake package:
>  <http://www.gnu.org/software/automake>
>  It also requires GNU Autoconf, GNU m4 and Perl in order to run:
>  <http://www.gnu.org/software/autoconf>
>  <http://www.gnu.org/software/m4/>
>  <http://www.perl.org/>
>
> I can't actually get cmake to run the autogen script for me. If I leave
> and manually go run ./autogen.sh and then re-run this cmake command things
> will built correctly.
>
> How can I run the autogen.sh command from within that
> "ExternalProject_Add(sdl_image ..)" block?
>
-- 

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://public.kitware.com/mailman/listinfo/cmake

[CMake] adding external project

2015-12-15 Thread Owen Hogarth II
I have been reading this:
https://cmake.org/cmake/help/v3.0/module/ExternalProject.html

trying to add sdl external project but I am  having issues. I created a new
cmake project to test.

I already downloaded the sdl library and can build it correctly by manually
calling cmake commands but this is how I'd like to distribute sdl w/ my
library.

here's my new test cmake:

cmake_minimum_required(VERSION2.8)
project(sdl_external)

include(ExternalProject)

ExternalProject_Add(sdl
HG_REPOSITORY clone http://hg.libsdl.org/SDL
# PREFIX ${CMAKE_SOURCE_DIR}/sdl

# SOURCE_DIR ${CMAKE_SOURCE_DIR}/sdl

# INSTALL_COMMAND cmake ../ PREFIX=${CMAKE_CURRENT_BINARY_DIR}
)

I get this build output:
cmake ../
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Hg: /usr/bin/hg (found version "3.1.2")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/blubee/sdk/test/build
Scanning dependencies of target sdl
[ 12%] Creating directories for 'sdl'
[ 25%] Performing download step (hg clone) for 'sdl'
-- Avoiding repeated hg clone, stamp file is up to date:
'/home/blubee/sdk/_b/build/test/
build/sdl-prefix/src/sdl-stamp/sdl-hginfo.txt'
[ 37%] No patch step for 'sdl'
[ 50%] Performing update step (hg pull) for 'sdl'
abort: no repository found in
' /home/blubee/sdk/test/build/sdl-prefix/src/sdl' (
.hg not found)!
CMakeFiles/sdl.dir/build.make:89: recipe for target
'sdl-prefix/src/sdl-stamp/sdl-update'
 failed
make[2]: *** [sdl-prefix/src/sdl-stamp/sdl-update] Error 255
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/sdl.dir/all' failed
make[1]: *** [CMakeFiles/sdl.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2

my external build file isn't very verbose but I don't get the error

why is it reporting that no repository found.
abort: no repository found in
'/home/blubee/sdk/test/build/sdl-prefix/src/sdl' (
.hg not found)!

Why isn't the mercurial project not being downloaded?
-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] adding external project

2015-12-15 Thread Owen Hogarth II
oh, that was it a typo!

A few more questions. I build the project like this:
ExternalProject_Add(sdl
HG_REPOSITORY http://hg.libsdl.org/SDL
UPDATE_COMMAND ""

CMAKE_ARGS -DSDL_STATIC:BOOL=FALSE
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/lib

SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDL

INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin
)

That seems to build everything and put everything in the right place.
Another thing that I did with other parts of my code was add these lines to
the end of the cmakelists.txt files

TARGET_INCLUDE_DIRECTORIES(mylib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/headers)

so that I can just #include "mylib" instead of the path to the file. With
this setup, I can't do target_include_directories from the
external_project_add command, how do I get those headers?

On Tue, Dec 15, 2015 at 6:26 PM, Nicholas Braden <nicholas11bra...@gmail.com
> wrote:

> What's the word "clone" doing in there? That should be a URL, not
> command parameters.
>
> On Tue, Dec 15, 2015 at 2:01 AM, Owen Hogarth II <gurenc...@gmail.com>
> wrote:
> > I have been reading this:
> > https://cmake.org/cmake/help/v3.0/module/ExternalProject.html
> >
> > trying to add sdl external project but I am  having issues. I created a
> new
> > cmake project to test.
> >
> > I already downloaded the sdl library and can build it correctly by
> manually
> > calling cmake commands but this is how I'd like to distribute sdl w/ my
> > library.
> >
> > here's my new test cmake:
> >
> > cmake_minimum_required(VERSION2.8)
> > project(sdl_external)
> >
> > include(ExternalProject)
> >
> > ExternalProject_Add(sdl
> > HG_REPOSITORY clone http://hg.libsdl.org/SDL
> > # PREFIX ${CMAKE_SOURCE_DIR}/sdl
> >
> > # SOURCE_DIR ${CMAKE_SOURCE_DIR}/sdl
> >
> > # INSTALL_COMMAND cmake ../ PREFIX=${CMAKE_CURRENT_BINARY_DIR}
> > )
> >
> > I get this build output:
> > cmake ../
> > -- The C compiler identification is GNU 4.9.2
> > -- The CXX compiler identification is GNU 4.9.2
> > -- Check for working C compiler: /usr/bin/cc
> > -- Check for working C compiler: /usr/bin/cc -- works
> > -- Detecting C compiler ABI info
> > -- Detecting C compiler ABI info - done
> > -- Check for working CXX compiler: /usr/bin/c++
> > -- Check for working CXX compiler: /usr/bin/c++ -- works
> > -- Detecting CXX compiler ABI info
> > -- Detecting CXX compiler ABI info - done
> > -- Found Hg: /usr/bin/hg (found version "3.1.2")
> > -- Configuring done
> > -- Generating done
> > -- Build files have been written to: /home/blubee/sdk/test/build
> > Scanning dependencies of target sdl
> > [ 12%] Creating directories for 'sdl'
> > [ 25%] Performing download step (hg clone) for 'sdl'
> > -- Avoiding repeated hg clone, stamp file is up to date:
> > '/home/blubee/sdk/_b/build/test/
> > build/sdl-prefix/src/sdl-stamp/sdl-hginfo.txt'
> > [ 37%] No patch step for 'sdl'
> > [ 50%] Performing update step (hg pull) for 'sdl'
> > abort: no repository found in '
> > /home/blubee/sdk/test/build/sdl-prefix/src/sdl' (
> > .hg not found)!
> > CMakeFiles/sdl.dir/build.make:89: recipe for target
> > 'sdl-prefix/src/sdl-stamp/sdl-update'
> >  failed
> > make[2]: *** [sdl-prefix/src/sdl-stamp/sdl-update] Error 255
> > CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/sdl.dir/all'
> failed
> > make[1]: *** [CMakeFiles/sdl.dir/all] Error 2
> > Makefile:76: recipe for target 'all' failed
> > make: *** [all] Error 2
> >
> > my external build file isn't very verbose but I don't get the error
> >
> > why is it reporting that no repository found.
> > abort: no repository found in
> > '/home/blubee/sdk/test/build/sdl-prefix/src/sdl' (
> > .hg not found)!
> >
> > Why isn't the mercurial project not being downloaded?
> >
> > --
> >
> > 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:

[CMake] external project add and configure

2015-12-15 Thread Owen Hogarth II
I was able to build the external project that required cmake like this:
include(ExternalProject)

ExternalProject_Add(sdl
HG_REPOSITORY http://hg.libsdl.org/SDL
UPDATE_COMMAND hg pull -u http://hg.libsdl.org/SDL

CMAKE_ARGS -DSDL_STATIC:BOOL=FALSE
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/lib

SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDL

INSTALL_DIR ${CMAKE_BINARY_DIR}
)
ExternalProject_Get_Property(sdl install_dir)
SET(SDL_INSTALL_DIR ${install_dir})


now this second file uses ./configure to set up it's environment.
I can build it by going into the folder first running ./autogen.sh then
./configure ...

or If I use this external project script below
ExternalProject_Add(sdl_image
DEPENDS sdl
HG_REPOSITORY http://hg.libsdl.org/SDL_image/
UPDATE_COMMAND hg pull -u http://hg.libsdl.org/SDL_image/

# MAKE_COMMAND make
CONFIGURE_COMMAND  ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image/./configure
--prefix=${SDL_INSTALL_DIR}/lib
#adding this prefix I get further in my build then I get an error

SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image

INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}
)

error:
missing: line 81: aclocal-1.13:
 command not found
WARNING: 'aclocal-1.13' is missing on your system.
 You should only need it if you modified 'acinclude.m4' or
 'configure.ac' or m4 files included by 'configure.ac'.
 The 'aclocal' program is part of the GNU Automake package:
 
 It also requires GNU Autoconf, GNU m4 and Perl in order to run:
 
 
 

I can't actually get cmake to run the autogen script for me. If I leave and
manually go run ./autogen.sh and then re-run this cmake command things will
built correctly.

How can I run the autogen.sh command from within that
"ExternalProject_Add(sdl_image ..)" block?
-- 

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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] external project add and configure

2015-12-15 Thread Owen Hogarth II
can I bump this, I have the build working just fine now and installing the
files in the correct directories, but I can't seem to get my non external
projects [the ones I wrote] to link or include with the external projects.

how can I get my local cmake projects to link with the files built
with ExternalProject_Add?

On Wed, Dec 16, 2015 at 12:53 AM, Owen Hogarth II <gurenc...@gmail.com>
wrote:

> In response to myself I've figure it out with using add_step function and
> calling some commands.
>
> Full source for what's working building both external libraries.
>
> include(ExternalProject)
>
> ExternalProject_Add(sdl
> HG_REPOSITORY http://hg.libsdl.org/SDL
> UPDATE_COMMAND hg pull -u http://hg.libsdl.org/SDL
>
> CMAKE_ARGS -DSDL_STATIC:BOOL=FALSE
> -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}
>
> SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDL
>
> INSTALL_DIR ${CMAKE_BINARY_DIR}
> )
>
> ExternalProject_Get_Property(sdl install_dir)
> SET(SDL_INSTALL_DIR ${install_dir})
>
> ExternalProject_Add(sdl_image
> DEPENDS sdl
> HG_REPOSITORY http://hg.libsdl.org/SDL_image/
> UPDATE_COMMAND hg pull -u http://hg.libsdl.org/SDL_image/
> COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image/./autogen.sh #this works
>
> CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image/./configure
>   --prefix=${SDL_INSTALL_DIR}
>
> SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image
>
> INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}
> )
> ExternalProject_Get_Property(sdl_image install_dir)
> SET(SDL_IMAGE_INSTALL_DIR ${install_dir})
>
> this installs the sdl things in
> build-tree/lib
> build-tree/include
> build-tree/share
>
> but even if I try to hardcode the path's they don't get picked up. The
> other libraries not build with external project add cannot find those
> files. How do I get those files to be picked up by the regular cmake build?
>
> Also I have one further question though they might be related and can be
> solved at the same time.
>
> I would like to add this to my external projects, their include
> directories are located in
> TARGET_INCLUDE_DIRECTORIES(sdl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
>
>
>
> On Tue, Dec 15, 2015 at 8:47 PM, Owen Hogarth II <gurenc...@gmail.com>
> wrote:
>
>> I was able to build the external project that required cmake like this:
>> include(ExternalProject)
>>
>> ExternalProject_Add(sdl
>> HG_REPOSITORY http://hg.libsdl.org/SDL
>> UPDATE_COMMAND hg pull -u http://hg.libsdl.org/SDL
>>
>> CMAKE_ARGS -DSDL_STATIC:BOOL=FALSE
>> -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/lib
>>
>> SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDL
>>
>> INSTALL_DIR ${CMAKE_BINARY_DIR}
>> )
>> ExternalProject_Get_Property(sdl install_dir)
>> SET(SDL_INSTALL_DIR ${install_dir})
>>
>>
>> now this second file uses ./configure to set up it's environment.
>> I can build it by going into the folder first running ./autogen.sh then
>> ./configure ...
>>
>> or If I use this external project script below
>> ExternalProject_Add(sdl_image
>> DEPENDS sdl
>> HG_REPOSITORY http://hg.libsdl.org/SDL_image/
>> UPDATE_COMMAND hg pull -u http://hg.libsdl.org/SDL_image/
>>
>> # MAKE_COMMAND make
>> CONFIGURE_COMMAND  ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image/./configure
>> --prefix=${SDL_INSTALL_DIR}/lib
>> #adding this prefix I get further in my build then I get an error
>>
>> SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image
>>
>> INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}
>> )
>>
>> error:
>> missing: line 81: aclocal-1.13:
>>  command not found
>> WARNING: 'aclocal-1.13' is missing on your system.
>>  You should only need it if you modified 'acinclude.m4' or
>>  'configure.ac' or m4 files included by 'configure.ac'.
>>  The 'aclocal' program is part of the GNU Automake package:
>>  <http://www.gnu.org/software/automake>
>>  It also requires GNU Autoconf, GNU m4 and Perl in order to run:
>>  <http://www.gnu.org/software/autoconf>
>>  <http://www.gnu.org/software/m4/>
>>  <http://www.perl.org/>
>>
>> I can't actually get cmake to run the autogen script for me. If I leave
>> and manually go run ./autogen.sh and then re-run this cmake command things
>> will built correctly.
>>
>> How can I run the autogen.sh command from within that
>> "ExternalProject_Add(sdl_image ..)" block?
>>
>

Re: [CMake] what options

2015-12-14 Thread Owen Hogarth II
Thanks for the clarification.

On Mon, Dec 14, 2015, 16:23 Attila Krasznahorkay <
attila.krasznahor...@gmail.com> wrote:

> Hi,
>
> Just to clarify: CMAKE_INSTALL_PREFIX is the variable that sets where the
> project will be installed. CMAKE_PREFIX_PATH is used (amongst other things)
> to find external projects during the configuration.
>
> Cheers,
>  Attila
>
> > On 13 Dec 2015, at 21:20, Owen Hogarth II <gurenc...@gmail.com> wrote:
> >
> > wow, that's excellent cmake -LAH lead me to the variable that I was
> looking for.
> >
> > Thank you very much Roger!
> >
> > On Mon, Dec 14, 2015 at 3:56 AM, Roger Leigh <rle...@codelibre.net>
> wrote:
> > On 13/12/2015 19:44, Owen Hogarth II wrote:
> > If you have a cmake project, what's the way to see what type of
> > configuration options are available?
> >
> > For example I know that I can pass -DCMAKE_PREFIX_PATH the set where the
> > project will be installed.
> >
> > Sometimes project creators add other things, such as building static or
> > share libraries, SSE, NEON or other flags like those.
> >
> > Is there a way to have cmake show all of those that the current project
> > has exposed?
> >
> > cmake -L[A][H] .
> >
> > Lists the cache variables to set, optionally including advanced options
> and help text.
> >
> > See "List non-advanced cached variables" in
> https://cmake.org/cmake/help/v3.4/manual/cmake.1.html
> >
> > These are also shown with cmake-gui, which lists them in the user
> interface.
> >
> >
> > Regards,
> > Roger
> > --
> >
> > 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://public.kitware.com/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:
> > http://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] what options

2015-12-13 Thread Owen Hogarth II
If you have a cmake project, what's the way to see what type of
configuration options are available?

For example I know that I can pass -DCMAKE_PREFIX_PATH the set where the
project will be installed.

Sometimes project creators add other things, such as building static or
share libraries, SSE, NEON or other flags like those.

Is there a way to have cmake show all of those that the current project has
exposed?
-- 

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://public.kitware.com/mailman/listinfo/cmake